Missions / DevSecOps

Review the Dockerfile

IntermediateDevSecOps150 points~12 min

A ChaiCorp developer opened a pull request with a new Dockerfile for the orders API. You are the reviewer. You also listed the project folder and its .dockerignore, because COPY . . copies whatever the folder contains into the image.

Find the problems. Each answer is a fact you can read from the files below.

dockerfile Dockerfile
FROM node:latest

LABEL maintainer="dev@chaicorp.example"

ENV NODE_ENV=production
ENV DB_HOST=db.internal.chaicorp.example
ENV DB_USER=orders_app
ENV DB_PASSWORD=Chai@Orders2026!

WORKDIR /app

RUN apt-get update && apt-get install -y curl git vim netcat-traditional
RUN curl -fsSL https://get.tools-installer.example/install.sh | sh

COPY . .
RUN npm install

EXPOSE 3000 22
USER root
CMD ["node", "server.js"]
shell Project folder and .dockerignore
$ ls -a
.  ..  .dockerignore  .env  .git  Dockerfile  node_modules  package.json  package-lock.json  server.js  src

$ cat .dockerignore
node_modules
npm-debug.log

Need help? Review: How Attackers Think · Passwords and Hashing

0/6 solved0 / 150 pts

Q1. Which tag makes the base image unpinned, so every build can pull a different version?

worth 25 pts

Q2. Which environment variable holds a hardcoded secret?

worth 25 pts

Q3. Which user will the application run as inside the container?

worth 25 pts

Q4. A script is downloaded and run straight into sh without any check. Which domain does it come from?

worth 25 pts

Q5. Which file that usually holds secrets will be copied into the image because .dockerignore does not exclude it?

worth 25 pts

Q6. What is the safest way to give the container its database password?

worth 25 pts