Treat every confirmed exposed secret as a security incident according to your organization's process. Prioritize containment before code cleanup.
Remediation workflow
- Validate the finding without copying or exposing the full secret.
- Identify the secret owner and affected systems.
- Revoke or rotate the exposed credential in the issuing service.
- Store the replacement value in an approved secrets-management system and update the application configuration.
- Remove the secret from the current source and, when required, from repository history and build artifacts.
- Run Secret Scanning again and verify that the finding no longer appears as open.
- Record the remediation according to your incident and audit process.
Important limitation
Removing a secret from the latest source revision does not make the credential safe. A credential can remain usable in repository history, forks, caches, container layers, logs, or previously distributed artifacts. Revoke or rotate the credential even when you remove the value from source.