Agent skill

K8s Security Policies

by Cybereason-Public in Cybereason-Public/owLSM

Comprehensive guide for implementing NetworkPolicy, PodSecurityPolicy, RBAC, and Pod Security Standards in Kubernetes.

GPL-2.0Auto-check passedBackend & APIs

Install K8s Security Policies

skills CLI
$ npx skills add Cybereason-Public/owLSM --skill k8s-security-policies -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Cybereason-Public/owLSM k8s-security-policies --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Cybereason-Public/owLSM.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.cursor/skills/k8s-security-policies .claude/skills/k8s-security-policies && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
k8s-security-policies
GitHub stars
280
Used in
12 other repos
Token cost
~2k tokens
SKILL.md length
357 words
Files
3 (incl. references, assets)
Skills in repo
9
Repo updated
First seen
Licence
GPL-2.0

At a glance

Comprehensive guide for implementing NetworkPolicy, PodSecurityPolicy, RBAC, and Pod Security Standards in Kubernetes.

  • Works in 3 steps: Privileged (Unrestricted) → Baseline (Minimally restrictive) → Restricted (Most restrictive)
  • Tasks that involve Container orchestration
  • SKILL.md covers Do not use this skill when, Instructions, Purpose and Use this skill when, plus 9 more sections
  • Calls kubectl

What it does

K8s Security Policies is an agent skill from Cybereason-Public/owLSM. Comprehensive guide for implementing NetworkPolicy, PodSecurityPolicy, RBAC, and Pod Security Standards in Kubernetes.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files and assets (for example `assets/network-policy-template.yaml` and `references/rbac-patterns.md`).

It sits in Backend & APIs, covering Container orchestration and Authorization and RBAC. It works with Kubernetes and Linux. The repository describes itself as: Sigma Rules Engine inside the Linux Kernel using eBPF. Focusing on prevention capabilities. The licence is GPL-2.0.

When your agent uses it

  • Tasks that involve Container orchestration
  • Tasks that involve Authorization and RBAC

Example prompts

  • “/k8s-security-policies”

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Privileged (Unrestricted)
  2. Baseline (Minimally restrictive)
  3. Restricted (Most restrictive)

What it can do on your machine

Read from SKILL.md and the folder at commit 8e541af. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • kubectl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use kubectl, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

K8s Security Policies loads about 2k tokens when it runs, and up to ~3k if it reads all its reference files. Until then it costs about 35 tokens; SKILL.md has 357 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~35
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Cybereason-Public/owLSM at commit 8e541af, republished under its GPL-2.0 licence (© Cybereason-Public). 357 words, ~1,984 tokens.

Download SKILL.mdSave it as .claude/skills/k8s-security-policies/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
k8s-security-policies
description
Comprehensive guide for implementing NetworkPolicy, PodSecurityPolicy, RBAC, and Pod Security Standards in Kubernetes.
risk
critical
source
community
date_added
2026-02-27

Kubernetes Security Policies

Comprehensive guide for implementing NetworkPolicy, PodSecurityPolicy, RBAC, and Pod Security Standards in Kubernetes.

Do not use this skill when

  • The task is unrelated to kubernetes security policies
  • You need a different domain or tool outside this scope

Instructions

  • Clarify goals, constraints, and required inputs.
  • Apply relevant best practices and validate outcomes.
  • Provide actionable steps and verification.
  • If detailed examples are required, open resources/implementation-playbook.md.

Purpose

Implement defense-in-depth security for Kubernetes clusters using network policies, pod security standards, and RBAC.

Use this skill when

  • Implement network segmentation
  • Configure pod security standards
  • Set up RBAC for least-privilege access
  • Create security policies for compliance
  • Implement admission control
  • Secure multi-tenant clusters

Pod Security Standards

1. Privileged (Unrestricted)
yaml
apiVersion: v1
kind: Namespace
metadata:
  name: privileged-ns
  labels:
    pod-security.kubernetes.io/enforce: privileged
    pod-security.kubernetes.io/audit: privileged
    pod-security.kubernetes.io/warn: privileged
2. Baseline (Minimally restrictive)
yaml
apiVersion: v1
kind: Namespace
metadata:
  name: baseline-ns
  labels:
    pod-security.kubernetes.io/enforce: baseline
    pod-security.kubernetes.io/audit: baseline
    pod-security.kubernetes.io/warn: baseline
3. Restricted (Most restrictive)
yaml
apiVersion: v1
kind: Namespace
metadata:
  name: restricted-ns
  labels:
    pod-security.kubernetes.io/enforce: restricted
    pod-security.kubernetes.io/audit: restricted
    pod-security.kubernetes.io/warn: restricted

Network Policies

Default Deny All
yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: default-deny-all
  namespace: production
spec:
  podSelector: {}
  policyTypes:
  - Ingress
  - Egress
Allow Frontend to Backend
yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-frontend-to-backend
  namespace: production
spec:
  podSelector:
    matchLabels:
      app: backend
  policyTypes:
  - Ingress
  ingress:
  - from:
    - podSelector:
        matchLabels:
          app: frontend
    ports:
    - protocol: TCP
      port: 8080
Allow DNS
yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-dns
  namespace: production
spec:
  podSelector: {}
  policyTypes:
  - Egress
  egress:
  - to:
    - namespaceSelector:
        matchLabels:
          name: kube-system
    ports:
    - protocol: UDP
      port: 53

Reference: See assets/network-policy-template.yaml

RBAC Configuration

Role (Namespace-scoped)
yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: pod-reader
  namespace: production
rules:
- apiGroups: [""]
  resources: ["pods"]
  verbs: ["get", "watch", "list"]
ClusterRole (Cluster-wide)
yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: secret-reader
rules:
- apiGroups: [""]
  resources: ["secrets"]
  verbs: ["get", "watch", "list"]
RoleBinding
yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: read-pods
  namespace: production
subjects:
- kind: User
  name: jane
  apiGroup: rbac.authorization.k8s.io
- kind: ServiceAccount
  name: default
  namespace: production
roleRef:
  kind: Role
  name: pod-reader
  apiGroup: rbac.authorization.k8s.io

Reference: See references/rbac-patterns.md

Pod Security Context

Restricted Pod
yaml
apiVersion: v1
kind: Pod
metadata:
  name: secure-pod
spec:
  securityContext:
    runAsNonRoot: true
    runAsUser: 1000
    fsGroup: 1000
    seccompProfile:
      type: RuntimeDefault
  containers:
  - name: app
    image: myapp:1.0
    securityContext:
      allowPrivilegeEscalation: false
      readOnlyRootFilesystem: true
      capabilities:
        drop:
        - ALL

Policy Enforcement with OPA Gatekeeper

ConstraintTemplate
yaml
apiVersion: templates.gatekeeper.sh/v1
kind: ConstraintTemplate
metadata:
  name: k8srequiredlabels
spec:
  crd:
    spec:
      names:
        kind: K8sRequiredLabels
      validation:
        openAPIV3Schema:
          type: object
          properties:
            labels:
              type: array
              items:
                type: string
  targets:
    - target: admission.k8s.gatekeeper.sh
      rego: |
        package k8srequiredlabels
        violation[{"msg": msg, "details": {"missing_labels": missing}}] {
          provided := {label | input.review.object.metadata.labels[label]}
          required := {label | label := input.parameters.labels[_]}
          missing := required - provided
          count(missing) > 0
          msg := sprintf("missing required labels: %v", [missing])
        }
Constraint
yaml
apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sRequiredLabels
metadata:
  name: require-app-label
spec:
  match:
    kinds:
      - apiGroups: ["apps"]
        kinds: ["Deployment"]
  parameters:
    labels: ["app", "environment"]

Service Mesh Security (Istio)

PeerAuthentication (mTLS)
yaml
apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
  name: default
  namespace: production
spec:
  mtls:
    mode: STRICT
AuthorizationPolicy
yaml
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
  name: allow-frontend
  namespace: production
spec:
  selector:
    matchLabels:
      app: backend
  action: ALLOW
  rules:
  - from:
    - source:
        principals: ["cluster.local/ns/production/sa/frontend"]

Best Practices

  1. Implement Pod Security Standards at namespace level
  2. Use Network Policies for network segmentation
  3. Apply least-privilege RBAC for all service accounts
  4. Enable admission control (OPA Gatekeeper/Kyverno)
  5. Run containers as non-root
  6. Use read-only root filesystem
  7. Drop all capabilities unless needed
  8. Implement resource quotas and limit ranges
  9. Enable audit logging for security events
  10. Regular security scanning of images
Show full SKILL.md (124 more words)Show less

Compliance Frameworks

CIS Kubernetes Benchmark
  • Use RBAC authorization
  • Enable audit logging
  • Use Pod Security Standards
  • Configure network policies
  • Implement secrets encryption at rest
  • Enable node authentication
NIST Cybersecurity Framework
  • Implement defense in depth
  • Use network segmentation
  • Configure security monitoring
  • Implement access controls
  • Enable logging and monitoring

Troubleshooting

NetworkPolicy not working:

bash
# Check if CNI supports NetworkPolicy
kubectl get nodes -o wide
kubectl describe networkpolicy <name>

RBAC permission denied:

bash
# Check effective permissions
kubectl auth can-i list pods --as system:serviceaccount:default:my-sa
kubectl auth can-i '*' '*' --as system:serviceaccount:default:my-sa

Reference Files

  • assets/network-policy-template.yaml - Network policy examples
  • assets/pod-security-template.yaml - Pod security policies
  • references/rbac-patterns.md - RBAC configuration patterns
  • k8s-manifest-generator - For creating secure manifests
  • gitops-workflow - For automated policy deployment

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.

© Cybereason-Public, GPL-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references, assets) in .cursor/skills/k8s-security-policies of Cybereason-Public/owLSM.

  • SKILL.md
  • assets/network-policy-template.yaml
  • references/rbac-patterns.md

Open the folder on GitHubat commit 8e541af

Used in 12 other repositories

We found 27 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 12 other GitHub owners. This page covers the copy in Cybereason-Public/owLSM, which our catalogue first saw on October 7, 2026.

Compare with similar skills

K8s Security Policies next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

K8s Security Policies compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
K8s Security Policies this skillCybereason-Public/owLSM28012 repos~2kAutomated safety check: PassGPL-2.0
Detecting Privilege Escalation In Kubernetes Podsmukul975/Anthropic-Cybersecurity-Skills34k—~2.4kAutomated safety check: PassApache-2.0
Implementing Rbac Hardening For Kubernetesmukul975/Anthropic-Cybersecurity-Skills34k—~2kAutomated safety check: PassApache-2.0
Auditing Kubernetes Rbac Privilege Escalationmukul975/Anthropic-Cybersecurity-Skills34k—~3kAutomated safety check: PassApache-2.0
Gke Workload Identitygoogle/skills21k—~4.4kAutomated safety check: PassApache-2.0
Kubernetes Rbac Analyzerjeremylongshore/tons-of-skills-marketplace2.8k—~590Automated safety check: PassMIT

Similar skills

  • Detecting Privilege Escalation In Kubernetes Pods

    mukul975/Anthropic-Cybersecurity-Skills

    Detects and prevents privilege escalation inside Kubernetes pods by combining admission control (OPA policies), runtime monitoring (Falco), and audit log analysis of security contexts, Linux…

    34k GitHub stars~2.4k tokensUpdated 1 mo ago
    SecurityAuto-check passed
  • Implementing Rbac Hardening For Kubernetes

    mukul975/Anthropic-Cybersecurity-Skills

    Hardens Kubernetes RBAC by designing least-privilege Roles and ClusterRoles, auditing RoleBindings, eliminating cluster-admin sprawl, separating service accounts, and integrating an external OIDC…

    34k GitHub stars~2k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Auditing Kubernetes Rbac Privilege Escalation

    mukul975/Anthropic-Cybersecurity-Skills

    Finds over-permissive RBAC roles and service-account token abuse paths in a Kubernetes cluster using kubectl auth can-i, rbac-police, kubectl-who-can, and rakkess, tracing which subjects can…

    34k GitHub stars~3k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Official

    Configures and diagnoses Workload Identity Federation for GKE authentication failures for Pods (403 "iam.serviceAccounts.getAccessToken" / permission denied, "could not find default credentials", or…

    21k GitHub stars~4.4k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Kubernetes Rbac Analyzer

    jeremylongshore/tons-of-skills-marketplace

    Analyze kubernetes rbac analyzer operations. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~590 tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • K8s Istio Bypass

    wgpsec/AboutSecurity

    Istio Service Mesh 安全策略绕过。当目标 K8s 集群使用 Istio、请求被 AuthorizationPolicy 拒绝(403 RBAC denied)、或发现 Envoy sidecar 时使用。核心手法:UID 1337 绕过 Envoy。任何在 K8s 中遇到 Istio 策略阻拦、Service Mesh 限制、或 Envoy 相关安全控制的场景都应使用此技能

    1.8k GitHub stars~727 tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from Cybereason-Public/owLSM

All 9 skills in this repo
  • Helm Chart Scaffolding

    Cybereason-Public/owLSM

    Comprehensive guidance for creating, organizing, and managing Helm charts for packaging and deploying Kubernetes applications.

    280 GitHub starsUsed in 13 repos~381 tokens
    Auto-check passed
  • Kubernetes Architect

    Cybereason-Public/owLSM

    Expert Kubernetes architect specializing in cloud-native infrastructure, advanced GitOps workflows (ArgoCD/Flux), and enterprise container orchestration.

    280 GitHub starsUsed in 9 repos~2.6k tokens
    Auto-check passed
  • K8s Manifest Generator

    Cybereason-Public/owLSM

    Step-by-step guidance for creating production-ready Kubernetes manifests including Deployments, Services, ConfigMaps, Secrets, and PersistentVolumeClaims.

    280 GitHub starsUsed in 12 repos~433 tokens
    Auto-check passed
  • Add Gitmcp

    Cybereason-Public/owLSM

    Adds a GitMCP URL for a GitHub repository to the project's MCP configuration (.cursor/mcp.json).

    280 GitHub stars~919 tokensUpdated 2 days ago
    Auto-check passed
  • GitHub Issues

    Cybereason-Public/owLSM

    Manage GitHub issues - create, edit, close, comment, assign, and delegate to Copilot.

    280 GitHub stars~1.8k tokensUpdated 2 days ago
    Auto-check passed
  • Measure Scenario Times

    Cybereason-Public/owLSM

    Adds temporary pytest-bdd timing hooks and writes debugscenariotimes.txt plus sorted step and scenario files.

    280 GitHub stars~676 tokensUpdated 2 days ago
    Auto-check passed

Works with

Questions about K8s Security Policies

What does K8s Security Policies do?

Comprehensive guide for implementing NetworkPolicy, PodSecurityPolicy, RBAC, and Pod Security Standards in Kubernetes. K8s Security Policies is an agent skill from Cybereason-Public/owLSM. Comprehensive guide for implementing NetworkPolicy, PodSecurityPolicy, RBAC, and Pod Security Standards in Kubernetes.

When should I use K8s Security Policies?

K8s Security Policies fits situations like: tasks that involve Container orchestration; tasks that involve Authorization and RBAC.

How do I install K8s Security Policies in Claude Code?

Run `npx skills add Cybereason-Public/owLSM --skill k8s-security-policies -a claude-code`. Or copy the skill folder (.cursor/skills/k8s-security-policies in Cybereason-Public/owLSM) into .claude/skills/k8s-security-policies in your project. Claude Code loads it when a task matches its description.

How do I install K8s Security Policies in Codex?

Run `npx skills add Cybereason-Public/owLSM --skill k8s-security-policies -a codex`. Or copy the skill folder (.cursor/skills/k8s-security-policies in Cybereason-Public/owLSM) into .agents/skills/k8s-security-policies in your project. Codex loads it when a task matches its description.

Can I use K8s Security Policies in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Cybereason-Public/owLSM --skill k8s-security-policies -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/k8s-security-policies, .gemini/skills/k8s-security-policies, .github/skills/k8s-security-policies and .opencode/skills/k8s-security-policies in your project.

What does K8s Security Policies need to run?

Going by SKILL.md and its folder, K8s Security Policies needs the command-line tools its instructions call (kubectl).

Does K8s Security Policies access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is K8s Security Policies safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does K8s Security Policies use?

K8s Security Policies is published under the GPL-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does K8s Security Policies use?

About 2k tokens (SKILL.md is roughly 7.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1k tokens, read only when the agent opens those files.

What are the alternatives to K8s Security Policies?

Skills that share tags, products or a category with K8s Security Policies: Detecting Privilege Escalation In Kubernetes Pods (mukul975/Anthropic-Cybersecurity-Skills, 34k stars), Implementing Rbac Hardening For Kubernetes (mukul975/Anthropic-Cybersecurity-Skills, 34k stars), Auditing Kubernetes Rbac Privilege Escalation (mukul975/Anthropic-Cybersecurity-Skills, 34k stars) and Gke Workload Identity (google/skills, 21k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains K8s Security Policies?

Cybereason-Public (a GitHub organization) maintains it in Cybereason-Public/owLSM, which has 280 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on October 8, 2026.

Source: Cybereason-Public/owLSM on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.