Config - Security Kontext Flashcards

1
Q

At what levels can security be configured in Kubernetes in regards to containers?

A
  • container level
  • pod level
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How far do pod-level configurations reach?

A
  • to all containers running in the pod
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What happens if security configurations are set at container and pod level?

A
  • container level overwrites the pod level
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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”]
~~~

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

With what command can you find out what

A

kubectl exec ubuntu-sleeper – whoami

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the ‘kubectl exec’ command start?

A
  • enables to run a command in a specified container
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly