A developer accidentally committed plain-text database passwords into a public Git repository. The password was stored in a Kubernetes Secret manifest. What immediate remediation step should be taken regarding the Secret?
Once a credential is exposed in a public repository it must be treated as compromised, so rotating the password in the underlying database invalidates the leaked value. Updating the Kubernetes Secret afterwards keeps the cluster functional while ensuring the exposed credential can no longer authenticate.
Why this answer
Once a credential is exposed in a public repository, it must be treated as compromised — the only safe remediation is to rotate the password in the database and update the Kubernetes Secret with the new value. Deleting or re-encoding the Secret does nothing because the old password remains valid in the database and is already in Git history.
Exam trap
The trap is treating Secret deletion or re-encoding as remediation — candidates miss that the credential itself must be rotated at the source, since the leaked value remains valid regardless of what happens to the Kubernetes object.
How to eliminate wrong answers
Option A is wrong because a DenyAll NetworkPolicy only blocks network traffic to pods — it does not invalidate the leaked credential or prevent an attacker who already has it from using it directly against the database. Option B is wrong because deleting the Secret and restarting nodes does not change the database password; the credential is still valid and the Git history still contains it. Option D is wrong because changing base64 to hex is cosmetic — both are trivially reversible encodings, not encryption, and the plaintext password is still recoverable.