A software security team reviews pre-runtime image assessment results for a new microservice and sees a finding for an API token hardcoded inside a container image layer. Why is it critical to remediate this before pushing to a shared registry?
Select an answer to reveal the explanation.
Short Explanation
Pushing a container image with a hardcoded key is like taping your house key to a package before shipping it to a shared warehouse. Once it hits the registry, anyone who pulls that image can inspect the layers and grab your secret.
Full Explanation
Anyone who can pull the image can extract the embedded secret from its layers explains the core risk of storing credentials inside container builds. Because container images are composed of inspectable filesystem layers, even deleting a secret in a later Dockerfile instruction leaves it recoverable in an earlier layer once pushed to a shared registry. Hardcoded tokens automatically upgrade the container's operating system packages is false because credentials do not modify package versions or software dependencies. Embedded secrets prevent Kubernetes DaemonSets from deploying node-level sensors is incorrect because DaemonSet scheduling depends on node configuration and cluster permissions rather than application secrets inside unrelated images. The cloud account registration role will lose read permissions during posture scans fails because cloud IAM onboarding roles operate at the cloud control plane and are unaffected by tokens inside a microservice image. As an exam caveat, pre-runtime image assessment flags secrets in addition to vulnerable packages—always rotate exposed tokens and inject secrets at runtime via a secret manager. For an operational check, remove the token from the build history, rotate the API key, and re-run pre-runtime image assessment to confirm the secret finding clears.
Prefer to study offline? Printable PDF study book + test engine ($7.50, unofficial). These questions stay free here.