For repository scans, Infisical doesn’t use the files that local scans read, such as
.infisical-scan.toml, .infisicalignore, or a baseline report, even if they’re in your repository.Enter your rules and allowlists in the scanning configuration instead.Edit the scanning configuration
1
Go to Secret Scanning > Settings > Scanning Settings.
2
Enter your configuration in the text box, up to 5,000 characters.
3
Select Save.
Configuration format
A configuration replaces the scanner’s built-in rules unless it extends them.Keep the built-in rules
To keep the built-in rules and add yours to them, setuseDefault = true in the [extend] table:
Whether to keep the built-in rules. The built-in rules and their IDs are in the CLI’s default configuration.
path in the [extend] table to extend another configuration file.
Add a rule
Add a[[rules]] table for each kind of secret you want to detect:
id as a built-in rule, the fields you set replace the built-in rule’s fields.
A Go regular expression that matches the secret. A rule needs
regex, path, or both.A regular expression for file paths. On its own,
path makes the rule report every file whose path matches. With regex, the rule only checks files whose path matches.Ignore one line
To ignore a secret on one line of code, add abetterleaks:allow comment at the end of the line:
example.js
gitleaks:allow, so existing gitleaks:allow comments keep working.
Allowlists
To ignore secrets in specific files or commits, or secrets that match a pattern, add an[[allowlists]] table to the configuration: