Kubernetes Seccomp & AppArmor Profile Hardening Prompt
Harden workloads with seccomp and AppArmor profiles that block dangerous syscalls and filesystem access without breaking the app — moving from Unconfined to RuntimeDefault and custom profiles safely.
- Target user
- Security and platform engineers hardening Kubernetes workloads in production
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior Kubernetes platform engineer specializing in runtime workload hardening who has rolled out seccomp and AppArmor profiles across production fleets without causing outages. I will provide: - The current pod `securityContext` (seccompProfile, AppArmor annotations/fields) and container details - What the app does (network, file IO, exec, special syscalls like ptrace/mount) - The threat model and compliance requirement driving the hardening Your job: 1. **Baseline first** — recommend moving from `Unconfined` to `RuntimeDefault` seccomp as the cheap, high-value first step, and explain what RuntimeDefault blocks and why it rarely breaks normal apps. 2. **Profile placement** — show the correct fields: pod vs container-level `seccompProfile`, and the AppArmor `securityContext.appArmorProfile` field (vs the deprecated annotation) for the cluster's K8s version. 3. **Build a custom profile when needed** — if RuntimeDefault is too broad or too narrow, outline how to capture the app's real syscall set (audit-mode logging, strace/Inspektor Gadget) and craft a least-privilege seccomp JSON. 4. **Roll out safely** — propose a staged plan: audit/complain mode first, watch for denials, then enforce; specify exactly which logs/metrics reveal a blocked syscall or AppArmor `DENIED`. 5. **Node prerequisites** — call out that custom profiles must be present on every node (via the Security Profiles Operator or a localhost path) and what breaks if a node lacks the profile. 6. **Verify and document** — define the acceptance test (app passes integration tests under enforce mode) and record which profile each workload uses. Output as: (a) the corrected securityContext blocks, (b) a custom profile draft if warranted, (c) the staged rollout steps with the exact denial signals to watch, (d) the node prerequisite checklist. Default to caution: never enforce an untested custom profile in production — a missing syscall can crash the container at runtime in ways that are hard to attribute.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Helm Secrets + SOPS Encrypted Values Workflow Prompt
Design a GitOps-safe workflow for encrypting Helm values with the helm-secrets plugin and SOPS (age/KMS) — encrypted values in git, decryption at deploy time, key rotation, and CI wiring.
-
Kubernetes Encryption-at-Rest KMS Provider Design Prompt
Design and roll out etcd encryption-at-rest with an EncryptionConfiguration and a KMS v2 provider — provider ordering, key rotation, and re-encrypting existing Secrets without downtime.
-
Ingress-NGINX Rate Limiting & Hardening Prompt
Design per-route rate limiting, connection limits, and abuse controls on ingress-nginx using annotations — including the memcached shared-state caveat, whitelist CIDRs, and how limits interact across replicas.
-
Kubernetes Job Pod Failure Policy & Success Policy Design Prompt
Design podFailurePolicy and successPolicy for batch/ML Jobs so retriable infra failures back off, non-retriable app errors fail fast, and indexed Jobs succeed on a partial completion set — instead of burning through backoffLimit blindly.
More Kubernetes & Helm prompts & error guides
Browse every Kubernetes & Helm prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.