javascript-security-logging-monitoring-failures

javascript-security-logging-monitoring-failures is a cursor rule for Cursor from abderrahimghazali/cursor-rules. It costs 6,053 tokens per session, scanned A, a copy of javascript-security-logging-monitoring-failures, MIT.

A set of checks for JavaScript and TypeScript code based on OWASP A09, a security category covering missing or weak logging and monitoring.

In plain words
What is it for?
Use it when reviewing JavaScript or TypeScript files to enforce security-focused logging and require sensitive data to be redacted or masked.
Why use it?
It helps reveal errors that are caught without being recorded, authentication activity that is not logged, and sensitive values such as passwords or tokens being written to logs.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is - ./logstash/pipeline:/usr/share/logstash/pipeline.

Good fit Use it when reviewing JavaScript or TypeScript files to enforce security-focused logging…

Compare 6 cursor rules from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

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

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 javascript-security-logging-monitoring-failures

README.md
[![agentmods](https://agentmods.dev/badge/rules/abderrahimghazali/cursor-rules/javascript-security-logging-monitoring-failures.svg)](https://agentmods.dev/rules/abderrahimghazali/cursor-rules/javascript-security-logging-monitoring-failures)
Your own site
<a href="https://agentmods.dev/rules/abderrahimghazali/cursor-rules/javascript-security-logging-monitoring-failures"><img src="https://agentmods.dev/badge/rules/abderrahimghazali/cursor-rules/javascript-security-logging-monitoring-failures.svg" alt="Measured on agentmods" height="20"></a>
Per session 6,053 This file is loaded in full into every session.
When invoked 6,053 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.06053 $0.06053
Opus 5 $0.03027 $0.03027
Sonnet 5 $0.01211 $0.01211
Haiku 4.5 $0.00605 $0.00605

Measured 6d ago against content hash 0ff60ffa6eb7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

javascript-security-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 6d 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 javascript-security-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/javascript-security-logging-monitoring-failures.mdc · 802 lines

How it starts

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


description: Detect and prevent security logging and monitoring failures in JavaScript applications as defined in OWASP Top 10:2021-A09 globs: /.js, **/.jsx, /.ts, **/.tsx, !/node_modules/, !/dist/, !/build/, !/coverage/

JavaScript Security Logging and Monitoring Failures (OWASP A09:2021)

actions:

  • type: enforce conditions:

    Pattern 1: Missing Error Logging

    • pattern: "(?:try\s*{[^}]}\scatch\s*\([^)]\)\s{[^}]})(?![^;{](?:console\.(?:error|warn|log)|logger?\.(?:error|warn|log)|captureException))" message: "Error caught without proper logging. Implement structured error logging for security events."

    Pattern 2: Sensitive Data in Logs

    • pattern: "console\.(?:log|warn|error|info|debug)\s*\([^)](?:password|token|secret|key|credential|auth|jwt|session|cookie)" negative_pattern: "\\\|redact|mask|sanitize" message: "Potential sensitive data in logs. Ensure sensitive information is redacted before logging."

    Pattern 3: Missing Authentication Logging

    • pattern: "(?:login|signin|authenticate|auth)\s*\([^)]\)\s{[^}]}" negative_pattern: "(?:log|audit|record|track)\s\(" message: "Authentication function without logging. Log authentication attempts, successes, and failures."

    Pattern 4: Missing Authorization Logging

    • pattern: "(?:authorize|checkPermission|hasAccess|isAuthorized|can)\s*\([^)]\)\s{[^}]}" negative_pattern: "(?:log|audit|record|track)\s\(" message: "Authorization check without logging. Log access control decisions, especially denials."

    Pattern 5: Insufficient Error Detail

    • pattern: "(?:console\.error|logger?\.error)\s*\([^)](?:error|err|exception)\s\)" negative_pattern: "(?:error\.(?:message|stack|code|name)|JSON\.stringify\(error\)|serialize)" message: "Error logging with insufficient detail. Include error type, message, stack trace, and context."

    Pattern 6: Missing Security Event Logging

    • pattern: "(?:bruteForce|rateLimit|block|blacklist|suspicious|anomaly|threat|attack|intrusion|malicious)" negative_pattern: "(?:log|audit|record|track|monitor|alert|notify)" message: "Security event detection without logging. Implement logging for all security-relevant events."

    Pattern 7: Inconsistent Log Formats

    • pattern: "console\.(?:log|warn|error|info|debug)\s*\(" negative_pattern: "JSON\.stringify|structured|format" message: "Inconsistent log format. Use structured logging with consistent formats for easier analysis."

    Pattern 8: Missing Log Correlation ID

    • pattern: "(?:api|http|fetch|axios|request)\s*\([^)]*\)" negative_pattern: "(?:correlationId|requestId|traceId|spanId|context)" message: "API request without correlation ID. Include correlation IDs in logs for request tracing."

    Pattern 9: Missing High-Value Transaction Logging

    • pattern: "(?:payment|transaction|order|purchase|transfer|withdraw|deposit)\s*\([^)]*\)" negative_pattern: "(?:log|audit|record|track)" message: "High-value transaction without audit logging. Implement comprehensive logging for all transactions."

    Pattern 10: Client-Side Logging Issues

    • pattern: "(?:window\.onerror|window\.addEventListener\s*\(\s*['"]error['"])" negative_pattern: "(?:send|report|log|capture|track)" message: "Client-side error handler without reporting. Implement error reporting to backend services."

    Pattern 11: Missing Log Levels

    • pattern: "console\.log\s*\(" negative_pattern: "logger?\.(?:error|warn|info|debug|trace)" message: "Using console.log without proper log levels. Implement a logging library with appropriate log levels."

Read the full file on GitHub · 802 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. 6d ago First seen · 802 lines · 6,053 tokens per session scan A 0ff60ffa6eb7

Subscribe to this mod's changes

javascript-security-logging-monitoring-failures is a cursor rule published in the GitHub repository abderrahimghazali/cursor-rules (2 stars, last pushed 1y ago), licensed MIT. It adds 6,053 tokens to every session, about $0.0303 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to javascript-security-logging-monitoring-failures, differing in 0 lines, and is treated as a copy.