Secrets scanner

Last updated: Oct 28, 2026


Quick scan vs. configuration file

The secrets scanner has two modes of operation.

Quick scan: Scan a file or directory directly from the command line, without a configuration file. The scanner applies only the verified rules:

ss scan /path/to/repository

By default, this command shows the findings in the console. To exit with a non-zero status code when the scanner finds secrets, use --strict. This option helps in CI/CD pipelines:

ss scan /path/to/repository --strict

Configuration file: Use a YAML configuration file when a quick scan is not sufficient. With a configuration file, you can:

  • Include or exclude paths
  • Use preview rules
  • Write the results to a file

Use this command:

ss scan --config config.yaml

The remaining part of this page shows the configuration file options.

For the common configuration file keys of all the scanners, read Use a configuration file.

Specific configuration file keys

The secrets scanner has this key. Use it to configure the secret detection in a repository.

ss

This key sets the files that the scanner scans and how the detection works. All the options are optional:

  • include: The paths to the files or directories to scan, relative to working_dir. If you do not use it, the scanner scans the full working_dir.
  • exclude: Gitignore-style patterns for the files or directories to exclude. The scanner always excludes the .git/ directory automatically.
  • feature_preview: When you set it to true, the scanner uses the detection rules that are in beta and that wait for approval. The default value is false.

For example:

ss:
  include:
    - src/
    - config/
  exclude:
    - vendor/
    - "**/*.lock"
  feature_preview: false

Output configuration

Use the top-level output key to write the results to a file:

  • file_path (optional): The path of the report. The scanner gets the format from the file extension: use .sarif for a SARIF 2.1.0 report, or .csv for a CSV report. If you do not use it, the scanner shows the findings only in the console.
output:
  file_path: /results/fluid-attacks-results.sarif

Configuration file examples

Scanning a repository

language: EN
working_dir: /path/to/repository
output:
  file_path: /results/fluid-attacks-results.sarif
ss:
  include:
    - src/

Excluding paths

language: EN
working_dir: .
output:
  file_path: /results/fluid-attacks-results.sarif
ss:
  include:
    - src/
    - config/
  exclude:
    - vendor/
    - "**/*.lock"
    - "**/node_modules/"

Enabling preview rules

language: EN
working_dir: .
output:
  file_path: /results/fluid-attacks-results.sarif
ss:
  feature_preview: true

Failing the pipeline on findings

language: EN
strict: true
working_dir: .
output:
  file_path: /results/fluid-attacks-results.sarif
ss:
  include:
    - src/

Exporting results as CSV

language: EN
working_dir: .
output:
  file_path: /results/fluid-attacks-results.csv
ss:
  include:
    - src/

On this page