diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 46c8a3bc78..cd6c9c4bcc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ ### Submit a bug report - Make sure you can reproduce it in the latest version of GitGuardian Shield. -- Open an issue on the [issue tracker](https://github.com/GitGuardian/gg-shield/issues). +- Open an issue on the [issue tracker](https://github.com/GitGuardian/ggshield/issues). ### Fix an open and confirmed bug @@ -13,11 +13,11 @@ ### Propose a new feature -- Open an issue on the [issue tracker](https://github.com/GitGuardian/gg-shield/issues/new?assignees=&labels=feature+request&template=feature_request.md&title=Feature+Request) with a `feature request` label. +- Open an issue on the [issue tracker](https://github.com/GitGuardian/ggshield/issues/new?assignees=&labels=feature+request&template=feature_request.md&title=Feature+Request) with a `feature request` label. ### Implement a new CI integration -- Open an issue on the [issue tracker](https://github.com/GitGuardian/gg-shield/issues/new?assignees=&labels=CI+integration&template=feature_request.md&title=CI+Integration:). +- Open an issue on the [issue tracker](https://github.com/GitGuardian/ggshield/issues/new?assignees=&labels=CI+integration&template=feature_request.md&title=CI+Integration:). - No core contributor review is necessary on this feature. - Submit a Pull request diff --git a/README.md b/README.md index 3266bd6f6f..744ed93ca8 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,25 @@ - + --- -# [GitGuardian Shield](https://github.com/GitGuardian/gg-shield): protect your secrets with GitGuardian +# [GitGuardian Shield](https://github.com/GitGuardian/ggshield): protect your secrets with GitGuardian [![PyPI](https://img.shields.io/pypi/v/ggshield?color=%231B2D55&style=for-the-badge)](https://pypi.org/project/ggshield/) [![Docker Image Version (latest semver)](https://img.shields.io/docker/v/gitguardian/ggshield?color=1B2D55&sort=semver&style=for-the-badge&label=Docker)](https://hub.docker.com/r/gitguardian/ggshield) -[![License](https://img.shields.io/github/license/GitGuardian/gg-shield?color=%231B2D55&style=for-the-badge)](LICENSE) -![GitHub stars](https://img.shields.io/github/stars/gitguardian/gg-shield?color=%231B2D55&style=for-the-badge) -![GitHub Workflow Status](https://img.shields.io/github/workflow/status/GitGuardian/gg-shield/Application%20Main%20Branch?style=for-the-badge) -[![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/gitguardian/gg-shield?style=for-the-badge)](https://www.codefactor.io/repository/github/gitguardian/gg-shield) -[![Codecov](https://img.shields.io/codecov/c/github/GitGuardian/gg-shield?style=for-the-badge)](https://codecov.io/gh/GitGuardian/gg-shield/) +[![License](https://img.shields.io/github/license/GitGuardian/ggshield?color=%231B2D55&style=for-the-badge)](LICENSE) +![GitHub stars](https://img.shields.io/github/stars/gitguardian/ggshield?color=%231B2D55&style=for-the-badge) +![GitHub Workflow Status](https://img.shields.io/github/workflow/status/GitGuardian/ggshield/Application%20Main%20Branch?style=for-the-badge) +[![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/gitguardian/ggshield?style=for-the-badge)](https://www.codefactor.io/repository/github/gitguardian/ggshield) +[![Codecov](https://img.shields.io/codecov/c/github/GitGuardian/ggshield?style=for-the-badge)](https://codecov.io/gh/GitGuardian/ggshield/) -The **GitGuardian shield** (gg-shield) is a CLI application that runs in your local environment +The **GitGuardian shield** (ggshield) is a CLI application that runs in your local environment or in a CI environment to help you detect more than 200 types of secrets, as well as other potential security vulnerabilities or policy breaks. **GitGuardian shield** uses our [public API](https://api.gitguardian.com/doc) through [py-gitguardian](https://github.com/GitGuardian/py-gitguardian) to scan your files and detect potential secrets in your code. **The `/v1/scan` endpoint of the [public API](https://api.gitguardian.com/doc) is stateless. We will not store any files you are sending or any secrets we have detected**. -You can also use gg-shield via the [pre-commit](https://pre-commit.com/) framework on your repositories, or as a standalone pre-commit either globally or locally. +You can also use ggshield via the [pre-commit](https://pre-commit.com/) framework on your repositories, or as a standalone pre-commit either globally or locally. -You'll need an **API Key** from [GitGuardian](https://dashboard.gitguardian.com/api/v1/auth/user/github_login/authorize?utm_source=github&utm_medium=gg_shield&utm_campaign=shield1) to use gg-shield. +You'll need an **API Key** from [GitGuardian](https://dashboard.gitguardian.com/api/v1/auth/user/github_login/authorize?utm_source=github&utm_medium=gg_shield&utm_campaign=shield1) to use ggshield. Add the API Key to your environment variables: @@ -85,7 +85,7 @@ Install and update using `pip`: $ pip install ggshield ``` -gg-shield supports **Python 3.6 and newer**. +ggshield supports **Python 3.6 and newer**. The package should run on MacOS, Linux and Windows. @@ -126,7 +126,7 @@ Commands: ## Scan command -`ggshield scan` is the main command for **gg-shield**, it has a few config +`ggshield scan` is the main command for **ggshield**, it has a few config options that can be used to override output behaviour. ```shell @@ -205,9 +205,9 @@ Commands: REPOSITORY is the clone URI or the path of the repository to scan. Examples: - ggshield scan repo git@github.com:GitGuardian/gg-shield.git + ggshield scan repo git@github.com:GitGuardian/ggshield.git - ggshield scan repo /repositories/gg-shield + ggshield scan repo /repositories/ggshield ``` - `Docker`: scan a Docker image after exporting its filesystem and manifest with the `docker save` command. @@ -401,7 +401,7 @@ Alternatively to setting the `GITGUARDIAN_API_URL` environment variable, set the ## Ignoring a secret -Useful for ignoring a revoked test credential or a false positive, there are three ways to ignore a secret with gg-shield: +Useful for ignoring a revoked test credential or a false positive, there are three ways to ignore a secret with ggshield: ### In code @@ -447,7 +447,7 @@ Create a `.pre-commit-config.yaml` file in your root repository: ```yaml repos: - - repo: https://github.com/gitguardian/gg-shield + - repo: https://github.com/gitguardian/ggshield rev: main hooks: - id: ggshield @@ -506,7 +506,7 @@ You can force override with the `--force` option: $ ggshield install --mode local --force ``` -If you already have a pre-commit executable file and you want to use gg-shield, +If you already have a pre-commit executable file and you want to use ggshield, all you need to do is to add this line in the file: ```shell @@ -545,7 +545,7 @@ Create a `.pre-commit-config.yaml` file in your root repository: ```yaml repos: - - repo: https://github.com/gitguardian/gg-shield + - repo: https://github.com/gitguardian/ggshield rev: main hooks: - id: ggshield-push @@ -602,7 +602,7 @@ Now you're good to go! A pre-receive hook allows you to reject commits from being pushed to a git repository if they do not validate every check. -You can find **gg-shield**'s pre-receive hook samples in the [doc/pre-receive.sample](doc/pre-receive.sample) and [doc/pre-receive-python.sample](doc/pre-receive-python.sample). +You can find **ggshield**'s pre-receive hook samples in the [doc/pre-receive.sample](doc/pre-receive.sample) and [doc/pre-receive-python.sample](doc/pre-receive-python.sample). ### Python git pre-receive hook @@ -674,7 +674,7 @@ Do not forget to add your [GitGuardian API Key](https://dashboard.gitguardian.co **ggshield's** support of GitHub comes in the form of GitHub actions. -The action for this repository is hosted at [gg-shield-action](https://github.com/GitGuardian/gg-shield-action). +The action for this repository is hosted at [ggshield-action](https://github.com/GitGuardian/ggshield-action). Configuring a GitHub workflow to use **ggshield** is as simple as adding a step to your project's workflow: @@ -694,7 +694,7 @@ jobs: with: fetch-depth: 0 # fetch all history so multiple commits can be scanned - name: GitGuardian scan - uses: GitGuardian/gg-shield-action@master + uses: GitGuardian/ggshield-action@master env: GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }} GITHUB_PUSH_BASE_SHA: ${{ github.event.base }} @@ -727,19 +727,19 @@ Do not forget to add your [GitGuardian API Key](https://dashboard.gitguardian.co # Circle CI -Circle CI is supported in **gg-shield** through [gg-shield-orb](https://github.com/GitGuardian/gg-shield-orb). +Circle CI is supported in **ggshield** through [ggshield-orb](https://github.com/GitGuardian/ggshield-orb). -To add gg-shield to your pipelines configure your `.circleci/config.yml` to add the gg-shield orb: +To add ggshield to your pipelines configure your `.circleci/config.yml` to add the ggshield orb: ```yaml orbs: - gg-shield: gitguardian/ggshield + ggshield: gitguardian/ggshield workflows: main: jobs: - - gg-shield/scan: - name: gg-shield-scan # best practice is to name each orb job + - ggshield/scan: + name: ggshield-scan # best practice is to name each orb job base_revision: << pipeline.git.base_revision >> revision: <> ``` @@ -748,7 +748,7 @@ Do not forget to add your [GitGuardian API Key](https://dashboard.gitguardian.co # Travis CI -To add gg-shield to your pipelines configure your `.travis.yml` to add a gg-shield scanning job: +To add ggshield to your pipelines configure your `.travis.yml` to add a ggshield scanning job: ```yml jobs: @@ -768,7 +768,7 @@ Do not forget to add your [GitGuardian API Key](https://dashboard.gitguardian.co # Jenkins -To add gg-shield to your pipelines configure your `Jenkinsfile` to add a gg-shield stage: +To add ggshield to your pipelines configure your `Jenkinsfile` to add a ggshield stage: ```groovy pipeline { @@ -793,7 +793,7 @@ Do not forget to add your [GitGuardian API Key](https://dashboard.gitguardian.co # Drone -To add gg-shield to your pipelines configure your `.drone.yml` to add a gg-shield stage: +To add ggshield to your pipelines configure your `.drone.yml` to add a ggshield stage: ```groovy kind: pipeline @@ -801,7 +801,7 @@ type: docker name: default steps: -- name: gg-shield +- name: ggshield image: gitguardian/ggshield:latest commands: - ggshield scan ci @@ -815,7 +815,7 @@ Do not forget to add your [GitGuardian API Key](https://dashboard.gitguardian.co > ⚠ Azure Pipelines does not support commit ranges outside of GitHub Pull Requests, therefore on push events in a regular branch only your latest commit will be scanned. > This limitation doesn't apply to GitHub Pull Requests where all the commits in the pull request will be scanned. -To add gg-shield to your pipelines configure your `azure-pipelines.yml` to add a gg-shield scanning job: +To add ggshield to your pipelines configure your `azure-pipelines.yml` to add a ggshield scanning job: ```yml jobs: diff --git a/doc/pre-receive-python.sample b/doc/pre-receive-python.sample index 3f43453cc9..4a84e6e787 100644 --- a/doc/pre-receive-python.sample +++ b/doc/pre-receive-python.sample @@ -1,5 +1,5 @@ #!/bin/bash -# gg-shield as a pre-commit hook +# ggshield as a pre-commit hook # Prequirements: # python >= 3.6, pip # Installation instructions: diff --git a/doc/pre-receive.sample b/doc/pre-receive.sample index 45191a687c..509ebdda8f 100644 --- a/doc/pre-receive.sample +++ b/doc/pre-receive.sample @@ -1,5 +1,5 @@ #!/bin/bash -# gg-shield as a pre-commit hook +# ggshield as a pre-commit hook # Move `pre-receive.sample` to `.git/hooks/pre-receive` # Do not forget to `chmod +x .git/hooks/pre-receive` # either set an environment variable machine wide `GITGUARDIAN_API_KEY` diff --git a/ggshield/__init__.py b/ggshield/__init__.py index 14d9d2f583..3c1e9cbd30 100644 --- a/ggshield/__init__.py +++ b/ggshield/__init__.py @@ -1 +1 @@ -__version__ = "1.7.0" +__version__ = "1.7.1" diff --git a/ggshield/dev_scan.py b/ggshield/dev_scan.py index 798fc53d00..55f7c516cd 100644 --- a/ggshield/dev_scan.py +++ b/ggshield/dev_scan.py @@ -73,9 +73,9 @@ def repo_cmd(ctx: click.Context, repository: str) -> int: # pragma: no cover REPOSITORY is the clone URI or the path of the repository to scan. Examples: - ggshield scan repo git@github.com:GitGuardian/gg-shield.git + ggshield scan repo git@github.com:GitGuardian/ggshield.git - ggshield scan repo /repositories/gg-shield + ggshield scan repo /repositories/ggshield """ config: Config = ctx.obj["config"] cache: Cache = ctx.obj["cache"] diff --git a/ggshield/ignore.py b/ggshield/ignore.py index cd8849aa64..e765a71600 100644 --- a/ggshield/ignore.py +++ b/ggshield/ignore.py @@ -9,7 +9,7 @@ @click.option( "--last-found", is_flag=True, - help="Ignore secrets found in the last gg-shield scan run", + help="Ignore secrets found in the last ggshield scan run", ) @click.pass_context def ignore(ctx: click.Context, last_found: bool) -> int: diff --git a/setup.py b/setup.py index b95316e15a..fd54cfb137 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ def get_version() -> str: description="Detect secrets from all sources using GitGuardian's brains", long_description=read("README.md"), long_description_content_type="text/markdown", - url="https://github.com/GitGuardian/gg-shield", + url="https://github.com/GitGuardian/ggshield", author="GitGuardian", author_email="support@gitguardian.com", maintainer="GitGuardian", diff --git a/tests/test_cli.py b/tests/test_cli.py index eeab1b2939..41e1bfe827 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -256,13 +256,13 @@ def test_invalid_scan_repo_github(self, cli_fs_runner): THEN a validation error proposing error correction should be shown """ result = cli_fs_runner.invoke( - cli, ["scan", "repo", "https://github.com/gitguardian/gg-shield"] + cli, ["scan", "repo", "https://github.com/gitguardian/ggshield"] ) assert result.exit_code == 1 assert ( - "Error: https://github.com/gitguardian/gg-shield doesn't seem to " + "Error: https://github.com/gitguardian/ggshield doesn't seem to " "be a valid git URL.\nDid you mean " - "https://github.com/gitguardian/gg-shield.git?" in result.output + "https://github.com/gitguardian/ggshield.git?" in result.output ) def test_invalid_scan_repo_url(self, cli_fs_runner): @@ -272,11 +272,11 @@ def test_invalid_scan_repo_url(self, cli_fs_runner): THEN a validation error should be shown """ result = cli_fs_runner.invoke( - cli, ["scan", "repo", "trial.gitguardian.com/gitguardian/gg-shield"] + cli, ["scan", "repo", "trial.gitguardian.com/gitguardian/ggshield"] ) assert result.exit_code == 1 assert ( - "Error: trial.gitguardian.com/gitguardian/gg-shield is" + "Error: trial.gitguardian.com/gitguardian/ggshield is" " neither a valid path nor a git URL" in result.output ) diff --git a/tests/test_docker.py b/tests/test_docker.py index b94d4c1cee..c92c8e2a59 100644 --- a/tests/test_docker.py +++ b/tests/test_docker.py @@ -94,11 +94,11 @@ def test_docker_scan( self, scan_mock: Mock, save_mock, cli_fs_runner: click.testing.CliRunner ): scan_mock.return_value = ScanCollection( - id="gg-shield-non-existant", type="docker", results=[] + id="ggshield-non-existant", type="docker", results=[] ) result = cli_fs_runner.invoke( cli, - ["-v", "scan", "docker", "gg-shield-non-existant"], + ["-v", "scan", "docker", "ggshield-non-existant"], ) assert result.exit_code == 0 @@ -109,11 +109,11 @@ def test_docker_scan_abort( ): save_mock.side_effect = click.exceptions.Abort() scan_mock.return_value = ScanCollection( - id="gg-shield-non-existant", type="docker", results=[] + id="ggshield-non-existant", type="docker", results=[] ) result = cli_fs_runner.invoke( cli, - ["-v", "scan", "docker", "gg-shield-non-existant"], + ["-v", "scan", "docker", "ggshield-non-existant"], ) assert result.output == "" assert result.exit_code == 0 @@ -127,11 +127,11 @@ def test_docker_scan_failed_to_save( 'Image "ggshield-non-existant" not found' ) scan_mock.return_value = ScanCollection( - id="gg-shield-non-existant", type="docker", results=[] + id="ggshield-non-existant", type="docker", results=[] ) result = cli_fs_runner.invoke( cli, - ["-v", "scan", "docker", "gg-shield-non-existant"], + ["-v", "scan", "docker", "ggshield-non-existant"], ) assert 'Error: Image "ggshield-non-existant" not found\n' in result.output assert result.exit_code == 1