LOADING N0PERM…
Conduct a security code review of a production Dockerfile. Identify hardcoded database credentials, unpinned upstream base images, root user execution, and missing layer secret protections.
1# Production Payment Notification Service2FROM node:latest3LABEL maintainer="devops@apexcore.bank"4LABEL security.audit.flag="n0perm{dockerfile_hardened_nonroot_no_secrets}"5LABEL compliance.status="AUDIT_FAILED_EMBEDDED_SECRETS"67WORKDIR /app89# INSECURE: Baking credentials into immutable layer environment10ENV NODE_ENV=production11ENV AWS_DEFAULT_REGION=us-east-112ENV PAYMENT_API_SECRET=sec_live_9941a8b72c4e1f0d3a5b13ENV DATABASE_URL="mysql://app_user:SuperSecret2026!@db.internal:3306/payments"1415# INSECURE: Copying entire context including potential sensitive files16COPY . .1718# INSECURE: Running package install as root with untrusted cache19RUN npm install --production2021# VULNERABLE: No USER directive specified, running container as root (UID 0)22EXPOSE 808023CMD ["node", "dist/server.js"]
Note: Committed to git repository before code review approval.
Create a free N0PERM account or sign in with Google to submit challenge flags, earn capability points, and record verified accomplishments on your Skill Passport.