SecretSleuth Talk to IronTech

DocsCommand reference

scan

Find likely secrets with a dry run, or seal them in place and turn on git protection with a full scan.

Try it

SecretSleuth --dry-run          # preview findings; scanned files and Git protection stay unchanged
SecretSleuth --full-scan        # obfuscate and protect

There is no scan subcommand to type: a scan is the tool run with --dry-run or --full-scan. --repo defaults to the current folder.

Choose exactly one mode; --dry-run and --full-scan cannot be combined. Running the tool without arguments shows help, and --repo alone does not start a scan.

How it works

--dry-runmarks what it found

"Smtp": {
  "Password": "Spring2026!"
}

--full-scanseals it

"Smtp": {
  "Password": "DO_NOT_COMMIT_PASSWORD"
}

Synthetic value. Only the characters between the quotes change.

Which mode to use:

  • --dry-run: always first, or any time you want to see what would be found. It does not change scanned files, Git protection, or the manifest. The report is still written, and a setup script is written when findings exist and dev-secrets generation is enabled. Both go under the profile by default; an explicit --report path inside the repository writes them there.
  • --full-scan: after reviewing a dry run. Obfuscates files and turns on full git protection. Asks for confirmation the first time.
  • --no-git-protection: you want files obfuscated but cannot apply hooks or skip-worktree, for example on a CI runner. Files are still rewritten.

When none of --exclude, --angular-root, --no-angular, --user-secrets-id, or --no-dev-secrets is given, a scan reuses the saved values from the last full scan and prints them. --include-ignored is not saved; pass it on each scan that should include Git-ignored files. This keeps re-scans from pull, branch-switch and the post-merge hook consistent with the saved options.

Options

FlagDescription
--repo <path>Repository to scan. Default: current folder
--dry-runDetect and report only: does not change scanned files, Git protection, or the manifest. An explicit --report path inside the repo writes the report and, when generated, setup script there
--full-scanObfuscate findings and install git protections
--no-git-protectionSkip hooks and skip-worktree; obfuscation still rewrites files. Formerly --safe-mode
--yes, -ySkip the first-scan confirmation
--no-openDo not open the HTML report in a browser
--report <file>Write the report to an explicit path
--exclude <glob>Exclude paths by glob (repeatable)
--embed-manifestWrite the manifest inside the repo instead of your profile
--user-secrets-id <id>UserSecretsId for the generated script (default: from *.csproj, else the repo folder name)
--no-dev-secretsSkip the dev-secrets script and the report’s Dev Setup tab
--angular-root <path>Treat this folder as an Angular workspace (repeatable)
--no-angularTurn Angular handling off
--include-ignoredInclude git-ignored files. Not saved between scans; pass it each time
--no-saved-optionsIgnore --exclude, --angular-root, --no-angular, --user-secrets-id, and --no-dev-secrets remembered from the last full scan
--install-hookInstall the hooks and exit, no scan. See install-hook

Check the result

The run ends with counts by severity, the report path, and next steps. Exit code 0 means clean, 2 means findings, 1 an error. After a full scan, run status to check protection problems, then run the dev-secrets script so the app works locally. A clean protection status does not mean every finding is remediated.