ggshield is a CLI application that runs in your local environment or in a CI environment to detect over 500 types of secrets, as well as other potential security vulnerabilities or policy breaks. It uses the GitGuardian public API through `py-gitguardian` for scanning. The current version is 1.49.0, with frequent releases addressing new features and fixes.
pip install ggshieldVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to run a basic secret scan using `ggshield` via Python's `subprocess` module. It creates a temporary file with a simulated secret, scans it, and prints the output. Prior to running, you must authenticate `ggshield` by either running `ggshield auth login` in your terminal or by setting the `GITGUARDIAN_API_KEY` environment variable for non-interactive environments like CI/CD.
Upgrade your GitHub Enterprise Server instance to a supported version, or migrate to a different `ggshield` integration (e.g., GitHub Actions, pre-commit hooks).
Prefer installing your self-signed certificates into your system's trust store. If absolutely necessary, use `--insecure` or `insecure: true` but be aware of the security risks involved.
Use `pipx install ggshield` for initial installation and `pipx upgrade ggshield` for updates. Ensure `pipx` is installed (`pip install pipx && pipx ensurepath`).
Add `.cache_ggshield/` to your project's `.gitignore` file to prevent it from being tracked.
Run `ggshield auth login` to authenticate interactively, or set the `GITGUARDIAN_API_KEY` environment variable with your GitGuardian API key, especially in CI/CD environments.