DocsWorkflows
Remediating findings
Sealing a value is the start. Remediation moves each secret to a proper store, commits a safe reference in its place, and records it in the manifest.
The loop
- Pick a finding ID from
remediate --list. - Move the secret to a secrets manager or runtime configuration.
- In the file, replace the
DO_NOT_COMMIT_*placeholder with a safe value or one of the recognized destination markers below. - Commit it:
stage --file <path>, reviewgit diff --cached,git commit. The pre-commit hook passes once no placeholder is staged. - Mark it remediated with
--mark <id> --target <target>. - Re-scan and confirm there are no reappeared-secret alerts.
SecretSleuth remediate --list
SecretSleuth stage --file src\Billing.Api\appsettings.json
git diff --cached
git commit -m "Move SendGrid key to Key Vault"
SecretSleuth remediate --mark <id> --target keyvault
Sealedcannot be committed
"SendGrid": {
"ApiKey": "DO_NOT_COMMIT_APIKEY"
}
Remediatedsafe to commit
"SendGrid": {
"ApiKey": ""
}
The real value now comes from User Secrets locally and a Key Vault-backed variable group in the pipeline.
Destination markers and targets
Move or rotate the real secret and configure the application to load it from the new destination. A recognized marker may replace the entire configuration value:
| Report destination | --target value | Replacement value |
|---|---|---|
| Azure Key Vault | keyvault | in_key_vault |
| .NET User Secrets | usersecrets | in_user_secrets |
| Environment variable | envvar | in_env_var |
| Git-ignored file | gitignore | in_git_ignored_file |
| Other secrets manager | secretmanager | in_secret_manager |
{
"Password": "in_user_secrets"
}
Scans ignore only these exact whole values, case-insensitively, after trimming surrounding whitespace. For example, in_user_secrets_suffix and Server=db;******; are not exempt. There is no blanket in_* exclusion. Markers do not retrieve secrets, configure runtime loading, or prove remediation is complete. --mark records the destination; it does not move secrets or edit source files. A false positive is a separate reviewed classification and has no replacement marker. Git-ignoring a file does not remove previously committed secrets from history.
In the report’s Remediation tab, Mark Done opens the outcome selector and a PowerShell command. Run that command to save status to the manifest. Only after it succeeds, use I ran this command to update the open report’s display. Existing HTML reports are snapshots; generate a new one to see saved status.
False positives
If a finding is wrong, mark it instead:
SecretSleuth remediate --false-positive <id>
For a dry-run finding, copy its ID or command from the report’s Findings tab. The command confirms the finding still exists and saves it as FalsePositive in the manifest without changing the scanned file. Later scans exclude that ID from findings, obfuscation and reports. A finding whose file path, key or line number changes gets a different ID and must be reviewed again.
Export to your board
SecretSleuth remediate --export-workitems
Writes the pending findings as CSV for import into Azure Boards, Jira, or a spreadsheet.
Rotation
Remediating the file does not un-leak the value. Anything ever committed is in history and should be rotated at the provider, without downtime:
- Inventory. Export the findings.
- Classify. Dev or local secret, versus pipeline or production secret. Developers rotate the first; DevOps and cloud admins rotate the second.
- Rotate. Create a new key at the provider.
- Update. The variable group, Key Vault, or dev user secrets.
- Revoke. Delete the old leaked key at the provider.
Reporting progress
exec-summary turns the manifest into a print-ready report for leadership, with no rescan.