What is secret scanning?
Secret scanning is the process of checking code for secrets that were committed to version control by accident. This can include API keys, database credentials, and authentication tokens. As teams grow, it gets easy for a secret to end up in version control, a CI/CD pipeline, or a shared file. Anyone who can read that code can then use the secret to reach production systems, third-party services, or internal APIs. A secret scanner checks every change automatically, so a leaked secret is found and revoked before someone else finds it.How a scanner finds secrets
A scanner reads each line of code and compares it against a set of rules. Each rule describes one kind of secret, such as an AWS access key, with a pattern that the secret matches and keywords that a line must contain before the scanner checks the pattern. A rule can also require a minimum entropy, which measures how random a value is, so that a value likepassword123 isn’t reported as a generated key.
Infisical’s scanner includes rules for hundreds of services. You can add your own rules, and skip values you’ve decided are safe, in a configuration.
Where Infisical scans
Infisical can scan your code in two places, with the same built-in rules:- Before you push: The Infisical CLI scans your repository, a directory, or your uncommitted changes on your machine or in a CI job, and can block a commit that contains a secret
- After you push: Infisical scans the repositories in your GitHub, GitLab, and Bitbucket data sources and records each secret it finds as a finding that you can track until it’s handled