.claude/skills/eks-security/SKILL.md
EKS security hardening and best practices. Use when configuring cluster security, implementing pod security, managing secrets, preparing for compliance audits, hardening infrastructure, scanning containers, or responding to security incidents.
npx skillsauth add adaptationio/skrillz eks-securityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive security hardening guide for Amazon EKS clusters following 2025 best practices. This skill covers control plane security, workload isolation, secrets management, network policies, image scanning, runtime security, and compliance frameworks.
Keywords: EKS security, cluster hardening, IRSA, Pod Security Standards, network policies, secrets management, compliance, vulnerability scanning, runtime security, incident response
Status: Production-ready (2025 best practices)
┌─────────────────────────────────────────────────────────────┐
│ EKS Security Layers │
├─────────────────────────────────────────────────────────────┤
│ │
│ Layer 1: Control Plane Security │
│ • Private API endpoint │
│ • Audit logging enabled │
│ • Secrets encryption with KMS │
│ • IP allowlisting │
│ │
│ Layer 2: Authentication & Authorization │
│ • IAM Roles for Service Accounts (IRSA) │
│ • RBAC with least privilege │
│ • Pod Identity for workloads │
│ • Service account isolation │
│ │
│ Layer 3: Workload Security │
│ • Pod Security Standards (restricted) │
│ • Security contexts │
│ • Read-only root filesystems │
│ • Non-root users │
│ • Resource limits │
│ │
│ Layer 4: Network Security │
│ • Network Policies (VPC CNI 1.14+) │
│ • Security Groups for Pods │
│ • Private subnets for nodes │
│ • VPC Flow Logs │
│ • mTLS with service mesh │
│ │
│ Layer 5: Secrets & Data Protection │
│ • External Secrets Operator │
│ • AWS Secrets Manager integration │
│ • Encrypted etcd │
│ • Automatic rotation │
│ │
│ Layer 6: Image & Runtime Security │
│ • Amazon Inspector scanning │
│ • Admission controllers (OPA/Gatekeeper) │
│ • Runtime monitoring (Falco, GuardDuty) │
│ • Image signing/verification │
│ │
│ Layer 7: Compliance & Audit │
│ • CloudTrail logging │
│ • GuardDuty for EKS │
│ • Security Hub integration │
│ • CIS/NIST compliance checks │
│ │
└─────────────────────────────────────────────────────────────┘
See: references/cluster-security.md
See: references/workload-security.md
See: references/secrets-management.md
Why: Provides pod-level AWS permissions without node-level credentials
Quick Implementation:
# Service Account with IRSA
apiVersion: v1
kind: ServiceAccount
metadata:
name: my-app-sa
namespace: production
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::ACCOUNT_ID:role/my-app-role
Best Practices:
Details: references/cluster-security.md#irsa
Why: Prevents privilege escalation and enforces security best practices
Quick Implementation:
# Restricted namespace
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
Levels:
Details: references/workload-security.md#pod-security-standards
Why: Implement microsegmentation and zero-trust networking
Quick Implementation:
# Default deny all traffic
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-all
namespace: production
spec:
podSelector: {}
policyTypes:
- Ingress
- Egress
Capabilities:
Details: references/workload-security.md#network-policies
Why: Centralized secret management with automatic rotation
Quick Implementation:
# ExternalSecret resource
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: app-secrets
namespace: production
spec:
refreshInterval: 1h
secretStoreRef:
name: aws-secrets-manager
kind: SecretStore
target:
name: app-secrets-k8s
data:
- secretKey: db-password
remoteRef:
key: prod/db/password
Benefits:
Details: references/secrets-management.md#external-secrets-operator
Why: Identify and remediate vulnerabilities before deployment
Amazon Inspector 2025 Features:
Quick Setup:
# Enable enhanced scanning
aws ecr put-registry-scanning-configuration \
--scan-type ENHANCED \
--rules '[{"repositoryFilters":[{"filter":"*","filterType":"WILDCARD"}],"scanFrequency":"CONTINUOUS_SCAN"}]'
Details: references/workload-security.md#image-scanning
Why: Detect and respond to threats in real-time
Tools:
GuardDuty for EKS Capabilities:
Details: references/workload-security.md#runtime-security
Configuration:
Use Case: Healthcare, finance, regulated industries
Configuration:
Use Case: Standard production workloads
Configuration:
Use Case: Platform teams, SaaS applications
Tool: kube-bench
# Run CIS benchmark
kubectl apply -f https://raw.githubusercontent.com/aquasecurity/kube-bench/main/job-eks.yaml
# View results
kubectl logs -n kube-bench job/kube-bench
Key Controls:
Five Areas:
Implementation: See detailed mapping in references/cluster-security.md#compliance
Common Requirements:
Compromised Pod:
# Immediate isolation
kubectl label pod <pod-name> security=isolated
kubectl apply -f - <<EOF
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: isolate-compromised-pod
spec:
podSelector:
matchLabels:
security: isolated
policyTypes:
- Ingress
- Egress
EOF
# Collect forensics
kubectl logs <pod-name> > pod-logs.txt
kubectl exec <pod-name> -- ps aux > processes.txt
# Delete pod
kubectl delete pod <pod-name>
Details: references/workload-security.md#incident-response
For comprehensive security configurations and advanced topics:
Cluster-Level Security: references/cluster-security.md
Workload Security: references/workload-security.md
Secrets Management: references/secrets-management.md
| Anti-Pattern | Risk | Solution | |--------------|------|----------| | Using default service accounts | Overly permissive | Create dedicated service accounts per app | | Privileged containers | Host access, container escape | Use specific capabilities, PSS restricted | | Hardcoded secrets in manifests | Credential exposure | Use External Secrets Operator | | No network policies | Lateral movement | Implement default-deny policies | | Running as root | Privilege escalation | Set runAsNonRoot: true | | Public API endpoint without restrictions | Unauthorized access | Use private endpoint or IP allowlist | | No image scanning | Vulnerability deployment | Enable Amazon Inspector | | Shared node IAM roles | Excessive permissions | Use IRSA for pod-level permissions | | No resource limits | Resource exhaustion | Set requests and limits | | Missing audit logs | No forensic capability | Enable all control plane logs |
module "eks_security" {
source = "./modules/eks-security"
cluster_name = "production-cluster"
# Control plane
enable_private_endpoint = true
enable_public_endpoint = false
enable_audit_logging = true
kms_key_arn = aws_kms_key.eks.arn
# Workload security
pod_security_standard = "restricted"
enable_network_policies = true
# Secrets
deploy_external_secrets = true
secrets_manager_role_arn = aws_iam_role.secrets.arn
# Monitoring
enable_guardduty = true
enable_inspector = true
# Compliance
cis_compliance_mode = true
}
See full examples: references/cluster-security.md#terraform
# Check Pod Security Standards
kubectl get namespaces -o custom-columns=NAME:.metadata.name,PSS:.metadata.labels.pod-security\.kubernetes\.io/enforce
# List service accounts with IRSA
kubectl get sa -A -o jsonpath='{range .items[?(@.metadata.annotations.eks\.amazonaws\.com/role-arn)]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{.metadata.annotations.eks\.amazonaws\.com/role-arn}{"\n"}{end}'
# Check for privileged pods
kubectl get pods -A -o jsonpath='{range .items[?(@.spec.containers[*].securityContext.privileged==true)]}{.metadata.namespace}{"\t"}{.metadata.name}{"\n"}{end}'
# List pods running as root
kubectl get pods -A -o jsonpath='{range .items[?(@.spec.securityContext.runAsNonRoot!=true)]}{.metadata.namespace}{"\t"}{.metadata.name}{"\n"}{end}'
# Check network policies
kubectl get networkpolicies -A
# View audit logs
aws logs tail /aws/eks/production-cluster/cluster --follow --filter-pattern '{ $.verb != "get" && $.verb != "list" && $.verb != "watch" }'
# GuardDuty findings
aws guardduty list-findings --detector-id <detector-id> --finding-criteria '{"Criterion":{"resource.resourceType":{"Eq":["EKS"]}}}'
# Inspector scan results
aws inspector2 list-findings --filter-criteria '{"ecrImageRepositoryName":[{"comparison":"EQUALS","value":"my-repo"}]}'
# CloudWatch Container Insights
aws cloudwatch get-metric-statistics \
--namespace ContainerInsights \
--metric-name pod_cpu_utilization \
--dimensions Name=ClusterName,Value=production-cluster
Last Updated: November 2025 Kubernetes Version: 1.33 Security Standards: CIS Kubernetes Benchmark 1.8, NIST 800-190, AWS Well-Architected Status: Production-ready
development
Setup secure web-based terminal access to WSL2 from mobile/tablet via ttyd + ngrok/Cloudflare/Tailscale. One-command install, start, stop, status. Use when you need remote terminal access, web terminal, browser-based shell, or mobile access to WSL2 environment.
development
Complete development workflows where Claude writes the code while Gemini and Codex provide research, planning, reviews, and different perspectives. Claude remains the main developer. Use for complex projects requiring expert planning and multi-perspective reviews.
development
Systematic progress tracking for skill development. Manages task states (pending/in_progress/completed), updates in real-time, reports progress, identifies blockers, and maintains momentum. Use when tracking skill development, coordinating work, or reporting progress.
testing
Comprehensive testing workflow orchestrating functional testing, example validation, integration testing, and usability assessment. Sequential workflow for complete skill testing from examples through scenarios to integration validation. Use when conducting thorough testing, pre-deployment validation, ensuring skill functionality, or comprehensive quality checks.