Audit & Logging Policy Design Prompt
Design a defensible audit-logging policy — what security events to capture, tamper-resistant retention, and high-value detection signals — so you can answer 'who did what, when' during an incident.
- Target user
- Security and platform engineers building audit and detection coverage
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a detection-and-response engineer who has built audit pipelines that actually answered the hard questions during real incidents. I will provide: - The environment (Linux hosts, Kubernetes, cloud accounts, CI/CD) - Current logging (auditd, cloud trail logs, k8s audit, app logs) and where it ships - Compliance/retention requirements and known blind spots Your job: 1. **Define what MUST be logged** — for each layer, enumerate the security-relevant events: authentication (success and failure), privilege use (sudo, role assumption), changes to identities/permissions, secret access, config and firewall changes, process/exec on sensitive hosts, and data access on crown-jewel stores. 2. **Concrete capture config** — provide the actual rules: auditd rules for privilege/exec/file-watch, the cloud trail/data-event settings, and a Kubernetes audit policy with appropriate levels (Metadata vs Request) per resource. Avoid logging everything at Request level — call out the noise/cost tradeoff. 3. **Integrity & tamper resistance** — ship logs off-host in near-real-time, restrict who can delete them, enable append-only/immutable retention (object-lock / WORM), and detect gaps (a host that stops logging is itself a signal). 4. **Retention tiers** — propose hot (searchable) vs cold (compliance) windows by data class, with a cost note, and ensure retention meets the stated requirement. 5. **Turn logs into detections** — list 8-10 high-value alerts these logs enable: impossible-travel logins, new admin grant, secret read by an unexpected principal, audit-logging disabled, mass-delete, off-hours privilege escalation. Give the signal and a rough threshold for each. 6. **Privacy & hygiene** — avoid capturing secrets/PII in log bodies; redact tokens; document access to the audit store itself. Output as: (a) the per-layer "must-log" matrix, (b) ready-to-apply capture configs, (c) the integrity/retention design, (d) the top detection rules with thresholds, (e) a gap list versus the requirements with priorities. Bias toward: high-signal coverage over capturing everything, tamper-resistant off-host storage, and every log line having a question it can answer.
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
-
Certificate Transparency Monitoring for Rogue Cert Detection Prompt
Design Certificate Transparency log monitoring that alerts on unauthorized or mis-issued certificates for your domains
-
CloudTrail Anomaly Hunting Review Prompt
Threat-hunt across AWS CloudTrail events to surface suspicious IAM, persistence, and exfiltration patterns and turn them into detections
-
LD_PRELOAD & Library-Injection Persistence Audit Prompt
Audit a Linux host for library-injection persistence and hijack risk — LD_PRELOAD, /etc/ld.so.preload, ldconfig path poisoning, and writable RPATH/RUNPATH directories used by privileged binaries.
-
Remote Syslog Forwarding Integrity Review Prompt
Audit rsyslog/journald remote log forwarding for plaintext transport, spoofable sources, gaps that let an attacker tamper with or drop logs, and ensure tamper-evident delivery to a central SIEM.
More DevOps Security & Hardening prompts & error guides
Browse every DevOps Security & Hardening 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.