Question 6

Using the runtime detection tool Falco, Analyse the container behavior for at least 20 seconds, using filters that detect newly spawning and executing processes in a single container of Nginx.
store the incident file art /opt/falco-incident.txt, containing the detected incidents. one per line, in the format
[timestamp],[uid],[processName]
  • Question 7

    SIMULATION
    use the Trivy to scan the following images,
    1. amazonlinux:1
    2. k8s.gcr.io/kube-controller-manager:v1.18.6
    Look for images with HIGH or CRITICAL severity vulnerabilities and store the output of the same in /opt/trivy-vulnerable.txt
  • Question 8

    Enable audit logs in the cluster, To Do so, enable the log backend, and ensure that
    1. logs are stored at /var/log/kubernetes/kubernetes-logs.txt.
    2. Log files are retained for 5 days.
    3. at maximum, a number of 10 old audit logs files are retained.
    Edit and extend the basic policy to log:
  • Question 9

    SIMULATION
    Given an existing Pod named nginx-pod running in the namespace test-system, fetch the service-account-name used and put the content in /candidate/KSC00124.txt Create a new Role named dev-test-role in the namespace test-system, which can perform update operations, on resources of type namespaces.
    Create a new RoleBinding named dev-test-role-binding, which binds the newly created Role to the Pod's ServiceAccount ( found in the Nginx pod running in namespace test-system).
  • Question 10

    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 named adam in the safe namespace.
    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 names newsecret in the safe namespace, with the following content:
    Username: dbadmin
    Password: moresecurepas
    Finally, create a new Pod that has access to the secret newsecret via a volume:
    Namespace: safe
    Pod name: mysecret-pod
    Container name: db-container
    Image: redis
    Volume name: secret-vol
    Mount path: /etc/mysecret