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 →
runAsNonRoot: trueand a numericrunAsUserallowPrivilegeEscalation: falsecapabilities.drop: ["ALL"]readOnlyRootFilesystem: trueseccompProfile.type: RuntimeDefault
Why → These settings satisfy the restricted PSA profile.
Interview tip → Recite the five settings fast.
More on Security, RBAC and policy
A developer needs read-only access to one namespace. How do you grant it?BeginnerExplain the difference between Role, ClusterRole, RoleBinding and ClusterRoleBinding.IntermediateA CI pipeline needs to deploy to one namespace. What identity do you give it?IntermediateWhat does a ServiceAccount do and why should you disable the token automount?BeginnerHow do you let pods on EKS access S3 without static keys?IntermediateA pod has access to the node's IAM role through IMDS. How do you prevent credential theft?Advanced