During an incident response, you identify that a threat actor has gained unauthorized access to an application's environment variables. What is the immediate correct step to take regarding credential management?
Exposed environment variables mean the database credential is compromised, so it must be rotated immediately by changing the password and updating the deployment manifest to distribute the new value. This invalidates the leaked credential before the attacker can reuse it.
Why this answer
When environment variables containing credentials are compromised, the immediate step is to rotate the exposed credentials—specifically, change the database user's password and update the application deployment manifest to use the new password. This invalidates the attacker's access and restores secure authentication. The other options do not address the credential compromise directly.
Exam trap
The trap is focusing on investigative steps (logging, cache clearing) instead of the immediate containment action of credential rotation, which is the priority in incident response.
How to eliminate wrong answers
Option A is wrong because clearing the cache does not revoke the attacker's access to the compromised credentials; they may still use them. Option B is wrong because increasing logging to DEBUG may help investigation but does not mitigate the immediate risk of credential misuse. Option D is wrong because re-deploying with the same configuration would reuse the compromised credentials, leaving the vulnerability in place.