OpenParable
Skip to content
← Back to skills

Cis Aks V170 4.6.2

DevOps & Security
cis-aks-v170-4.6.2

Cis Aks V170 4.6.2 is an Agent Skill for devops & security published in the CyberStrikeus/CyberStrike repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Apply Security Context to Your Pods and Containers (Manual)

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/CyberStrikeus/CyberStrike/blob/HEAD/.cyberstrike/skill/CIS_benchmarks/Server_Software/Kubernetes/CIS_Azure_Kubernetes_Service_AKS_Benchmark_v1.7.0/cis-aks-v170-4.6.2/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/cis-aks-v170-4-6-2, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

4.6.2 Apply Security Context to Your Pods and Containers (Manual)

Profile Applicability

  • Level 2

Description

Apply Security Context to Your Pods and Containers.

Rationale

A security context defines the operating system security settings (uid, gid, capabilities, SELinux role, etc.) applied to a container. When designing your containers and pods, make sure that you configure the security context for your pods, containers, and volumes. A security context is a property defined in the deployment yaml. It controls the security parameters that will be assigned to the pod/container/volume. There are two levels of security context: pod level security context, and container level security context.

Impact

If you incorrectly apply security contexts, you may have trouble running the pods.

Audit Procedure

Review the pod definitions in your cluster and verify that you have security contexts defined as appropriate.

kubectl get pods --all-namespaces -o json | jq '.items[] | select(.spec.securityContext == {} or .spec.securityContext == null) | .metadata.namespace + "/" + .metadata.name'

Remediation

As a best practice we recommend that you scope the binding for privileged pods to service accounts within a particular namespace, e.g. kube-system, and limiting access to that namespace. For all other serviceaccounts/namespaces, we recommend implementing a more restrictive policy that prevents pods from running as privileged or escalating privileges.

Default Value

By default, no security contexts are automatically applied to pods.

References

  1. https://kubernetes.io/docs/concepts/policy/security-context/
  2. https://learn.cisecurity.org/benchmarks
  3. https://docs.microsoft.com/security/benchmark/azure/security-controls-v2-posture-vulnerability-management#pv-3-establish-secure-configurations-for-compute-resources

CIS Controls

Controls VersionControlIG 1IG 2IG 3
v84.6 Securely Manage Enterprise Assets and Software●●●
v75 Secure Configuration for Hardware and Software on Mobile Devices, Laptops, Workstations and Servers

Profile Applicability

  • Level 2