Interview Prep/Kubernetes/Security, RBAC and policy

What is a securityContext and what do you set by default?

BeginnerScenarioSecurity, RBAC and policy
Answer

Situation read → A security review lists the defaults to enforce.

What I'd do →

  1. runAsNonRoot: true and a numeric runAsUser
  2. allowPrivilegeEscalation: false
  3. capabilities.drop: ["ALL"]
  4. readOnlyRootFilesystem: true
  5. seccompProfile.type: RuntimeDefault

Why → These settings satisfy the restricted PSA profile.

Interview tip → Recite the five settings fast.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Security, RBAC and policy