An API key was committed to a shared repository months ago and removed in a later commit; many contractors have cloned it since. Which two actions best address the exposure and prevent a repeat? (Choose two.)
Choose 2 answers
Show the answer
Correct answersC. Revoke the exposed key and issue a new oneD. Block commits containing secrets with pre-receive hooks
AWhy not this: Visibility changes do not retrieve copies already cloned by contractors.
BWhy not this: Dynamic scans test running behavior and do not find or remove credentials in repository history.
CWhy this is right: A key that was ever exposed must be treated as compromised; revocation removes its value to anyone who copied it.
DWhy this is right: Pre-receive hooks reject pushes containing secrets, preventing a recurrence at the repository.
EWhy not this: The key stays in commit history and in existing clones, so deleting it from the file fixes nothing.
FWhy not this: Composition analysis checks third-party components for known flaws, not committed credentials.
The key must be treated as compromised, so revoking and replacing it ends its usefulness, and server-side secret scanning blocks future leaks. Deleting it from the current file leaves it in history and in existing clones.