A software engineer commits an API key into an early Dockerfile build step and then adds a later command to delete that key file before finishing the build, yet Falcon Cloud Security pre-runtime image assessment still flags an embedded secret. The secret was committed into an earlier filesystem layer of the final published image, and a separate later layer deletes it. Why does this finding persist?
Select an answer to reveal the explanation.
Short Explanation
Deleting a file in a later container layer is like painting over a sticky note on a glass window—anyone looking at the earlier layer can still read it. You must rebuild a clean final image using multi-stage builds or build-time secret injection without copying the secret from intermediate stages, and revoke and rotate the exposed key. The trap is assuming a file deletion command erases previous immutable image layers.
Full Explanation
Container image layers are immutable, so deleting a file in a later layer only hides it rather than removing it is correct because images are stacked read-only layers. A removal in a newer layer only marks the file deleted while the earlier layer still holds the secret, where pre-runtime image assessment can still inspect it. The Kubernetes admission policy caches old findings for seven days after a build is incorrect because admission evaluates current assessment results, not a week-long cache. The Falcon sensor on worker nodes does not synchronize with registry deletions is incorrect because pre-runtime assessment inspects registry artifacts independently of node sensors. The cloud posture policy automatically treats all API keys as runtime indicators is incorrect because embedded secrets are pre-runtime image findings, not posture or runtime alerts. As a caveat, even after rebuilding cleanly, any credential committed into a shared layer must be revoked and rotated. As an operational check, inspect layer details in the finding, rebuild with multi-stage builds or secret mounts without copying the secret into the final image, and re-scan.
Prefer to study offline? Printable PDF study book + test engine ($7.50, unofficial). These questions stay free here.