A healthcare startup builds a patient-scheduling application on public-cloud IaaS, handling data classified as sensitive personal health information. A developer needs a database password for the running service and currently the value sits in a plaintext variable inside the application's version-controlled configuration file. Applying secure coding and software configuration management practices, what should the team do next to remediate this before the next release?
- AMove the password into an environment variable set on the build server so it no longer appears in the source file.
- BRetrieve the password at runtime from a managed secrets vault using the service's own identity, and remove it from version control. Correct
- CEncrypt the configuration file at rest in the repository and commit the encrypted version alongside the code.
- DRestrict repository access to the two senior developers who maintain the scheduling service and leave the value in place.
Why A is wrong: Using an environment variable removes the literal string from the file and feels like progress, but the secret is still unmanaged, unrotated and readable to anyone with host access, so it does not meet the standard for protecting a sensitive credential.
Why B is correct: Fetching the secret at runtime from a managed vault keyed to the service identity keeps the credential out of source control, supports rotation and access logging, and is the recognised secure practice for handling application secrets.
Why C is wrong: Encrypting the file at rest sounds protective, but the decryption key must then live somewhere and the secret still travels through version control, so this shifts the problem rather than removing the credential from the codebase.
Why D is wrong: Tightening repository permissions reduces who can read the file, but the secret remains committed in history and unrotated, so a single leaked clone or a former maintainer still exposes it; access control alone does not remediate a stored secret.