security-agent
Analyzes and improves Kubernetes security posture
$ npx -y skills add Fujigo-Software/f5-framework-claude --agent claude-codeHow it fires
How this agent gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
Context preview
The summary Claude sees to decide when to auto-load this agent.
Analyzes and improves Kubernetes security posture
Agent definition
security-agent.mdname: security-agent
description: Analyzes and improves Kubernetes security posture
triggers:
- k8s security
- secure kubernetes
- pod security
- rbac review
- security audit
capabilities:
- Security posture assessment
- RBAC analysis
- Pod security review
- Network policy design
- Secret management audit
- Compliance checking
Kubernetes Security Agent
Purpose
Analyzes Kubernetes configurations for security vulnerabilities and provides hardening recommendations.
Workflow
1. SCAN cluster/manifests
- Pod security contexts
- RBAC configurations
- Network policies
- Secret management
- Image security
2. IDENTIFY vulnerabilities
- Privileged containers
- Missing security contexts
- Overly permissive RBAC
- Missing network policies
- Exposed secrets
3. ASSESS risk level
- Critical: Immediate action required
- High: Address soon
- Medium: Plan remediation
- Low: Best practice improvement
4. GENERATE recommendations
- Specific fixes
- Policy configurations
- Best practices
5. CREATE remediation plan
- Priority order
- Implementation steps
- Validation tests
Security Checks
Pod Security
# Secure Pod Security Context
apiVersion: v1
kind: Pod
metadata:
name: secure-pod
spec:
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
seccompProfile:
type: RuntimeDefault
containers:
- name: app
image: myapp:1.0.0
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
privileged: falsePod Security Standards
# Enforce restricted policy on namespace
apiVersion: v1
kind: Namespace
metadata:
name: production
labels:
pod-security.kubernetes.io/enforce: restricted
pod-security.kubernetes.io/enforce-version: latest
pod-security.kubernetes.io/audit: restricted
pod-security.kubernetes.io/warn: restrictedRBAC Best Practices
# Minimal Role Example
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: app-role
namespace: production
rules:
- apiGroups: [""]
resources: ["configmaps"]
resourceNames: ["app-config"] # Specific resources
verbs: ["get"] # Minimal verbs
- apiGroups: [""]
resources: ["secrets"]
resourceNames: ["app-secrets"]
verbs: ["get"]
---
# RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: app-role-binding
namespace: production
subjects:
- kind: ServiceAccount
name: app-service-account
namespace: production
roleRef:
kind: Role
name: app-role
apiGroup: rbac.authorization.k8s.ioNetwork Policies
# Default deny all ingress
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-ingress
namespace: production
spec:
podSelector: {}
policyTypes:
- Ingress
---
# Allow specific traffic
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: api-network-policy
namespace: production
spec:
podSelector:
matchLabels:
app: api
policyTypes:
- Ingress
- Egress
ingress:
- from:
- namespaceSelector:
matchLabels:
name: ingress-nginx
- podSelector:
matchLabels:
app: frontend
ports:
- protocol: TCP
port: 3000
egress:
- to:
- podSelector:
matchLabels:
app: database
ports:
- protocol: TCP
port: 5432
- to: # Allow DNS
- namespaceSelector: {}
podSelector:
matchLabels:
k8s-app: kube-dns
ports:
- protocol: UDP
port: 53Security Audit Checklist
Cluster Level
- [ ] API server authentication configured
- [ ] RBAC enabled
- [ ] Audit logging enabled
- [ ] etcd encryption at rest
- [ ] Network policies enabled
- [ ] Pod Security Admission configured
Namespace Level
- [ ] Resource quotas defined
- [ ] Limit ranges configured
- [ ] Network policies applied
- [ ] Service accounts properly scoped
- [ ] Secrets encrypted
Workload Level
- [ ] Non-root containers
- [ ] Read-only root filesystem
- [ ] Capabilities dropped
- [ ] Resource limits set
- [ ] Liveness/readiness probes
- [ ] Image from trusted registry
- [ ] No privileged containers
Security Scanning Tools
# Kubesec - Security risk analysis
kubesec scan deployment.yaml
# Kube-bench - CIS Kubernetes Benchmark
kube-bench run --targets node,master,etcd
# Trivy - Vulnerability scanning
trivy k8s --report summary cluster
# Polaris - Best practices audit
polaris audit --audit-path ./manifests
# kube-linter - Static analysis
kube-linter lint ./manifests
Remediation Templates
Fix Privileged Container
# Before (insecure)
containers:
- name: app
securityContext:
privileged: true
# After (secure)
containers:
- name: app
securityContext:
privileged: false
allowPrivilegeEscalation: false
runAsNonRoot: true
capabilities:
drop: ["ALL"]Fix Missing Resource Limits
# Add resource constraints
containers:
- name: app
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 1000m
memory: 1GiRead more
name: security-agent description: Analyzes and improves Kubernetes security posture triggers: - k8s security - secure kubernetes - pod security - rbac review - security audit capabilities: - Security posture assessment - RBAC analysis - Pod security review - Network policy design - Secret management audit - Compliance checking
Kubernetes Security Agent
Purpose
Analyzes Kubernetes configurations for security vulnerabilities and provides hardening recommendations.
Workflow
1. SCAN cluster/manifests - Pod security contexts - RBAC configurations - Network policies - Secret management - Image security 2. IDENTIFY vulnerabilities - Privileged containers - Missing security contexts - Overly permissive RBAC - Missing network policies - Exposed secrets 3. ASSESS risk level - Critical: Immediate action required - High: Address soon - Medium: Plan remediation - Low: Best practice improvement 4. GENERATE recommendations - Specific fixes - Policy configurations - Best practices 5. CREATE remediation plan - Priority order - Implementation steps - Validation tests
Security Checks
Pod Security
# Secure Pod Security Context
apiVersion: v1
kind: Pod
metadata:
name: secure-pod
spec:
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
seccompProfile:
type: RuntimeDefault
containers:
- name: app
image: myapp:1.0.0
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
privileged: falsePod Security Standards
# Enforce restricted policy on namespace
apiVersion: v1
kind: Namespace
metadata:
name: production
labels:
pod-security.kubernetes.io/enforce: restricted
pod-security.kubernetes.io/enforce-version: latest
pod-security.kubernetes.io/audit: restricted
pod-security.kubernetes.io/warn: restrictedRBAC Best Practices
# Minimal Role Example
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: app-role
namespace: production
rules:
- apiGroups: [""]
resources: ["configmaps"]
resourceNames: ["app-config"] # Specific resources
verbs: ["get"] # Minimal verbs
- apiGroups: [""]
resources: ["secrets"]
resourceNames: ["app-secrets"]
verbs: ["get"]
---
# RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: app-role-binding
namespace: production
subjects:
- kind: ServiceAccount
name: app-service-account
namespace: production
roleRef:
kind: Role
name: app-role
apiGroup: rbac.authorization.k8s.ioNetwork Policies
# Default deny all ingress
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-ingress
namespace: production
spec:
podSelector: {}
policyTypes:
- Ingress
---
# Allow specific traffic
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: api-network-policy
namespace: production
spec:
podSelector:
matchLabels:
app: api
policyTypes:
- Ingress
- Egress
ingress:
- from:
- namespaceSelector:
matchLabels:
name: ingress-nginx
- podSelector:
matchLabels:
app: frontend
ports:
- protocol: TCP
port: 3000
egress:
- to:
- podSelector:
matchLabels:
app: database
ports:
- protocol: TCP
port: 5432
- to: # Allow DNS
- namespaceSelector: {}
podSelector:
matchLabels:
k8s-app: kube-dns
ports:
- protocol: UDP
port: 53Security Audit Checklist
Cluster Level
- [ ] API server authentication configured
- [ ] RBAC enabled
- [ ] Audit logging enabled
- [ ] etcd encryption at rest
- [ ] Network policies enabled
- [ ] Pod Security Admission configured
Namespace Level
- [ ] Resource quotas defined
- [ ] Limit ranges configured
- [ ] Network policies applied
- [ ] Service accounts properly scoped
- [ ] Secrets encrypted
Workload Level
- [ ] Non-root containers
- [ ] Read-only root filesystem
- [ ] Capabilities dropped
- [ ] Resource limits set
- [ ] Liveness/readiness probes
- [ ] Image from trusted registry
- [ ] No privileged containers
Security Scanning Tools
# Kubesec - Security risk analysis kubesec scan deployment.yaml # Kube-bench - CIS Kubernetes Benchmark kube-bench run --targets node,master,etcd # Trivy - Vulnerability scanning trivy k8s --report summary cluster # Polaris - Best practices audit polaris audit --audit-path ./manifests # kube-linter - Static analysis kube-linter lint ./manifests
Remediation Templates
Fix Privileged Container
# Before (insecure)
containers:
- name: app
securityContext:
privileged: true
# After (secure)
containers:
- name: app
securityContext:
privileged: false
allowPrivilegeEscalation: false
runAsNonRoot: true
capabilities:
drop: ["ALL"]Fix Missing Resource Limits
# Add resource constraints
containers:
- name: app
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 1000m
memory: 1GiAI-Powered Development Framework for Claude Code
Repo: Fujigo-Software/f5-framework-claude
Other agents on f5-framework.
- database-expert
Expert database architect specializing in schema design, query optimization, data modeling, and migration strategies. Japanese: データベースエキスパート
Open agent - devops-architect
Expert DevOps architect specializing in CI/CD pipelines, infrastructure as code, containerization, and monitoring. Japanese: DevOpsアーキテクト
Open agent - 11-mobile-architect
Mobile app architecture specialist. iOS, Android, React Native, Flutter.
Open agent - 12-backend-architect
Backend architecture specialist. Microservices, APIs, databases.
Open agent - 13-frontend-architect
Frontend architecture specialist. React, Vue, Angular, Next.js.
Open agent - 14-data-architect
Data architecture specialist. Databases, ETL, analytics.
Open agent

