linea-monorepo / security-logging-guidelines
Cursor rule126 starsChanged 3 months agoApache-2.0View on GitHub
Security-Sensitive Information Logging Prevention - Rules
- Reads credentials
We split this RULES.md into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Use obviously fake/placeholder credentials in all tests, fixtures, .env.template files, and documentation.
- Very specific: line 30
Ensure .env files are in .gitignore and template files reference placeholders only.
- Distinctive: line 44
When a violation is detected, block the change with a clear explanation and suggest a safe alternative.
≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Security Logging Rules
Refer to EXAMPLES.md for detailed examples of what to do and what not to do.
MUST NOT
- Log passwords, API keys, auth tokens, session IDs, private keys (cryptographic/SSH/PGP), JWT tokens, AWS keys, or GitHub tokens.
- Log URLs containing sensitive query parameters (
token,apiKey,secret,password,auth) without sanitization. - Log environment variables wholesale or config objects without redacting sensitive fields.
- Log RPC URLs with embedded tokens or database connection strings containing credentials.
- Log private keys or raw signatures during transaction signing or message signing.
- Expose secrets in error messages, stack traces, exception propagation, metrics labels, trace data, or health-check endpoints.
- Hardcode secrets in source code, operation scripts, configuration files, documentation, or code comments.
- Include real credentials in tests, fixtures, mock servers, Postman collections, or example code.
- Log request/response bodies or headers that contain auth tokens.
MUST
- Sanitize URLs by redacting sensitive query parameters before any logging.
- Redact sensitive fields when logging objects or configuration; override
toString()on config classes (Kotlin/Java) to redact secrets. - Configure structured logging frameworks (Log4j/SLF4J/etc.) to filter sensitive data.
- Load secrets from environment variables or secure vaults exclusively.
- Use obviously fake/placeholder credentials in all tests, fixtures,
.env.templatefiles, and documentation. - Ensure
.envfiles are in.gitignoreand template files reference placeholders only. - Sanitize error details before propagation - log
error.messageanderror.code, not full config or request objects.
MAY log
- Log levels, categories, timestamps, and request IDs.
- Endpoint paths without query parameters.
- Error types and status codes.
- Configuration keys (not values); indicate presence with
[CONFIGURED]/[NOT SET]. - Wallet addresses and transaction hashes (never private keys).
- Partial identifiers (last 4 characters).
Enforcement
When a violation is detected, block the change with a clear explanation and suggest a safe alternative. Always reference EXAMPLES.md for correct patterns.
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 3,978 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- contracts/AGENTS.mdAGENTS.md
- coordinator/AGENTS.mdAGENTS.md
- e2e/AGENTS.mdAGENTS.md
- maru/AGENTS.mdAGENTS.md
- postman/AGENTS.mdAGENTS.md
- prover/AGENTS.mdAGENTS.md
- prover-ray/AGENTS.mdAGENTS.md
- tracer/AGENTS.mdAGENTS.md
- transaction-exclusion-api/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/documentation.mdcCursor rule
- .cursor/rules/security-logging-guidelines/EXAMPLES.mdCursor rule
- .cursor/rules/smart-contract-guidelines/RULE.mdCursor rule
- .cursor/rules/versioning-guidelines/EXAMPLES.mdCursor rule
- .cursor/rules/versioning-guidelines/RULES.mdCursor rule
- developing-smart-contractsSkill
- linea-dependency-maintenanceSkill
- squash-bugbotSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

