A software security engineer reviews pre-runtime image assessment results for a release candidate and sees a finding for a private SSH key committed into an image layer alongside zero OS package CVEs. Why can this finding not be resolved by running a standard package manager upgrade?
Select an answer to reveal the explanation.
Short Explanation
Updating software packages when a hardcoded key sits in an image layer is like changing the locks on a house while leaving a spare key taped to the mailbox. You have to remove the secret itself and rebuild rather than relying on package upgrades.
Full Explanation
Pre-runtime image assessment scans for both vulnerable packages and exposed credentials, and a package upgrade cannot clear the key because An embedded secret is a static file artifact in an image layer rather than a versioned package. Removing the secret requires deleting it from the build context or Dockerfile steps, rebuilding the image cleanly so the secret does not persist in an earlier layer, and rotating the exposed credential. Meanwhile, Package managers only update container images after the pod is scheduled onto a worker node is incorrect because package upgrades routinely run during image build time before deployment, yet still would not touch an arbitrary key file. Likewise, Pre-runtime image assessment ignores all package manager metadata when an SSH key is detected is false because scanners evaluate packages and secrets independently. Finally, Container registries automatically encrypt all private keys once the image is pushed to storage confuses storage-level encryption at rest with removing plaintext secrets embedded inside downloadable image layers. Caveat: simply adding a delete command in a later Dockerfile layer leaves the secret recoverable in the prior layer's history. Operational check: rebuild the image from a clean build definition without copying the key, rescan the new digest, and revoke the exposed SSH key.
Prefer to study offline? Printable PDF study book + test engine ($7.50, unofficial). These questions stay free here.