k8s-security-policies

Implement Kubernetes NetworkPolicy, PodSecurityPolicy, and RBAC security policies.

6|2|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/amurata/cc-tools --skill k8s-security-policies-amurata
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: k8s-security-policies
Source: https://github.com/amurata/cc-tools/tree/main/plugins/kubernetes-operations/skills/k8s-security-policies
Command: npx skills add https://github.com/amurata/cc-tools --skill k8s-security-policies-amurata

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill addresses the critical need for robust security in Kubernetes environments by providing tools and guidance to implement essential security policies, thereby preventing unauthorized access and ensuring cluster integrity.

Core Features & Use Cases

  • Pod Security Standards: Enforces security best practices for pods, ranging from unrestricted to highly restricted configurations.
  • Network Policies: Implements network segmentation and access control between pods and namespaces.
  • RBAC Configuration: Manages Role-Based Access Control for fine-grained permissions.
  • Use Case: Secure a multi-tenant Kubernetes cluster by implementing strict network policies to isolate tenant workloads and using RBAC to enforce least-privilege access for all users and service accounts.

Quick Start

Apply the 'default-deny-all' NetworkPolicy to the 'production' namespace to restrict all ingress and egress traffic by default.

Frequently Asked Questions about k8s-security-policies

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement network segmentation for a multi-tenant Kubernetes cluster?

Kubernetes RBAC configuration manages fine-grained permissions to enforce least-privilege access control. It restricts unauthorized access for users and service accounts by explicitly defining allowed actions within the cluster.

What are Kubernetes Pod Security Standards and how do I enforce them?

Kubernetes Pod Security Standards enforce security best practices for pods, ranging from unrestricted to highly restricted configurations. You enforce them using PodSecurityPolicy to ensure cluster integrity and prevent unauthorized container actions.

How do I set up a default-deny network policy for pod traffic?

To set up a default-deny network policy, apply a NetworkPolicy resource to your namespace that restricts all ingress and egress traffic by default. This establishes a secure baseline before adding explicit allow rules for required pod communications.

Do I need to understand Kubernetes networking and security contexts to secure my cluster?

Yes, securing a Kubernetes cluster requires understanding of Kubernetes networking, RBAC, and security contexts. This knowledge is necessary to implement production-grade network policies, pod security standards, and access control effectively.

What is the best way to enforce least-privilege access control for Kubernetes service accounts?

The best way to enforce least-privilege access control is by configuring Kubernetes RBAC. It manages fine-grained permissions for service accounts and users, ensuring they only have the minimum required access within the production-grade cluster.