Task Analyze and edit the given Dockerfile /home/candidate/KSSC00301/Docker file (based on the ubuntu:16.04 image), fixing two instructions present in the file that are prominent security/best-practice issues. Analyze and edit the given manifest file /home/candidate/KSSC00301/deployment.yaml, fixing two fields present in the file that are prominent security/best-practice issues.


A. See explanation below.
B. PlaceHolder
Secrets stored in the etcd is not secure at rest, you can use the etcdctl command utility to find the secret value for e.g:ETCDCTL_API=3 etcdctl get /registry/secrets/default/cks-secret --cacert="ca.crt" -- cert="server.crt" --key="server.key" Output

Using the Encryption Configuration, Create the manifest, which secures the resource secrets using the provider AES-CBC and identity, to encrypt the secret-data at rest and ensure all secrets are encrypted with the new configuration.
A. See explanation below.
B. PlaceHolder


AppArmor is enabled on the cluster's worker node. An AppArmor profile is prepared, but not enforced yet.

Task
On the cluster's worker node, enforce the prepared AppArmor profile located at /etc/apparmor.d/nginx_apparmor.
Edit the prepared manifest file located at /home/candidate/KSSH00401/nginx-pod.yaml to apply the AppArmor profile.
Finally, apply the manifest file and create the Pod specified in it.
A. See the explanation below
B. PlaceHolder
CORRECT TEXT Your organization's security policy includes:

1.
ServiceAccounts must not automount API credentials
2.
ServiceAccount names must end in "-sa"
The Pod specified in the manifest file /home/candidate/KSCH00301 /pod-m
nifest.yaml fails to schedule because of an incorrectly specified ServiceAccount.
Complete the following tasks:
Task
1.
Create a new ServiceAccount named frontend-sa in the existing namespace qa. Ensure the ServiceAccount does not automount API credentials.
2.
Using the manifest file at /home/candidate/KSCH00301 /pod-manifest.yaml, create the Pod.
3.
Finally, clean up any unused ServiceAccounts in namespace qa.
A. See the explanation below
B. PlaceHolder
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:
1.
Cronjobs changes at RequestResponse
2.
Log the request body of deployments changes in the namespace kube-system.
3.
Log all other resources in core and extensions at the Request level.
4.
Don't log watch requests by the "system:kube-proxy" on endpoints or
A. See explanation below.
B. PlaceHolder
Use the kubesec docker images to scan the given YAML manifest, edit and apply the advised changes, and passed with a score of 4 points.
kubesec-test.yaml
1.
apiVersion: v1
2.
kind: Pod
3.
metadata:
4.
name: kubesec-demo
5.
spec:
6.
containers:
7.
- name: kubesec-demo
8.
image: gcr.io/google-samples/node-hello:1.0
9.
securityContext: 10.readOnlyRootFilesystem: true
Hint: docker run -i kubesec/kubesec:512c5e0 scan /dev/stdin < kubesec-test.yaml
A. See explanation below.
B. PlaceHolder
CORRECT TEXT Context

A default-deny NetworkPolicy avoids to accidentally expose a Pod in a namespace that doesn't have any other NetworkPolicy defined.
Task
Create a new default-deny NetworkPolicy named defaultdeny in the namespace testing for all traffic of type Egress.
The new NetworkPolicy must deny all Egress traffic in the namespace testing.
Apply the newly created default-deny NetworkPolicy to all Pods running in namespace testing.

A. See explanation below.
B. PlaceHolder
CORRECT TEXT
Task

Create a NetworkPolicy named pod-access to restrict access to Pod users-service running in namespace dev-team. Only allow the following Pods to connect to Pod users-service:
1.
Pods in the namespace qa
2.
Pods with label environment: testing, in any namespace

A. See explanation below.
B. PlaceHolder

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 for 12 days.
3.
at maximum, a number of 8 old audit logs files are retained.
4.
set the maximum size before getting rotated to 200MB
Edit and extend the basic policy to log:
1.
namespaces changes at RequestResponse
2.
Log the request body of secrets changes in the namespace kube-system.
3.
Log all other resources in core and extensions at the Request level.
4.
Log "pods/portforward", "services/proxy" at Metadata level.
5.
Omit the Stage RequestReceived
All other requests at the Metadata level
A. See the explanation below:
B. PlaceHolder
A container image scanner is set up on the cluster.
Given an incomplete configuration in the directory
/etc/kubernetes/confcontrol and a functional container image scanner with HTTPS endpoint https://test-server.local.8081/image_policy
1.
Enable the admission plugin.
2.
Validate the control configuration and change it to implicit deny.
Finally, test the configuration by deploying the pod having the image tag as latest.
A. See explanation below.
B. PlaceHolder