infisical scan uses the scanner’s built-in rules, which cover the credential formats of hundreds of services. To add your own rules or skip paths, use a configuration file. The file uses the same format as the configuration for repository scans.
Use a configuration file
Create a file named.infisical-scan.toml in the directory you scan. To use a file with a different name or location, pass it with --config or set INFISICAL_SCAN_CONFIG.
If more than one of these is set, the CLI uses the first one in this order:
- The
--configflag - The
INFISICAL_SCAN_CONFIGenvironment variable .infisical-scan.tomlin the directory you scan
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:
.infisical-scan.toml
Whether to keep the built-in rules. The built-in rules and their IDs are in the CLI’s default configuration.
Another configuration file to extend instead of the built-in rules, relative to the directory you run the CLI in. You can’t set both
path and useDefault.Add a rule
Add a[[rules]] table for each kind of secret you want to detect:
.infisical-scan.toml
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.Allowlists
To ignore secrets in specific files or commits, or secrets that match a pattern, add an[[allowlists]] table to the configuration file:
.infisical-scan.toml