Gitleaks flags an AWS access key in a pull request. The developer says it is a test key. What do you do?
BeginnerScenarioPipeline Security Scanning
Answer
Situation read → I never trust "it is a test key" until I verify it. Anything shaped like AKIA... is live until proven otherwise.
What I'd do →
- Block the merge and keep the PR open.
- Check whether the key is valid:
aws sts get-caller-identitywith that key from a trusted workstation, or ask the cloud team to look it up in IAM. - If live, deactivate it right away:
aws iam update-access-key --access-key-id AKIA... --status Inactive --user-name <user>. - Remove the key from the branch history, not just the last commit, then rotate and move the value to a secret store.
- Add a fake-looking placeholder or an allowlist entry in
.gitleaks.tomlonly if it is truly a dummy.
Why → A key pushed to a remote can be scraped within minutes, even on private repos that later get exposed.
Interview tip → Mention that rotation matters more than deleting the commit.
More on Pipeline Security Scanning
You are asked to add security to an existing CI pipeline. Where do SAST, SCA, secrets scanning and DAST each go?BeginnerDevelopers fear security scans will slow the pipeline from 6 to 20 minutes. How do you roll them out?BeginnerA SAST tool reports 2,000 findings on a legacy repo the first time you run it. How do you introduce it without freezing delivery?IntermediateA developer insists a scanner finding is a false positive. What is your process?BeginnerSCA flags a critical CVE in a transitive dependency and no patched version exists. What are your options?IntermediateDevelopers bypass your pre-commit secret scan with `git commit --no-verify`. How do you close the gap?Intermediate