GSEC Container Security Practice Question
A GSEC analyst is reviewing the deployment pipeline for a containerized Node.js service. The Dockerfile contains a layer that runs `curl -fsSL https://example.com/install.sh | sh` during the build, before the image is pushed to an internal registry. The registry enforces vulnerability scanning, and the image is deployed to a Kubernetes cluster with a restrictive NetworkPolicy. Which of the following is the primary supply chain risk introduced by this Dockerfile instruction?
⚠ Common exam trap
The trap here is assuming that registry vulnerability scanning will catch any malicious code introduced during the build, when scanning primarily targets known CVEs in packages, not arbitrary injected scripts.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The remote script is fetched without integrity verification, so the image may include tampered or malicious content that scanning cannot reliably detect.
Fetching and executing a remote script during a Docker build introduces unverified third-party code into the image. Because there is no checksum or signature validation, a compromised endpoint can inject malicious content that becomes part of a trusted image. Registry scanning may not catch bespoke or obfuscated payloads, so the integrity of the supply chain is the primary concern.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The remote script is fetched without integrity verification, so the image may include tampered or malicious content that scanning cannot reliably detect.
Why this is correct
Piping a remote script directly into a shell executes whatever the endpoint returns at build time, with no hash or signature check. If the endpoint or DNS is compromised, malicious code becomes part of a legitimate image layer, and later vulnerability scanning may not flag novel or obfuscated payloads, making this the primary supply chain risk.
- ✗
The instruction allows the build host's environment variables, including registry credentials, to be exfiltrated by the remote script.
Why it's wrong here
Build-time ARG and ENV values can be exposed to RUN commands, but the scenario does not establish that sensitive variables are present in the build context. The remote script could read them if they were injected, yet that is a conditional risk, not the primary supply chain risk introduced by piping an unverified remote script into a shell.
- ✗
The curl command creates a writable layer that persists at runtime and can be modified by an attacker after deployment.
Why it's wrong here
The RUN instruction only affects the image during build; its filesystem changes are committed to the image layer, not made writable at runtime. A container's writable layer is created from the image at start, so this instruction does not create a persistent writable path that an attacker can modify post-deployment.
- ✗
The instruction bypasses Kubernetes NetworkPolicy because build-time traffic does not originate from a pod in the cluster.
Why it's wrong here
NetworkPolicy governs pod network traffic inside the cluster, not image build traffic on a build host. The build occurs before deployment, so NetworkPolicy is irrelevant here. The real issue is the unverified remote code being incorporated into the image, which is a supply chain integrity problem rather than a network policy bypass.
About these practice questions
This GSEC question is part of Courseiva's 351-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official GIAC exam blueprint
This GSEC practice question is part of Courseiva's free GIAC certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the GSEC exam.