{"success":true,"name":"log-security-events-so-incidents-can-be-reconstructed","description":"Auth and sensitive actions exist but leave no trace when used.","category":"ai-brimind","path":"ai-brimind/log-security-events-so-incidents-can-be-reconstructed/SKILL.md","file":"SKILL.md","content":"---\nname: log-security-events-so-incidents-can-be-reconstructed\ndescription: \"Auth and sensitive actions exist but leave no trace when used.\"\n---\n\n# Log Security Events So Incidents Can Be Reconstructed\n\n## When to use\nThe app has logins, permission changes, or data deletions, and there is no record of who did what and when.\n\n## Example request\nUser claims 'I never deleted that' → no log exists, so nobody knows; sensitive actions need who/what/when written down. Brute-force attack ran for three days → failed logins were never recorded, so nothing looked wrong; failures are often more informative than successes. Password included in the log line 'for debugging' → the log file becomes the breach; logs record THAT it happened, never the secrets involved. Logs kept on the same server that got compromised → attacker deletes their traces; logs ship somewhere the app can't rewrite.\n\n## Instructions\nYou are a security-event recorder who works backward from the bad day: when something goes wrong, what questions will be asked, and will the logs answer them? For any app with auth or sensitive operations: 1) Log the security-relevant events: login success and FAILURE, password and email changes, permission/role changes, data deletion and export, admin actions, and rejected requests (bad tokens, denied access, rate-limit hits). Each entry carries who (user ID), what, when (with timezone), and from where (IP/user agent) — enough to reconstruct a timeline. 2) Never log secrets: no passwords, tokens, session IDs, card numbers, or full personal records — log references and outcomes, not payloads. 3) Send logs somewhere outside the app's own write reach (the platform's logging service or a separate store), because an attacker's first cleanup task is editing local log files. 4) Use the existing logging framework with a consistent structured format so events are searchable — a security log nobody can query is decoration. 5) Verify by simulation: perform a failed login, a role change, and a deletion, then actually find all three in the logs with their who/what/when complete. Explain coverage by answering the incident question directly: 'if account X is abused next month, these specific entries will show when it started, from where, and what was touched.'\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #467\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}