一键导入
security-logging-failures
Requires structured security event logging before any authentication, authorization, or sensitive data access code ships.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Requires structured security event logging before any authentication, authorization, or sensitive data access code ships.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Full pre-ship security review that runs all ten OWASP Top 10 checks in sequence. Use before any significant feature ships to production.
Checks for server-side request forgery risk before any code that makes outbound HTTP requests based on user-supplied URLs or parameters is written or modified.
Checks deserialization safety, CI/CD pipeline integrity, and dependency integrity before any code that deserializes objects or executes pipeline scripts is written or modified.
Enforces secure authentication patterns before any login, session, token, or credential management code is written or modified.
Checks CVE status, license compatibility, and maintenance health of any new dependency before it enters the codebase.
Checks for insecure default settings, exposed debug endpoints, permissive CORS, open cloud storage, and missing security headers before any configuration or deployment code ships.
| name | security-logging-failures |
| description | Requires structured security event logging before any authentication, authorization, or sensitive data access code ships. |
| when_to_use | Apply automatically when writing or modifying authentication flows, authorization checks, admin functions, data export, payment processing, or any operation where a security-relevant event should be auditable. |
Security logging failures mean that when an attack happens, nobody can tell. No audit trail. No structured events. Logs that exist but contain no useful fields. An agent writing authentication or data access code produces code that works. It does not produce code that can be investigated after a breach.
Every security-sensitive operation must emit a structured log event with these fields at minimum:
timestamp — ISO 8601, UTCevent_type — machine-readable category (auth.login.success, auth.login.failure, access.denied, data.export, admin.action)user_id — the authenticated identity, or anonymous if not authenticatedip_address — source IP of the requestresource — what was accessed or attemptedresult — success or failurereason — for failures, a specific reason (not just "error")Security events that require logging:
Before writing security-sensitive code, confirm the logging plan:
## Security Logging Check
**Operation:** [what this code does]
**Security events generated:** [list each event type]
### Logging Plan
For each event:
- Event type: [machine-readable name]
- Fields logged: [timestamp, user_id, ip, resource, result, reason]
- Sensitive fields excluded: [confirm none of the blocked fields appear]
### Verdict
[CLEAR — logging plan complete / BLOCKED — list missing event types or fields]
Block before shipping if:
# Good: structured security event
import structlog
log = structlog.get_logger()
def login(email, password, ip_address):
user = authenticate(email, password)
if user:
log.info("auth.login.success",
user_id=user.id,
ip_address=ip_address,
timestamp=datetime.utcnow().isoformat()
)
else:
log.warning("auth.login.failure",
user_id=None,
ip_address=ip_address,
reason="invalid_credentials",
timestamp=datetime.utcnow().isoformat()
)