kubernetes-hardening
Helps your agent secure Kubernetes applications with security settings and network policies.
What it does
This tool helps make your Kubernetes environment more secure. It sets up rules to protect your applications and the cluster itself from unauthorized access and risky behaviors.
When to use it
- ✓When setting up a new Kubernetes cluster.
- ✓When you need to protect applications running on Kubernetes.
- ✓To meet security and compliance requirements.
Example of what to ask your AI
“Configure Kubernetes to use restricted security policies for the 'production' namespace.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
It applies configurations called 'Pod Security Standards' and 'Network Policies'. These settings define what applications can and cannot do, and how they can communicate with each other and the outside.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add sickn33/agentic-awesome-skills --skill kubernetes-hardeningOr download just the file:
curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/kubernetes-hardening/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Kubernetes Hardening
Secure Kubernetes clusters and workloads.
When to Use This Skill
Use this skill when:
- Hardening Kubernetes clusters
- Implementing Pod Security Standards
- Configuring network policies
- Meeting security compliance
Scope and validation
Confirm the exact cluster/namespace/version and authorized writes before applying policies. Examples are fragments: validate the reviewed image, namespace, service accounts, labels and required runtime storage. Pin the policy version to the target Kubernetes release where supported. Restricted admission controls new/updated pods; it does not retroactively fix running workloads or establish compliance.
Pod Security Standards
# Namespace with restricted policy
apiVersion: v1
kind: Namespace
metadata:
name: production
labels:
pod-security.kubernetes.io/enforce: restricted
pod-security.kubernetes.io/audit: restricted
pod-security.kubernetes.io/warn: restricted
Security Context
apiVersion: v1
kind: Pod
metadata:
name: secure-pod
labels:
app: web
spec:
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
seccompProfile:
type: RuntimeDefault
containers:
- name: app
image: registry.example.invalid/myapp:REVIEWED_IMMUTABLE_TAG
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
Network Policies
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-all
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-web
spec:
podSelector:
matchLabels:
app: web
ingress:
- from:
- podSelector:
matchLabels:
app: frontend
ports:
- port: 8080
RBAC
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: app-reader
rules:
- apiGroups: [""]
resources: ["pods", "services"]
verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: app-reader-binding
subjects:
- kind: ServiceAccount
name: myapp
roleRef:
kind: Role
name: app-reader
apiGroup: rbac.authorization.k8s.io
Best Practices
- Enable Pod Security Standards
- Implement network policies
- Use RBAC with least privilege
- Enable audit logging
- Secure etcd with encryption
- Use service mesh for mTLS
- Regular security scanning
Related Skills
- kubernetes-ops (
kubernetes-ops) - K8s operations - container-hardening (
container-hardening) - Container security
Limitations
- Apply guidance only within authorized scope; test destructive steps in non-production first.
- Docs-only import: upstream scripts and templates not bundled.
Example
# Read-only first: inventory before any active step.
which <tool> && <tool> --help | head -n 20
Adapted from BagelHole/DevOps-Security-Agent-Skills (MIT); frontmatter, When to Use/Limitations, and safety boundaries added for upstream compliance. Docs-only import: helper scripts and templates not bundled.
NetworkPolicy enforcement requires a supporting CNI. The default-deny example also blocks DNS and dependencies until narrowly scoped rules are added; same-namespace pod selectors do not authorize arbitrary namespaces. Test allowed and denied flows from the real source identities and preserve recovery access. readOnlyRootFilesystem may require bounded writable temporary volumes; do not disable it blindly after a startup error. Kubernetes NetworkPolicy behavior.
FAQ
What are 'Pod Security Standards'?
These are a set of rules that define the security level for containers running within your Kubernetes cluster, such as preventing them from running as administrator.
What are 'Network Policies'?
These are like firewalls within your cluster. They control which network traffic is allowed between containers and outside the cluster, ensuring only necessary communications occur.
Does this tool automatically fix security issues?
It applies new security rules but doesn't automatically fix issues in already running applications. It's important to test changes before applying them in production.
Details
Original description by the author
Implement Kubernetes security contexts, Pod Security Standards, and network policies.
Popularity
- GitHub stars
- 48k
- Ranking position
- #3403
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
00-andruia-consultant
Helps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
sickn33/agentic-awesome-skills
007
Lets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
sickn33/agentic-awesome-skills
10-andruia-skill-smith
Helps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
sickn33/agentic-awesome-skills
20-andruia-niche-intelligence
Lets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
sickn33/agentic-awesome-skills
Similar skills
django-security
Helps your agent implement security practices in Django applications. It focuses on authentication, authorization, and prevention against common attacks, ensuring more secure code.
affaan-m/ECC
laravel-security
Helps your agent secure Laravel applications against threats. Implements security practices for authentication, authorization, and common attack prevention.
affaan-m/ECC
module-regression
Helps your agent manage changes in large projects. Ensures code changes in one part don't break other parts.
affaan-m/ECC