python-logging-monitoring-failures

python-logging-monitoring-failures is a cursor rule for Cursor from abderrahimghazali/cursor-rules. It costs 0 tokens per session (3,895 once invoked), scanned A, a copy of python-logging-monitoring-failures, MIT.

A security rule set for Python logging and monitoring based on OWASP A09, the category covering failures to record or detect security events.

In plain words
What is it for?
It is for detecting missing logging in login, logout, authorization, account creation, deletion, and password-related functions.
Why use it?
It warns when authentication, permission checks, or sensitive user operations may happen without security-relevant logs.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/abderrahimghazali/cursor-rules/python-logging-monitoring-failures
Clone the repo
git clone --depth 1 https://github.com/abderrahimghazali/cursor-rules

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for python-logging-monitoring-failures

README.md
[![agentmods](https://agentmods.dev/badge/rules/abderrahimghazali/cursor-rules/python-logging-monitoring-failures.svg)](https://agentmods.dev/rules/abderrahimghazali/cursor-rules/python-logging-monitoring-failures)
Your own site
<a href="https://agentmods.dev/rules/abderrahimghazali/cursor-rules/python-logging-monitoring-failures"><img src="https://agentmods.dev/badge/rules/abderrahimghazali/cursor-rules/python-logging-monitoring-failures.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 3,895 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.03895
Opus 5 $0.00000 $0.01947
Sonnet 5 $0.00000 $0.00779
Haiku 4.5 $0.00000 $0.00390

Measured 5d ago against content hash c51098a7b89c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

python-logging-monitoring-failures scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to python-logging-monitoring-failures — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.cursor/rules/python-logging-monitoring-failures.mdc · 444 lines

How it starts

The opening of the file, as written. The whole thing — 444 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Python Security Logging and Monitoring Failures Standards (OWASP A09:2021)

This rule enforces security best practices to prevent security logging and monitoring failures in Python applications, as defined in OWASP Top 10:2021-A09.

actions:

  • type: enforce conditions:

    Pattern 1: Missing logging in authentication functions

    • pattern: "def\s+(login|authenticate|signin|logout|signout).?:[^\n]?(?!.*logging\.(info|warning|error|critical))" message: "Authentication function without logging detected. Always log authentication events, especially failures, for security monitoring."

    Pattern 2: Missing logging in authorization functions

    • pattern: "def\s+(authorize|check_permission|has_permission|is_authorized|require_permission).?:[^\n]?(?!.*logging\.(info|warning|error|critical))" message: "Authorization function without logging detected. Always log authorization decisions, especially denials, for security monitoring."

    Pattern 3: Missing logging in security-sensitive operations

    • pattern: "def\s+(create_user|update_user|delete_user|reset_password|change_password).?:[^\n]?(?!.*logging\.(info|warning|error|critical))" message: "Security-sensitive user operation without logging detected. Always log security-sensitive operations for audit trails."

    Pattern 4: Missing logging in exception handlers

    • pattern: "except\s+[^:]+:[^\n]*?(?!.*logging\.(warning|error|critical|exception))" message: "Exception handler without logging detected. Always log exceptions, especially in security-sensitive code, for monitoring and debugging."

    Pattern 5: Logging sensitive data

    • pattern: "logging\.(debug|info|warning|error|critical)\([^)]*?(password|token|secret|key|credential|auth)" message: "Potential sensitive data logging detected. Avoid logging sensitive information like passwords, tokens, or keys."

    Pattern 6: Insufficient log level in security context

    • pattern: "logging\.debug\([^)]*?(auth|login|permission|security|attack|hack|exploit|vulnerability)" message: "Debug-level logging for security events detected. Use appropriate log levels (INFO, WARNING, ERROR) for security events."

    Pattern 7: Missing logging configuration

    • pattern: "import\s+logging(?!.*logging\.basicConfig|.*logging\.config)" message: "Logging import without configuration detected. Configure logging properly with appropriate handlers, formatters, and levels."

    Pattern 8: Insecure logging configuration

    • pattern: "logging\.basicConfig\([^)]?level\s=\s*logging\.DEBUG" message: "Debug-level logging configuration detected. Use appropriate log levels in production to avoid excessive logging."

    Pattern 9: Missing request/response logging in web frameworks

    • pattern: "@app\.route\(['"][^'"]+['"]|@api_view\(|class\s+\w+\(APIView\)|class\s+\w+\(View\)" message: "Web endpoint without request logging detected. Consider logging requests and responses for security monitoring."

    Pattern 10: Missing correlation IDs in logs

    • pattern: "logging\.(debug|info|warning|error|critical)\([^)]*?(?!.*request_id|.*correlation_id|.*trace_id)" message: "Logging without correlation ID detected. Include correlation IDs in logs to trace requests across systems."

    Pattern 11: Missing error handling for logging failures

    • pattern: "logging\.(debug|info|warning|error|critical)\([^)]*?\)" message: "Logging without error handling detected. Handle potential logging failures to ensure critical events are not missed."

Read the full file on GitHub · 444 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 444 lines · 3,895 tokens per session scan A c51098a7b89c

Subscribe to this mod's changes

python-logging-monitoring-failures is a cursor rule published in the GitHub repository abderrahimghazali/cursor-rules (2 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,895 tokens. A static security scan graded it A with 0 findings. It is 100% identical to python-logging-monitoring-failures, differing in 0 lines, and is treated as a copy.