Question 6

SIMULATION
On the Cluster worker node, enforce the prepared AppArmor profile
#include <tunables/global>
profile nginx-deny flags=(attach_disconnected) {
#include <abstractions/base>
file,
# Deny all file writes.
deny /** w,
}
EOF'
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 make a file inside the directory which is restricted.
  • Question 7

    Create a RuntimeClass named gvisor-rc using the prepared runtime handler named runsc.
    Create a Pods of image Nginx in the Namespace server to run on the gVisor runtime class

    Question 8

    You can switch the cluster/configuration context using the following command:
    [desk@cli] $ kubectl config use-context dev
    A default-deny NetworkPolicy avoid to accidentally expose a Pod in a namespace that doesn't have any other NetworkPolicy defined.
    Task: Create a new default-deny NetworkPolicy named deny-network in the namespace test for all traffic of type Ingress + Egress The new NetworkPolicy must deny all Ingress + Egress traffic in the namespace test.
    Apply the newly created default-deny NetworkPolicy to all Pods running in namespace test.
    You can find a skeleton manifests file at /home/cert_masters/network-policy.yaml

    Question 9

    SIMULATION
    Service is running on port 389 inside the system, find the process-id of the process, and stores the names of all the open-files inside the /candidate/KH77539/files.txt, and also delete the binary.
  • Question 10

    SIMULATION
    Create a RuntimeClass named untrusted using the prepared runtime handler named runsc.
    Create a Pods of image alpine:3.13.2 in the Namespace default to run on the gVisor runtime class.
    Verify: Exec the pods and run the dmesg, you will see output like this:-