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.
npx agentmods add rules/abderrahimghazali/cursor-rules/drupal-cryptographic-failuresgit clone --depth 1 https://github.com/abderrahimghazali/cursor-rulesWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.01423 |
| Opus 5 | $0.00000 | $0.00711 |
| Sonnet 5 | $0.00000 | $0.00285 |
| Haiku 4.5 | $0.00000 | $0.00142 |
Grade A, and why
drupal-cryptographic-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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Drupal Cryptographic Failures Security Standards (OWASP A02:2021)
This rule enforces security best practices to prevent cryptographic failures in Drupal applications, as defined in OWASP Top 10:2021-A02.
actions:
-
type: enforce conditions:
Pattern 1: Use of weak hash algorithms
- pattern: "(md5|sha1)\([^)]*\)" message: "Weak hash algorithm detected. Use password_hash() for passwords or hash('sha256'/'sha512') for other data."
Pattern 2: Hardcoded credentials or keys
- pattern: "(password|key|token|secret|credentials|pwd)\s*=\s*['"][^'"]+['"]" message: "Hardcoded credentials or sensitive keys detected. Use Drupal's State API, key module, or environment variables."
Pattern 3: Plaintext password storage
- pattern: "\$user->setPassword\((?!password_hash|\$hash)[^)]+\)" message: "Never store plaintext passwords. Drupal handles password hashing internally."
Pattern 4: Improper file encryption
- pattern: "file_(get|put)_contents\([^,]+,\s*[^,]+\)" message: "Consider encrypting sensitive file contents using Drupal's encryption API or PHP's openssl functions."
Pattern 5: Unprotected sensitive data in settings
- pattern: "\$settings\['"[^]]+\]\s*=\s*['"][^"']+['"]" message: "Sensitive data in settings.php should be moved to environment variables or settings.local.php."
Pattern 6: Insecure random number generation
- pattern: "(rand|mt_rand|array_rand)\(" message: "Insecure random number generation. Use random_bytes() or random_int() for cryptographic purposes."
Pattern 7: Missing HTTPS enforcement
- pattern: "'#cache'|'cache'" message: "Ensure HTTPS is enforced for cached pages containing sensitive information."
Pattern 8: Missing encryption for content with private information
- pattern: "(->set|->get)\('field_[^'](?:password|ssn|credit|card|secret|key|token|credentials|pwd)[^']'\)" message: "Consider using field encryption for sensitive data fields."
Pattern 9: Custom session handling without proper security
- pattern: "session_(start|regenerate_id)" message: "Avoid custom session handling. Use Drupal's session management services."
Pattern 10: API tokens without expiration or rotation
- pattern: "\$token\s*=\s*.*?\$[^;]+;(?![^;]*expir|[^;]*valid)" message: "API tokens should include expiration time or rotation mechanism."
-
type: suggest message: | Drupal Cryptographic Security Best Practices:
-
Secure Data Storage:
- Use Drupal's Key module for storing encryption keys
- Store sensitive configuration in environment variables or settings.local.php
- Use Drupal's State API for non-configuration sensitive data
- Never store plaintext sensitive information in the database
-
Encryption and Hashing:
- Use Drupal's password hashing system, which uses password_hash() internally
- For non-password data hashing, use SHA-256 or SHA-512
- Use the Encrypt module or PHP's openssl_encrypt() with proper algorithms (AES-256-GCM)
- Always use proper salting techniques
-
Communication Security:
- Enforce HTTPS site-wide using settings.php configuration
- Use secure cookies (secure, HttpOnly, SameSite)
- Implement proper Content-Security-Policy headers
- Use TLS 1.2+ for all connections
-
API Security:
- Use OAuth or JWT with proper signature verification
- Implement token expiration and rotation
- Use HMAC for API request signatures when appropriate
- Never expose internal encryption keys through APIs
-
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.
- 2d ago First seen · 134 lines · 1,423 tokens per session scan A d1ee942cd032
drupal-cryptographic-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 1,423 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
creating-cursor-rules
Meta-rule for creating effective Cursor IDE rules with best practices, patterns, and examples.
creating-skills
Meta-guide for creating effective Claude Code skills with proper structure, CSO optimization, and real examples.
cursorrules
You are a disciplined senior engineer working with someone who may be a domain expert, not a programmer. Build it correctly and safely, not just fast.
cursorrules
Cursor rule "cursorrules" from BlueBirdBack/godot-cursorrules, covering godot 4.4 game development .cursorrules, core development guidelines, code style, naming conventions and scene organization.
new_feature
You are an expert Product Owner and Technical Lead focused on helping users define and plan new features through collaborative discovery and structured documentation.
new_project
You are an expert Product Owner focused on helping users define new software projects through collaborative vision creation.