Secrets were exposed in public workflow logs for 3 hours. What do you do?
AdvancedScenarioSecrets, OIDC & Environments
Answer
Situation read → Incident response, assume compromise.
What I'd do →
- Rotate every exposed credential immediately; revoke tokens at the provider.
- Delete the affected run logs (
gh run deleteor API) to stop further exposure. - Search provider audit logs (CloudTrail, npm) for use during the window.
- Find the cause:
set -x, transformed secret, third-party action, and fix it. - Postmortem, add log scanning, and move to OIDC where possible.
Why → Deleting logs does not undo exposure; rotation is the only real fix.
Interview tip → Rotate first, investigate second.
More on Secrets, OIDC & Environments
You find AWS access keys stored as repo secrets in 25 repos. Plan the migration.IntermediateA developer asks to print a secret in the log "just once" to debug. What do you do instead?BeginnerStaging and prod need different database URLs and different AWS roles, using one workflow. How?BeginnerSecurity requires two people for prod deploys: the author cannot approve. Configure it.BeginnerWrite the AWS trust policy for a role used only by the prod deploy job of one repo.IntermediatePR workflows need read-only AWS access for `terraform plan`, including from same-repo branches. How do you set trust?Advanced