Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Linux Foundation Exam CKS Topic 1 Question 38 Discussion

Actual exam question for Linux Foundation's CKS exam
Question #: 38
Topic #: 1
[All CKS Questions]

Analyze and edit the given Dockerfile

FROM ubuntu:latest

RUN apt-get update -y

RUN apt-install nginx -y

COPY entrypoint.sh /

ENTRYPOINT ["/entrypoint.sh"]

USER ROOT

Fixing two instructions present in the file being prominent security best practice issues

Analyze and edit the deployment manifest file

apiVersion: v1

kind: Pod

metadata:

name: security-context-demo-2

spec:

securityContext:

runAsUser: 1000

containers:

- name: sec-ctx-demo-2

image: gcr.io/google-samples/node-hello:1.0

securityContext:

runAsUser: 0

privileged: True

allowPrivilegeEscalation: false

Fixing two fields present in the file being prominent security best practice issues

Don't add or remove configuration settings; only modify the existing configuration settings

Whenever you need an unprivileged user for any of the tasks, use user test-user with the user id 5487

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

Bette
1 months ago
Well, well, well, looks like someone's got a penchant for playing with fire! 'apt-install' and 'USER ROOT'? Might as well just hand the keys to the kingdom over to the container and call it a day. And the deployment file? Privilege escalation and root access? Might as well just throw the whole server out the window and start over!
upvoted 0 times
Eladia
5 days ago
User 4: Definitely, those need to be fixed asap before any serious security breaches occur.
upvoted 0 times
...
Tuyet
9 days ago
User 3: And in the deployment manifest file, privilege escalation and root access? That's a disaster waiting to happen.
upvoted 0 times
...
Telma
15 days ago
User 2: I know, those are big no-nos. It's like giving full control to the container.
upvoted 0 times
...
Frederic
18 days ago
User 1: Yikes, 'apt-install' and 'USER ROOT' in the Dockerfile? That's a major security risk.
upvoted 0 times
...
...
Kindra
1 months ago
The Dockerfile needs to be fixed by correcting the 'apt-install' instruction and removing the 'USER ROOT' line. In the deployment manifest, the 'runAsUser: 0' and 'privileged: True' fields should be changed to use a non-root user for better security.
upvoted 0 times
Hildegarde
17 days ago
Let's change 'apt-install' to 'apt-get install' in the Dockerfile.
upvoted 0 times
...
...
Allene
2 months ago
Haha, the Dockerfile is a real mess! 'apt-install'? Really? And running as root? Might as well just give the container the keys to the kingdom! As for the deployment file, oh boy, privilege escalation and root access? Might as well just hand over the entire server to the container!
upvoted 0 times
Chauncey
12 days ago
User 3: I agree, running as an unprivileged user with a specific user id is a much better approach.
upvoted 0 times
...
Mohammad
16 days ago
User 2: Absolutely, security best practices are essential. And that deployment manifest file is a disaster too.
upvoted 0 times
...
Helaine
19 days ago
User 1: Yeah, that Dockerfile needs some serious fixing. Running as root is a big no-no.
upvoted 0 times
...
...
Dianne
2 months ago
The deployment manifest file has some security issues. The 'runAsUser: 0' and 'privileged: True' fields give the container root privileges, which is not recommended for security reasons.
upvoted 0 times
...
Nathalie
2 months ago
I modified the Dockerfile to use debian:latest and added htop installation for better security.
upvoted 0 times
...
Felicidad
2 months ago
The first Dockerfile instruction has a typo in 'apt-install' instead of 'apt-get install'. Also, the 'USER ROOT' instruction is a security risk, it's better to run the container as a non-root user.
upvoted 0 times
Candra
1 months ago
User 2
upvoted 0 times
...
Roxane
1 months ago
User 1
upvoted 0 times
...
...
Lisha
2 months ago
I agree, it required careful analysis and editing to fix the security issues.
upvoted 0 times
...
Nathalie
2 months ago
I found the Dockerfile and deployment manifest file question tricky.
upvoted 0 times
...
Carmela
2 months ago
I believe modifying the deployment manifest file is also crucial for security. We need to fix those fields.
upvoted 0 times
...
Edda
2 months ago
I agree, we should analyze and edit the Dockerfile to ensure best security practices.
upvoted 0 times
...
Augustine
3 months ago
I think the Dockerfile needs to be edited to fix security issues.
upvoted 0 times
...

Save Cancel