0
0
Kubernetesdevops~10 mins

Pod security standards in Kubernetes - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the Pod Security Standard level in the namespace annotation.

Kubernetes
apiVersion: v1
kind: Namespace
metadata:
  name: secure-namespace
  annotations:
    pod-security.kubernetes.io/enforce: [1]
Drag options to blanks, or click blank then click option'
Arestricted
Bprivileged
Cbaseline
Dnone
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'privileged' which allows more permissions than desired.
2fill in blank
medium

Complete the code to set the audit level for Pod Security Standards in the namespace annotation.

Kubernetes
apiVersion: v1
kind: Namespace
metadata:
  name: audit-namespace
  annotations:
    pod-security.kubernetes.io/audit: [1]
Drag options to blanks, or click blank then click option'
Arestricted
Bnone
Cprivileged
Dbaseline
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'privileged' which is too permissive for audit.
3fill in blank
hard

Fix the error in the Pod Security Standard annotation key to enforce the baseline policy.

Kubernetes
apiVersion: v1
kind: Namespace
metadata:
  name: baseline-namespace
  annotations:
    pod-security.kubernetes.io/enforce: [1]
Drag options to blanks, or click blank then click option'
Aprivileged
Brestricted
Cbaseline
Dnone
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect annotation keys like 'enforce-baseline'.
4fill in blank
hard

Fill both blanks to set the enforce and warn levels for Pod Security Standards in a namespace.

Kubernetes
apiVersion: v1
kind: Namespace
metadata:
  name: mixed-namespace
  annotations:
    pod-security.kubernetes.io/enforce: [1]
    pod-security.kubernetes.io/warn: [2]
Drag options to blanks, or click blank then click option'
Arestricted
Bbaseline
Cprivileged
Dnone
Attempts:
3 left
💡 Hint
Common Mistakes
Setting both enforce and warn to the same level.
5fill in blank
hard

Fill all three blanks to create a Pod Security Standard policy with enforce, warn, and audit levels.

Kubernetes
apiVersion: v1
kind: Namespace
metadata:
  name: full-policy-namespace
  annotations:
    pod-security.kubernetes.io/enforce: [1]
    pod-security.kubernetes.io/warn: [2]
    pod-security.kubernetes.io/audit: [3]
Drag options to blanks, or click blank then click option'
Arestricted
Bbaseline
Cprivileged
Dnone
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of enforce, warn, and audit levels.