Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Linux Foundation CKS Exam - Topic 1 Question 18 Discussion

Posted by Zona on May 06, 2022 at 03:11 AM

On the Cluster worker node, enforce the prepared AppArmor profile

#include

profile docker-nginx flags=(attach_disconnected,mediate_deleted) {

#include

network inet tcp,

network inet udp,

network inet icmp,

deny network raw,

deny network packet,

file,

umount,

deny /bin/** wl,

deny /boot/** wl,

deny /dev/** wl,

deny /etc/** wl,

deny /home/** wl,

deny /lib/** wl,

deny /lib64/** wl,

deny /media/** wl,

deny /mnt/** wl,

deny /opt/** wl,

deny /proc/** wl,

deny /root/** wl,

deny /sbin/** wl,

deny /srv/** wl,

deny /tmp/** wl,

deny /sys/** wl,

deny /usr/** wl,

audit /** w,

/var/run/nginx.pid w,

/usr/sbin/nginx ix,

deny /bin/dash mrwklx,

deny /bin/sh mrwklx,

deny /usr/bin/top mrwklx,

capability chown,

capability dac_override,

capability setuid,

capability setgid,

capability net_bind_service,

deny @{PROC}/* w, # deny write for all files directly in /proc (not in a subdir)

# deny write to files not in /proc//** or /proc/sys/**

deny @{PROC}/{[^1-9],[^1-9][^0-9],[^1-9s][^0-9y][^0-9s],[^1-9][^0-9][^0-9][^0-9]*}/** w,

deny @{PROC}/sys/[^k]** w, # deny /proc/sys except /proc/sys/k* (effectively /proc/sys/kernel)

deny @{PROC}/sys/kernel/{?,??,[^s][^h][^m]**} w, # deny everything except shm* in /proc/sys/kernel/

deny @{PROC}/sysrq-trigger rwklx,

deny @{PROC}/mem rwklx,

deny @{PROC}/kmem rwklx,

deny @{PROC}/kcore rwklx,

deny mount,

deny /sys/[^f]*/** wklx,

deny /sys/f[^s]*/** wklx,

deny /sys/fs/[^c]*/** wklx,

deny /sys/fs/c[^g]*/** wklx,

deny /sys/fs/cg[^r]*/** wklx,

deny /sys/firmware/** rwklx,

deny /sys/kernel/security/** rwklx,

}

Edit the prepared manifest file to include the AppArmor profile.

apiVersion: v1

kind: Pod

metadata:

name: apparmor-pod

spec:

containers:

- name: apparmor-pod

image: nginx

Finally, apply the manifests files and create the Pod specified on it.

Verify: Try to use commandping, top, sh

Suggested Answer: A

Get Premium CKS Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
12 comments · newest first
OD
Odette 1 year ago
Just what I needed for my cluster setup!
AH
Ahmed 1 year ago
This is a bit overkill, don’t you think?
KA
Kara 1 year ago
Wait, denying /proc access? That seems risky.
JO
Joaquin 1 year ago
Totally agree, security first!
GE
Georgeanna 1 year ago
Looks like a solid AppArmor profile for nginx!
LA
Lauran 1 year ago
I think I remember that we need to verify the commands after applying the manifests, but I'm not confident about the expected outcomes for each command.
FE
Felicidad 1 year ago
This question seems similar to one we did on enforcing security profiles in containers. I think I need to focus on the deny rules.
GR
Graciela 1 year ago
I remember we practiced editing AppArmor profiles, but I'm not entirely sure about the specific flags to use in this context.
DA
Daron 1 year ago
I feel a bit lost on how to apply the manifest file correctly. I hope I can recall the syntax for including the AppArmor profile.
RO
Ronald 1 year ago
The personas that will use the phone are definitely important to consider. We need to understand their needs and pain points to ensure the phone is designed and tested with the right user experience in mind.
NI
Nikita 1 year ago
This looks like a straightforward storage solution question for a SAP HANA deployment. I think I can handle this one.
LE
Lemuel 1 year ago
I'm not totally sure, but I have a feeling Link Availability might be involved too. It covers a lot of network details.
0/2000 characters

Save Cancel