← Quiz: DevSecOps Basics: all 10 questions
Quiz: DevSecOps Basics · Question 7 of 10
Why add USER node (or another non-root user) to a Dockerfile?
Why add USER node (or another non-root user) to a Dockerfile?
- A.So that if the app is compromised, the attacker does not get root inside the container
- B.So the image becomes smaller
- C.Because npm refuses to run as root
- D.So the container starts faster
Answer & explanation
Correct answer: So that if the app is compromised, the attacker does not get root inside the container
Running as root gives an attacker much more power if they break in.
Can you get the rest right without peeking?
Take the timed Quiz: DevSecOps Basics quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →