MultipleChoice
Using the runtime detection tool Falco, Analyse the container behavior for at least 30 seconds, using filters that detect newly spawning and executing processes
OptionsMultipleChoice
Create a User named john, create the CSR Request, fetch the certificate of the user after approving it.
Create a Role name john-role to list secrets, pods in namespace john
Finally, Create a RoleBinding named john-role-binding to attach the newly created role john-role to the user john in the namespace john.
To Verify:Use the kubectl auth CLI command to verify the permissions.
OptionsMultipleChoice
Create a network policy named restrict-np to restrict to pod nginx-test running in namespace testing.
Only allow the following Pods to connect to Pod nginx-test:-
1. pods in the namespace default
2. pods with label version:v1 in any namespace.
Make sure to apply the network policy.
OptionsMultipleChoice
Given an existing Pod named test-web-pod running in the namespace test-system
Edit the existing Role bound to the Pod's Service Account named sa-backend to only allow performing get operations on endpoints.
Create a new Role named test-system-role-2 in the namespace test-system, which can perform patch operations, on resources of type statefulsets.
OptionsMultipleChoice
Context:
Cluster:prod
Master node:master1
Worker node:worker1
You can switch the cluster/configuration context using the following command:
[desk@cli] $kubectl config use-context prod
Task:
Analyse and edit the given Dockerfile (based on theubuntu:18:04image)
/home/cert_masters/Dockerfilefixing two instructions present in the file being prominent security/best-practice issues.
Analyse and edit the given manifest file
/home/cert_masters/mydeployment.yamlfixing two fields present in the file being prominent security/best-practice issues.
Note:Don't add or remove configuration settings; only modify the existing configuration settings, so that two configuration settings each are no longer security/best-practice concerns.
Should you need an unprivileged user for any of the tasks, use usernobodywith user id65535
OptionsMultipleChoice
You can switch the cluster/configuration context using the following command:
[desk@cli] $kubectl config use-context test-account
Task:Enable audit logs in the cluster.
To do so, enable the log backend, and ensure that:
1. logs are stored at/var/log/Kubernetes/logs.txt
2. log files are retained for5days
3. at maximum, a number of10old audit log files are retained
A basic policy is provided at/etc/Kubernetes/logpolicy/audit-policy.yaml. It only specifies what not to log.
Note: The base policy is located on the cluster's master node.
Edit and extend the basic policy to log:
1.Nodeschanges atRequestResponselevel
2. The request body ofpersistentvolumeschanges in the namespacefrontend
3.ConfigMapandSecretchanges in all namespaces at theMetadatalevel
Also, add a catch-all rule to log all other requests at theMetadatalevel
Note:Don't forget to apply the modified policy.
OptionsMultipleChoice
You must complete this task on the following cluster/nodes:
Cluster:apparmor
Master node:master
Worker node:worker1
You can switch the cluster/configuration context using the following command:
[desk@cli] $kubectl config use-context apparmor
Given: AppArmor is enabled on the worker1 node.
Task:
On the worker1 node,
1. Enforce the prepared AppArmor profile located at:/etc/apparmor.d/nginx
2. Edit the prepared manifest file located at/home/cert_masters/nginx.yamlto apply the apparmor profile
3. Create the Pod using this manifest
OptionsMultipleChoice
You can switch the cluster/configuration context using the following command:
[desk@cli] $kubectl config use-context qa
Context:
A pod fails to run because of an incorrectly specified ServiceAccount
Task:
Create a new service account named backend-qa in an existing namespace qa, which must not have access to any secret.
Edit the frontend pod yaml to use backend-qa service account
Note:You can find the frontend pod yaml at /home/cert_masters/frontend-pod.yaml
OptionsMultipleChoice
You must complete this task on the following cluster/nodes:
Cluster:trace
Master node:master
Worker node:worker1
You can switch the cluster/configuration context using the following command:
[desk@cli] $kubectl config use-context trace
Given: You may use Sysdig or Falco documentation.
Task:
Use detection tools to detect anomalies like processes spawning and executing something weird frequently in the single container belonging to Podtomcat.
Two tools are available to use:
1. falco
2. sysdig
Tools are pre-installed on the worker1 node only.
Analyse the container's behaviour for at least 40 seconds, using filters that detect newly spawning and executing processes.
Store an incident file at/home/cert_masters/report, in the following format:
[timestamp],[uid],[processName]
Note:Make sure to store incident file on the cluster's worker node, don't move it to master node.
OptionsMultipleChoice
Cluster: dev
Master node:master1
Worker node:worker1
You can switch the cluster/configuration context using the following command:
[desk@cli] $kubectl config use-context dev
Task:
Retrieve the content of the existing secret namedadamin thesafenamespace.
Store the username field in a file names/home/cert-masters/username.txt, and the password field in a file named/home/cert-masters/password.txt.
1. You must create both files; they don't exist yet.
2. Do not use/modify the created files in the following steps, create new temporary files if needed.
Create a new secret namesnewsecretin thesafenamespace, with the following content:
Username:dbadmin
Password:moresecurepas
Finally, create a new Pod that has access to the secretnewsecretvia a volume:
Namespace: safe
Pod name: mysecret-pod
Container name: db-container
Image: redis
Volume name: secret-vol
Mount path: /etc/mysecret
Options