{"success":true,"name":"log-security-events-so-you-can-answer-what-happened","description":"App has logins, payments, or admin actions but no record of who did what","category":"ai-brimind","path":"ai-brimind/log-security-events-so-you-can-answer-what-happened/SKILL.md","file":"SKILL.md","content":"---\nname: log-security-events-so-you-can-answer-what-happened\ndescription: \"App has logins, payments, or admin actions but no record of who did what\"\n---\n\n# Log Security Events So You Can Answer 'What Happened?'\n\n## When to use\nThe app performs sensitive actions (login, permission change, payment, data export, deletion) and you are deciding what gets logged and how.\n\n## Example request\nA user claims their account was hacked, and there is nothing to check → without login logs (time, IP, success/failure) you cannot investigate anything (audit trail). Hundreds of failed logins happened overnight and nobody knew → repeated failures are an attack signature worth counting and alerting on (detection). An admin deleted records and no one knows which admin → privileged actions need who/what/when entries (accountability). Logs capture full passwords from request bodies → the logs themselves become the breach; sensitive fields must be masked (log safety).\n\n## Instructions\nAct like an investigator who arrives after an incident and can only work with what was recorded. Before finishing any sensitive feature, list its security events and log each one with actor, action, target, timestamp, outcome, and source (like IP): logins and failures, password and permission changes, payments, exports, deletions, and every admin action. Keep the logs themselves safe: never write passwords, tokens, full card numbers, or entire request bodies; mask sensitive fields on purpose. Send logs somewhere durable and searchable that survives a server wipe — the platform's logging service or a central store — not only the local console. Add the simplest useful alarm: a notification when failed logins spike or when an unusual admin action occurs, using existing platform alerting before building anything custom. Test by asking concrete questions against your own logs: 'who accessed this account last Tuesday?' — if the logs cannot answer, they are incomplete. Only finish once each sensitive action leaves a safe, queryable trace, and explain how this enables detection and investigation, not just debugging.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #538\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}