skills/log-entity-actions-pattern/SKILL.md
Security pattern for implementing security logging and audit trails. Use when designing logging systems for security events, implementing non-repudiation, creating audit trails, or addressing security monitoring and incident response needs. Addresses "Entity repudiates action request" problem.
npx skillsauth add igbuend/grimbard log-entity-actions-patternInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Records entity actions to create an audit trail, enabling accountability, non-repudiation, incident investigation, and security monitoring.
Entity repudiates action request: An entity denies having performed an action, or there's no way to determine what actions occurred, who performed them, or when.
| Role | Type | Responsibility | |------|------|----------------| | Entity | Entity | Performs actions that should be logged | | System | Entity | Processes entity requests | | Logger | Entity | Records actions to log store | | Log Store | Storage | Persists log entries | | Log Monitor | Entity | Analyzes logs for anomalies |
Never log:
Entity → [action] → System
System → [log(action, principal, timestamp, outcome)] → Logger
Logger → [store] → Log Store
Log Monitor → [analyze] → Log Store
Log Monitor → [alert] → Security Team (if anomaly)
| Event | Log Level | Details to Include | |-------|-----------|-------------------| | Login success | INFO | principal, source IP, timestamp | | Login failure | WARN | attempted user, source IP, failure reason | | Authorization denied | WARN | principal, action, resource | | Admin action | INFO | principal, action, target, parameters | | Security config change | INFO | principal, what changed, old/new values | | Session timeout | INFO | principal, session duration |
development
Security anti-pattern for Cross-Site Scripting vulnerabilities (CWE-79). Use when generating or reviewing code that renders HTML, handles user input in web pages, uses innerHTML/document.write, or builds dynamic web content. Covers Reflected, Stored, and DOM-based XSS. AI code has 86% XSS failure rate.
development
Security anti-pattern for XPath injection vulnerabilities (CWE-643). Use when generating or reviewing code that queries XML documents, constructs XPath expressions, or handles user input in XML operations. Detects unescaped quotes and special characters in XPath queries.
development
Security anti-pattern for weak password hashing (CWE-327, CWE-759). Use when generating or reviewing code that stores or verifies user passwords. Detects use of MD5, SHA1, SHA256 without salt, or missing password hashing entirely. Recommends bcrypt, Argon2, or scrypt.
development
Security anti-pattern for weak encryption (CWE-326, CWE-327). Use when generating or reviewing code that encrypts data, handles encryption keys, or uses cryptographic modes. Detects DES, ECB mode, static IVs, and custom crypto implementations.