Config - Security Kontext Flashcards
1
Q
At what levels can security be configured in Kubernetes in regards to containers?
A
- container level
- pod level
2
Q
How far do pod-level configurations reach?
A
- to all containers running in the pod
3
Q
What happens if security configurations are set at container and pod level?
A
- container level overwrites the pod level
4
Q
How do you configure security context on a pod-level ?
A
pod Yaml
apiVersion kind metadata spec: securityContext: runAsUser: 1000 containers: - name: ubuntu image: ubuntu command: ["sleep", "3600"]
5
Q
How do you configure security context on a container-level ?
A
pod Yaml
apiVersion kind metadata spec: containers: - name: ubuntu image: ubuntu command: ["sleep", "3600"] securityContext: runAsUser: 1000 capabilities: add: ["MAC_ADMIN"]
- Capabilities are only supported on the containter-level NOT pod-level
6
Q
With what command can you find out what user a pod is running as?
A
kubectl exec ubuntu-sleeper – whoami
7
Q
What does the ‘kubectl exec’ command start?
A
- enables to run a command in a specified container
8
Q
A