RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Diff/ivangrynenko-cursorrules-agents ↔ ivangrynenko-cursorrules-cursor-rules-drupal-logging-failures

Comparison

A · AGENTS.md · ivangrynenko/cursorrulesB · Cursor rules · ivangrynenko/cursorrules
What each file covers, counted
DimensionSharedOnly in AOnly in BOverlap
Sections11175%
Commands000—
Section tags14020%

What each file covers

Sections

1 shared · 11 only in A · 7 only in B
  • − Cursor Agents Guide (Using Cursor Rules)
  • − How To Use With Cursor
  • − Installation Options
  • − Rule Bundles (Source of Truth)
  • − Core
  • − Web Stack
  • − Python
  • − JavaScript Security
  • − Tag-Based Selection
  • − Maintainer Checklist
  • − Updating Or Removing
  • + Drupal Security Logging and Monitoring Failures Standards (OWASP A09:2021)
  • + Rule Details
  • + Filters
  • + Enforcement Checks
  • + Suggestions
  • + Validation Checks
  • + Metadata
  •   References

Commands

neither file has any

Section tags

1 shared · 4 only in A · 0 only in B
  • − build
  • − git-pr
  • − do-not
  • − agent-behaviour
  •   security

Line diff

+89 added−111 removed16 unchanged12.6% identical
ivangrynenko/cursorrules · AGENTS.md
@@ −1 @@
1# Cursor Agents Guide (Using Cursor Rules)
 
 
 
 
 
2 
3This document explains how to use the rules in this repository with Cursor and serves as a single entry point that references the existing rule files. It avoids duplication by linking directly to the `.cursor/rules/*.mdc` sources.
4 
5If you installed these rules via the installer, a project‑local AGENTS.md can be generated that lists only the rules you chose. By default, the installer writes AGENTS.md if absent; it overwrites only when you pass `--yes`.
6 
7## How To Use With Cursor
8- Open your project in Cursor. Rules under `.cursor/rules` are discovered automatically by Cursor.
9- Keep this AGENTS.md handy as your quick index to the rule set.
10- For installation methods and advanced options, see `README.md`.
11 
12## Installation Options
13For full installation details and examples, see `README.md`.
14- Core rules only: `--core`
15- Web stack (includes core): `--web-stack` or `--ws`
16- Python (includes core): `--python`
17- JavaScript security (includes core): `--javascript`
18- All rules: `--all`
19- Tag-based selection: `--tags "<expression>"` or `--tag-preset <name>`
20- Ignore files control: `--ignore-files yes|no|ask`
21 
22Tag taxonomy is documented in `TAG_STANDARDS.md`.
 
 
23 
24## Rule Bundles (Source of Truth)
25Below are the rule bundles and their rule files. Each item links directly to the authoritative file under `.cursor/rules/`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26 
27### Core
28- [.cursor/rules/cursor-rules.mdc](.cursor/rules/cursor-rules.mdc)
29- [.cursor/rules/git-commit-standards.mdc](.cursor/rules/git-commit-standards.mdc)
30- [.cursor/rules/github-actions-standards.mdc](.cursor/rules/github-actions-standards.mdc)
31- [.cursor/rules/improve-cursorrules-efficiency.mdc](.cursor/rules/improve-cursorrules-efficiency.mdc)
32- [.cursor/rules/pull-request-changelist-instructions.mdc](.cursor/rules/pull-request-changelist-instructions.mdc)
33- [.cursor/rules/readme-maintenance-standards.mdc](.cursor/rules/readme-maintenance-standards.mdc)
34- [.cursor/rules/testing-guidelines.mdc](.cursor/rules/testing-guidelines.mdc)
35 - [.cursor/rules/confluence-editing-standards.mdc](.cursor/rules/confluence-editing-standards.mdc)
36 
37### Web Stack
38- [.cursor/rules/accessibility-standards.mdc](.cursor/rules/accessibility-standards.mdc)
39- [.cursor/rules/api-standards.mdc](.cursor/rules/api-standards.mdc)
40- [.cursor/rules/build-optimization.mdc](.cursor/rules/build-optimization.mdc)
41- [.cursor/rules/code-generation-standards.mdc](.cursor/rules/code-generation-standards.mdc)
42- [.cursor/rules/debugging-standards.mdc](.cursor/rules/debugging-standards.mdc)
43- [.cursor/rules/docker-compose-standards.mdc](.cursor/rules/docker-compose-standards.mdc)
44- [.cursor/rules/drupal-authentication-failures.mdc](.cursor/rules/drupal-authentication-failures.mdc)
45- [.cursor/rules/drupal-broken-access-control.mdc](.cursor/rules/drupal-broken-access-control.mdc)
46- [.cursor/rules/drupal-cryptographic-failures.mdc](.cursor/rules/drupal-cryptographic-failures.mdc)
47- [.cursor/rules/drupal-database-standards.mdc](.cursor/rules/drupal-database-standards.mdc)
48- [.cursor/rules/drupal-file-permissions.mdc](.cursor/rules/drupal-file-permissions.mdc)
49- [.cursor/rules/drupal-injection.mdc](.cursor/rules/drupal-injection.mdc)
50- [.cursor/rules/drupal-insecure-design.mdc](.cursor/rules/drupal-insecure-design.mdc)
51- [.cursor/rules/drupal-integrity-failures.mdc](.cursor/rules/drupal-integrity-failures.mdc)
52- [.cursor/rules/drupal-logging-failures.mdc](.cursor/rules/drupal-logging-failures.mdc)
53- [.cursor/rules/drupal-security-misconfiguration.mdc](.cursor/rules/drupal-security-misconfiguration.mdc)
54- [.cursor/rules/drupal-ssrf.mdc](.cursor/rules/drupal-ssrf.mdc)
55- [.cursor/rules/drupal-vulnerable-components.mdc](.cursor/rules/drupal-vulnerable-components.mdc)
56- [.cursor/rules/generic_bash_style.mdc](.cursor/rules/generic_bash_style.mdc)
57- [.cursor/rules/javascript-performance.mdc](.cursor/rules/javascript-performance.mdc)
58- [.cursor/rules/javascript-standards.mdc](.cursor/rules/javascript-standards.mdc)
59- [.cursor/rules/lagoon-docker-compose-standards.mdc](.cursor/rules/lagoon-docker-compose-standards.mdc)
60- [.cursor/rules/lagoon-yml-standards.mdc](.cursor/rules/lagoon-yml-standards.mdc)
61- [.cursor/rules/multi-agent-coordination.mdc](.cursor/rules/multi-agent-coordination.mdc)
62- [.cursor/rules/node-dependencies.mdc](.cursor/rules/node-dependencies.mdc)
63- [.cursor/rules/php-drupal-best-practices.mdc](.cursor/rules/php-drupal-best-practices.mdc)
64- [.cursor/rules/php-drupal-development-standards.mdc](.cursor/rules/php-drupal-development-standards.mdc)
65- [.cursor/rules/php-memory-optimisation.mdc](.cursor/rules/php-memory-optimisation.mdc)
66- [.cursor/rules/project-definition-template.mdc](.cursor/rules/project-definition-template.mdc)
67- [.cursor/rules/react-patterns.mdc](.cursor/rules/react-patterns.mdc)
68- [.cursor/rules/security-practices.mdc](.cursor/rules/security-practices.mdc)
69- [.cursor/rules/secret-detection.mdc](.cursor/rules/secret-detection.mdc)
70- [.cursor/rules/tailwind-standards.mdc](.cursor/rules/tailwind-standards.mdc)
71- [.cursor/rules/tests-documentation-maintenance.mdc](.cursor/rules/tests-documentation-maintenance.mdc)
72- [.cursor/rules/third-party-integration.mdc](.cursor/rules/third-party-integration.mdc)
73- [.cursor/rules/vortex-cicd-standards.mdc](.cursor/rules/vortex-cicd-standards.mdc)
74- [.cursor/rules/vortex-scaffold-standards.mdc](.cursor/rules/vortex-scaffold-standards.mdc)
75- [.cursor/rules/vue-best-practices.mdc](.cursor/rules/vue-best-practices.mdc)
76- [.cursor/rules/behat-steps.mdc](.cursor/rules/behat-steps.mdc)
77- [.cursor/rules/behat-ai-guide.mdc](.cursor/rules/behat-ai-guide.mdc)
78 
79### Python
80- [.cursor/rules/python-authentication-failures.mdc](.cursor/rules/python-authentication-failures.mdc)
81- [.cursor/rules/python-broken-access-control.mdc](.cursor/rules/python-broken-access-control.mdc)
82- [.cursor/rules/python-cryptographic-failures.mdc](.cursor/rules/python-cryptographic-failures.mdc)
83- [.cursor/rules/python-injection.mdc](.cursor/rules/python-injection.mdc)
84- [.cursor/rules/python-insecure-design.mdc](.cursor/rules/python-insecure-design.mdc)
85- [.cursor/rules/python-integrity-failures.mdc](.cursor/rules/python-integrity-failures.mdc)
86- [.cursor/rules/python-logging-monitoring-failures.mdc](.cursor/rules/python-logging-monitoring-failures.mdc)
87- [.cursor/rules/python-security-misconfiguration.mdc](.cursor/rules/python-security-misconfiguration.mdc)
88- [.cursor/rules/python-ssrf.mdc](.cursor/rules/python-ssrf.mdc)
89- [.cursor/rules/python-vulnerable-outdated-components.mdc](.cursor/rules/python-vulnerable-outdated-components.mdc)
90- [.cursor/rules/security-practices.mdc](.cursor/rules/security-practices.mdc)
91 
92### JavaScript Security
93- [.cursor/rules/javascript-broken-access-control.mdc](.cursor/rules/javascript-broken-access-control.mdc)
94- [.cursor/rules/javascript-cryptographic-failures.mdc](.cursor/rules/javascript-cryptographic-failures.mdc)
95- [.cursor/rules/javascript-identification-authentication-failures.mdc](.cursor/rules/javascript-identification-authentication-failures.mdc)
96- [.cursor/rules/javascript-injection.mdc](.cursor/rules/javascript-injection.mdc)
97- [.cursor/rules/javascript-insecure-design.mdc](.cursor/rules/javascript-insecure-design.mdc)
98- [.cursor/rules/javascript-security-logging-monitoring-failures.mdc](.cursor/rules/javascript-security-logging-monitoring-failures.mdc)
99- [.cursor/rules/javascript-security-misconfiguration.mdc](.cursor/rules/javascript-security-misconfiguration.mdc)
100- [.cursor/rules/javascript-server-side-request-forgery.mdc](.cursor/rules/javascript-server-side-request-forgery.mdc)
101- [.cursor/rules/javascript-software-data-integrity-failures.mdc](.cursor/rules/javascript-software-data-integrity-failures.mdc)
102- [.cursor/rules/javascript-vulnerable-outdated-components.mdc](.cursor/rules/javascript-vulnerable-outdated-components.mdc)
103 
104## Tag-Based Selection
105The installer supports tag expressions and presets. Examples:
106- `--tags "language:javascript category:security"`
107- `--tags "framework:react"`
108- `--tags "language:php standard:owasp-top10"`
109- `--tag-preset js-owasp`
110 
111See `TAG_STANDARDS.md` for the complete tag taxonomy and guidance.
 
 
 
 
 
112 
113## Maintainer Checklist
114- Before opening a pull request, prepend a new entry to `CHANGELOG.md` describing your changes (latest release first) and never delete prior history.
115- Ensure the summary in `CHANGELOG.md` matches the work being done and that `CURSOR_RULES_VERSION` reflects the next release number.
116- Record key implementation notes in this `AGENTS.md` only when they affect installer behaviour or rule coverage so the instructions stay current.
117- Regenerate project-local `AGENTS.md` files with `--yes` when you need to refresh them after significant rule or command updates.
 
 
 
 
 
118 
119## Updating Or Removing
120- To update, re-run the installer with your preferred options (it will copy over updated rules). See `README.md`.
121- To remove rules, delete files from `.cursor/rules` and remove any generated `.cursorignore` files if not needed.
122 
123## References
124- Project README: [README.md](README.md)
125- Tag standards: [TAG_STANDARDS.md](TAG_STANDARDS.md)
126- All rule sources: `.cursor/rules/*.mdc`
 
127 
 
ivangrynenko/cursorrules · .cursor/rules/drupal-logging-failures.mdc
@@ +1 @@
1---
2description: Detect and prevent security logging and monitoring failures in Drupal as defined in OWASP Top 10:2021-A09
3globs: *.php, *.install, *.module, *.inc, *.theme, *.yml
4alwaysApply: false
5---
6# Drupal Security Logging and Monitoring Failures Standards (OWASP A09:2021)
7 
8This rule enforces security best practices to prevent logging and monitoring failures in Drupal applications, as defined in OWASP Top 10:2021-A09.
9 
10## Rule Details
11 
12- **Name:** drupal_logging_failures
 
 
 
13 
14- **Description:** Detect and prevent security logging and monitoring failures in Drupal as defined in OWASP Top 10:2021-A09
 
 
 
 
 
 
 
 
15 
16## Filters
17- file extension pattern: `\\.(php|inc|module|install|theme|yml)$`
18- file path pattern: `.*`
19 
20## Enforcement Checks
21- Conditions:
22 - pattern `(delete|update|create|execute|grant|revoke|config|schema).*function[^}]*\\{(?![^}]*(log|watchdog|logger))` – Critical operations should include logging. Implement proper logging for security-relevant actions.
23 - Pattern 1: Missing critical event logging
24 - pattern `@include|@require|@eval|error_reporting\\(0\\)|ini_set\\(['\"](mdc:display_errors|log_errors)['\"],\\s*['\"]0['\"]\\)` – Avoid suppressing errors and warnings. Implement proper error handling and logging instead.
25 - Pattern 2: Suppressed error logging
26 - pattern `catch\\s*\\([^{]*\\)\\s*\\{(?![^}]*log|[^}]*watchdog|[^}]*logger)` – Exceptions should be properly logged, especially in security-critical sections.
27 - Pattern 3: Improper exception handling without logging
28 - pattern `dblog\\.settings\\.yml|syslog\\.settings\\.yml|logging\\.settings\\.yml` – Ensure logging is properly configured and not disabled. Verify log verbosity and retention policies.
29 - Pattern 4: Disabled watchdog
30 - pattern `(login|authenticate|logout|password).*function[^}]*\\{(?![^}]*(log|watchdog|logger))` – Authentication events should always be logged for security monitoring and auditing.
31 - Pattern 5: Missing authentication event logging
32 - pattern `AccessResult::(allowed|forbidden|neutral)\\([^)]*\\)(?![^;]*(log|watchdog|logger))` – Consider logging significant access control decisions, especially denials, for security monitoring.
33 - Pattern 6: Failure to log access control decisions
34 - pattern `(file_save|file_delete|file_move|file_copy)[^;]*;(?![^;]*(log|watchdog|logger))` – File operations should be logged, especially for security-sensitive files.
35 - Pattern 7: Missing logging in file operations
36 - pattern `(\\->log|watchdog)\\([^,)]*,[^,)]*\\)` – Log messages should include sufficient context and detail for effective security monitoring.
37 - Pattern 8: Insufficient detail in log messages
38 - pattern `\\$config->set\\([^;]*;(?![^;]*(log|watchdog|logger))` – Configuration changes should be logged to maintain an audit trail and detect unauthorized changes.
39 - Pattern 9: Failure to log configuration changes
40 - pattern `class\\s+[a-zA-Z0-9_]+Resource.+\\{[^}]*function\\s+[a-zA-Z0-9_]+\\([^{]*\\)\\s*\\{(?![^}]*(log|watchdog|logger))` – API endpoint access should be logged for security monitoring, especially for sensitive operations.
41 - Pattern 10: Missing logs for API access
42 
43## Suggestions
44- Guidance:
45**Drupal Security Logging & Monitoring Best Practices:**
 
 
 
 
 
 
46 
471. **Comprehensive Logging Implementation:**
48 - Use Drupal's Logger Factory service: `\Drupal::logger('module_name')`
49 - Implement proper log levels: emergency, alert, critical, error, warning, notice, info, debug
50 - Include context in log messages with relevant identifiers and information
51 - Log security-relevant events consistently across the application
52 - Structure log messages to facilitate automated analysis
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53 
542. **Critical Events to Log:**
55 - Authentication events (login attempts, failures, logouts)
56 - Access control decisions (particularly denials)
57 - All administrative actions
58 - Data modification operations on sensitive information
59 - Configuration and settings changes
60 - File operations (uploads, downloads of sensitive content)
61 - API access and usage
 
 
 
 
62 
633. **Logging Configuration:**
64 - Configure appropriate log retention periods based on security requirements
65 - Implement log rotation to maintain performance
66 - Consider using syslog for centralized logging
67 - Protect log files from unauthorized access and modification
68 - Configure appropriate verbosity for different environments
 
 
 
 
 
69 
704. **Monitoring Implementation:**
71 - Define security-relevant log patterns to monitor
72 - Implement log aggregation and analysis
73 - Set up alerts for suspicious activity patterns
74 - Establish response procedures for security events
75 - Consider integration with SIEM solutions
76 
775. **Error Handling:**
78 - Log exceptions with appropriate error levels
79 - Include stack traces in development but not production
80 - Implement custom error handlers that ensure proper logging
81 - Avoid suppressing errors that might indicate security issues
82 - Monitor for patterns in error logs that could indicate attacks
83 
84## Validation Checks
85- Conditions:
86 - pattern `\\\\Drupal::logger\\([^)]+\\)->\\w+\\(|\\$this->logger->\\w+\\(` – Using Drupal's logger service correctly.
87 - Check 1: Proper logger usage
88 - pattern `->\\w+\\([^,]+,\\s*[^,]+,\\s*\\[` – Including context information in log messages.
89 - Check 2: Context in log messages
90 - pattern `dblog\\.settings|syslog\\.settings|logging\\.yml` – Configuring logging appropriately.
91 - Check 3: Logging configuration
92 - pattern `catch[^{]*\\{[^}]*logger|catch[^{]*\\{[^}]*watchdog|catch[^{]*\\{[^}]*log` – Properly logging exceptions.
93 - Check 4: Exception logging
94 
95## Metadata
96- Priority: high
97- Version: 1.1
98- Tags: security, drupal, logging, monitoring, owasp, language:php, framework:drupal, category:security, subcategory:logging, standard:owasp-top10, risk:a09-logging-monitoring
99## References
100- https://owasp.org/Top10/A09_2021-Security_Logging_and_Monitoring_Failures/
101- https://www.drupal.org/docs/8/api/logging-api/overview
102- https://www.drupal.org/docs/develop/security-in-drupal/writing-secure-code-for-drupal
103- https://www.drupal.org/docs/8/modules/syslog
104 
105
@@ −1 +1 @@
1−# Cursor Agents Guide (Using Cursor Rules)
1+---
2+description: Detect and prevent security logging and monitoring failures in Drupal as defined in OWASP Top 10:2021-A09
3+globs: *.php, *.install, *.module, *.inc, *.theme, *.yml
4+alwaysApply: false
5+---
6+# Drupal Security Logging and Monitoring Failures Standards (OWASP A09:2021)
27  
3−This document explains how to use the rules in this repository with Cursor and serves as a single entry point that references the existing rule files. It avoids duplication by linking directly to the `.cursor/rules/*.mdc` sources.
8+This rule enforces security best practices to prevent logging and monitoring failures in Drupal applications, as defined in OWASP Top 10:2021-A09.
49  
5−If you installed these rules via the installer, a project‑local AGENTS.md can be generated that lists only the rules you chose. By default, the installer writes AGENTS.md if absent; it overwrites only when you pass `--yes`.
10+## Rule Details
611  
7−## How To Use With Cursor
8−- Open your project in Cursor. Rules under `.cursor/rules` are discovered automatically by Cursor.
9−- Keep this AGENTS.md handy as your quick index to the rule set.
10−- For installation methods and advanced options, see `README.md`.
12+- **Name:** drupal_logging_failures
1113  
12−## Installation Options
13−For full installation details and examples, see `README.md`.
14−- Core rules only: `--core`
15−- Web stack (includes core): `--web-stack` or `--ws`
16−- Python (includes core): `--python`
17−- JavaScript security (includes core): `--javascript`
18−- All rules: `--all`
19−- Tag-based selection: `--tags "<expression>"` or `--tag-preset <name>`
20−- Ignore files control: `--ignore-files yes|no|ask`
14+- **Description:** Detect and prevent security logging and monitoring failures in Drupal as defined in OWASP Top 10:2021-A09
2115  
22−Tag taxonomy is documented in `TAG_STANDARDS.md`.
16+## Filters
17+- file extension pattern: `\\.(php|inc|module|install|theme|yml)$`
18+- file path pattern: `.*`
2319  
24−## Rule Bundles (Source of Truth)
25−Below are the rule bundles and their rule files. Each item links directly to the authoritative file under `.cursor/rules/`.
20+## Enforcement Checks
21+- Conditions:
22+ - pattern `(delete|update|create|execute|grant|revoke|config|schema).*function[^}]*\\{(?![^}]*(log|watchdog|logger))` – Critical operations should include logging. Implement proper logging for security-relevant actions.
23+ - Pattern 1: Missing critical event logging
24+ - pattern `@include|@require|@eval|error_reporting\\(0\\)|ini_set\\(['\"](mdc:display_errors|log_errors)['\"],\\s*['\"]0['\"]\\)` – Avoid suppressing errors and warnings. Implement proper error handling and logging instead.
25+ - Pattern 2: Suppressed error logging
26+ - pattern `catch\\s*\\([^{]*\\)\\s*\\{(?![^}]*log|[^}]*watchdog|[^}]*logger)` – Exceptions should be properly logged, especially in security-critical sections.
27+ - Pattern 3: Improper exception handling without logging
28+ - pattern `dblog\\.settings\\.yml|syslog\\.settings\\.yml|logging\\.settings\\.yml` – Ensure logging is properly configured and not disabled. Verify log verbosity and retention policies.
29+ - Pattern 4: Disabled watchdog
30+ - pattern `(login|authenticate|logout|password).*function[^}]*\\{(?![^}]*(log|watchdog|logger))` – Authentication events should always be logged for security monitoring and auditing.
31+ - Pattern 5: Missing authentication event logging
32+ - pattern `AccessResult::(allowed|forbidden|neutral)\\([^)]*\\)(?![^;]*(log|watchdog|logger))` – Consider logging significant access control decisions, especially denials, for security monitoring.
33+ - Pattern 6: Failure to log access control decisions
34+ - pattern `(file_save|file_delete|file_move|file_copy)[^;]*;(?![^;]*(log|watchdog|logger))` – File operations should be logged, especially for security-sensitive files.
35+ - Pattern 7: Missing logging in file operations
36+ - pattern `(\\->log|watchdog)\\([^,)]*,[^,)]*\\)` – Log messages should include sufficient context and detail for effective security monitoring.
37+ - Pattern 8: Insufficient detail in log messages
38+ - pattern `\\$config->set\\([^;]*;(?![^;]*(log|watchdog|logger))` – Configuration changes should be logged to maintain an audit trail and detect unauthorized changes.
39+ - Pattern 9: Failure to log configuration changes
40+ - pattern `class\\s+[a-zA-Z0-9_]+Resource.+\\{[^}]*function\\s+[a-zA-Z0-9_]+\\([^{]*\\)\\s*\\{(?![^}]*(log|watchdog|logger))` – API endpoint access should be logged for security monitoring, especially for sensitive operations.
41+ - Pattern 10: Missing logs for API access
2642  
27−### Core
28−- [.cursor/rules/cursor-rules.mdc](.cursor/rules/cursor-rules.mdc)
29−- [.cursor/rules/git-commit-standards.mdc](.cursor/rules/git-commit-standards.mdc)
30−- [.cursor/rules/github-actions-standards.mdc](.cursor/rules/github-actions-standards.mdc)
31−- [.cursor/rules/improve-cursorrules-efficiency.mdc](.cursor/rules/improve-cursorrules-efficiency.mdc)
32−- [.cursor/rules/pull-request-changelist-instructions.mdc](.cursor/rules/pull-request-changelist-instructions.mdc)
33−- [.cursor/rules/readme-maintenance-standards.mdc](.cursor/rules/readme-maintenance-standards.mdc)
34−- [.cursor/rules/testing-guidelines.mdc](.cursor/rules/testing-guidelines.mdc)
35− - [.cursor/rules/confluence-editing-standards.mdc](.cursor/rules/confluence-editing-standards.mdc)
43+## Suggestions
44+- Guidance:
45+**Drupal Security Logging & Monitoring Best Practices:**
3646  
37−### Web Stack
38−- [.cursor/rules/accessibility-standards.mdc](.cursor/rules/accessibility-standards.mdc)
39−- [.cursor/rules/api-standards.mdc](.cursor/rules/api-standards.mdc)
40−- [.cursor/rules/build-optimization.mdc](.cursor/rules/build-optimization.mdc)
41−- [.cursor/rules/code-generation-standards.mdc](.cursor/rules/code-generation-standards.mdc)
42−- [.cursor/rules/debugging-standards.mdc](.cursor/rules/debugging-standards.mdc)
43−- [.cursor/rules/docker-compose-standards.mdc](.cursor/rules/docker-compose-standards.mdc)
44−- [.cursor/rules/drupal-authentication-failures.mdc](.cursor/rules/drupal-authentication-failures.mdc)
45−- [.cursor/rules/drupal-broken-access-control.mdc](.cursor/rules/drupal-broken-access-control.mdc)
46−- [.cursor/rules/drupal-cryptographic-failures.mdc](.cursor/rules/drupal-cryptographic-failures.mdc)
47−- [.cursor/rules/drupal-database-standards.mdc](.cursor/rules/drupal-database-standards.mdc)
48−- [.cursor/rules/drupal-file-permissions.mdc](.cursor/rules/drupal-file-permissions.mdc)
49−- [.cursor/rules/drupal-injection.mdc](.cursor/rules/drupal-injection.mdc)
50−- [.cursor/rules/drupal-insecure-design.mdc](.cursor/rules/drupal-insecure-design.mdc)
51−- [.cursor/rules/drupal-integrity-failures.mdc](.cursor/rules/drupal-integrity-failures.mdc)
52−- [.cursor/rules/drupal-logging-failures.mdc](.cursor/rules/drupal-logging-failures.mdc)
53−- [.cursor/rules/drupal-security-misconfiguration.mdc](.cursor/rules/drupal-security-misconfiguration.mdc)
54−- [.cursor/rules/drupal-ssrf.mdc](.cursor/rules/drupal-ssrf.mdc)
55−- [.cursor/rules/drupal-vulnerable-components.mdc](.cursor/rules/drupal-vulnerable-components.mdc)
56−- [.cursor/rules/generic_bash_style.mdc](.cursor/rules/generic_bash_style.mdc)
57−- [.cursor/rules/javascript-performance.mdc](.cursor/rules/javascript-performance.mdc)
58−- [.cursor/rules/javascript-standards.mdc](.cursor/rules/javascript-standards.mdc)
59−- [.cursor/rules/lagoon-docker-compose-standards.mdc](.cursor/rules/lagoon-docker-compose-standards.mdc)
60−- [.cursor/rules/lagoon-yml-standards.mdc](.cursor/rules/lagoon-yml-standards.mdc)
61−- [.cursor/rules/multi-agent-coordination.mdc](.cursor/rules/multi-agent-coordination.mdc)
62−- [.cursor/rules/node-dependencies.mdc](.cursor/rules/node-dependencies.mdc)
63−- [.cursor/rules/php-drupal-best-practices.mdc](.cursor/rules/php-drupal-best-practices.mdc)
64−- [.cursor/rules/php-drupal-development-standards.mdc](.cursor/rules/php-drupal-development-standards.mdc)
65−- [.cursor/rules/php-memory-optimisation.mdc](.cursor/rules/php-memory-optimisation.mdc)
66−- [.cursor/rules/project-definition-template.mdc](.cursor/rules/project-definition-template.mdc)
67−- [.cursor/rules/react-patterns.mdc](.cursor/rules/react-patterns.mdc)
68−- [.cursor/rules/security-practices.mdc](.cursor/rules/security-practices.mdc)
69−- [.cursor/rules/secret-detection.mdc](.cursor/rules/secret-detection.mdc)
70−- [.cursor/rules/tailwind-standards.mdc](.cursor/rules/tailwind-standards.mdc)
71−- [.cursor/rules/tests-documentation-maintenance.mdc](.cursor/rules/tests-documentation-maintenance.mdc)
72−- [.cursor/rules/third-party-integration.mdc](.cursor/rules/third-party-integration.mdc)
73−- [.cursor/rules/vortex-cicd-standards.mdc](.cursor/rules/vortex-cicd-standards.mdc)
74−- [.cursor/rules/vortex-scaffold-standards.mdc](.cursor/rules/vortex-scaffold-standards.mdc)
75−- [.cursor/rules/vue-best-practices.mdc](.cursor/rules/vue-best-practices.mdc)
76−- [.cursor/rules/behat-steps.mdc](.cursor/rules/behat-steps.mdc)
77−- [.cursor/rules/behat-ai-guide.mdc](.cursor/rules/behat-ai-guide.mdc)
47+1. **Comprehensive Logging Implementation:**
48+ - Use Drupal's Logger Factory service: `\Drupal::logger('module_name')`
49+ - Implement proper log levels: emergency, alert, critical, error, warning, notice, info, debug
50+ - Include context in log messages with relevant identifiers and information
51+ - Log security-relevant events consistently across the application
52+ - Structure log messages to facilitate automated analysis
7853  
79−### Python
80−- [.cursor/rules/python-authentication-failures.mdc](.cursor/rules/python-authentication-failures.mdc)
81−- [.cursor/rules/python-broken-access-control.mdc](.cursor/rules/python-broken-access-control.mdc)
82−- [.cursor/rules/python-cryptographic-failures.mdc](.cursor/rules/python-cryptographic-failures.mdc)
83−- [.cursor/rules/python-injection.mdc](.cursor/rules/python-injection.mdc)
84−- [.cursor/rules/python-insecure-design.mdc](.cursor/rules/python-insecure-design.mdc)
85−- [.cursor/rules/python-integrity-failures.mdc](.cursor/rules/python-integrity-failures.mdc)
86−- [.cursor/rules/python-logging-monitoring-failures.mdc](.cursor/rules/python-logging-monitoring-failures.mdc)
87−- [.cursor/rules/python-security-misconfiguration.mdc](.cursor/rules/python-security-misconfiguration.mdc)
88−- [.cursor/rules/python-ssrf.mdc](.cursor/rules/python-ssrf.mdc)
89−- [.cursor/rules/python-vulnerable-outdated-components.mdc](.cursor/rules/python-vulnerable-outdated-components.mdc)
90−- [.cursor/rules/security-practices.mdc](.cursor/rules/security-practices.mdc)
54+2. **Critical Events to Log:**
55+ - Authentication events (login attempts, failures, logouts)
56+ - Access control decisions (particularly denials)
57+ - All administrative actions
58+ - Data modification operations on sensitive information
59+ - Configuration and settings changes
60+ - File operations (uploads, downloads of sensitive content)
61+ - API access and usage
9162  
92−### JavaScript Security
93−- [.cursor/rules/javascript-broken-access-control.mdc](.cursor/rules/javascript-broken-access-control.mdc)
94−- [.cursor/rules/javascript-cryptographic-failures.mdc](.cursor/rules/javascript-cryptographic-failures.mdc)
95−- [.cursor/rules/javascript-identification-authentication-failures.mdc](.cursor/rules/javascript-identification-authentication-failures.mdc)
96−- [.cursor/rules/javascript-injection.mdc](.cursor/rules/javascript-injection.mdc)
97−- [.cursor/rules/javascript-insecure-design.mdc](.cursor/rules/javascript-insecure-design.mdc)
98−- [.cursor/rules/javascript-security-logging-monitoring-failures.mdc](.cursor/rules/javascript-security-logging-monitoring-failures.mdc)
99−- [.cursor/rules/javascript-security-misconfiguration.mdc](.cursor/rules/javascript-security-misconfiguration.mdc)
100−- [.cursor/rules/javascript-server-side-request-forgery.mdc](.cursor/rules/javascript-server-side-request-forgery.mdc)
101−- [.cursor/rules/javascript-software-data-integrity-failures.mdc](.cursor/rules/javascript-software-data-integrity-failures.mdc)
102−- [.cursor/rules/javascript-vulnerable-outdated-components.mdc](.cursor/rules/javascript-vulnerable-outdated-components.mdc)
63+3. **Logging Configuration:**
64+ - Configure appropriate log retention periods based on security requirements
65+ - Implement log rotation to maintain performance
66+ - Consider using syslog for centralized logging
67+ - Protect log files from unauthorized access and modification
68+ - Configure appropriate verbosity for different environments
10369  
104−## Tag-Based Selection
105−The installer supports tag expressions and presets. Examples:
106−- `--tags "language:javascript category:security"`
107−- `--tags "framework:react"`
108−- `--tags "language:php standard:owasp-top10"`
109−- `--tag-preset js-owasp`
70+4. **Monitoring Implementation:**
71+ - Define security-relevant log patterns to monitor
72+ - Implement log aggregation and analysis
73+ - Set up alerts for suspicious activity patterns
74+ - Establish response procedures for security events
75+ - Consider integration with SIEM solutions
11076  
111−See `TAG_STANDARDS.md` for the complete tag taxonomy and guidance.
77+5. **Error Handling:**
78+ - Log exceptions with appropriate error levels
79+ - Include stack traces in development but not production
80+ - Implement custom error handlers that ensure proper logging
81+ - Avoid suppressing errors that might indicate security issues
82+ - Monitor for patterns in error logs that could indicate attacks
11283  
113−## Maintainer Checklist
114−- Before opening a pull request, prepend a new entry to `CHANGELOG.md` describing your changes (latest release first) and never delete prior history.
115−- Ensure the summary in `CHANGELOG.md` matches the work being done and that `CURSOR_RULES_VERSION` reflects the next release number.
116−- Record key implementation notes in this `AGENTS.md` only when they affect installer behaviour or rule coverage so the instructions stay current.
117−- Regenerate project-local `AGENTS.md` files with `--yes` when you need to refresh them after significant rule or command updates.
84+## Validation Checks
85+- Conditions:
86+ - pattern `\\\\Drupal::logger\\([^)]+\\)->\\w+\\(|\\$this->logger->\\w+\\(` – Using Drupal's logger service correctly.
87+ - Check 1: Proper logger usage
88+ - pattern `->\\w+\\([^,]+,\\s*[^,]+,\\s*\\[` – Including context information in log messages.
89+ - Check 2: Context in log messages
90+ - pattern `dblog\\.settings|syslog\\.settings|logging\\.yml` – Configuring logging appropriately.
91+ - Check 3: Logging configuration
92+ - pattern `catch[^{]*\\{[^}]*logger|catch[^{]*\\{[^}]*watchdog|catch[^{]*\\{[^}]*log` – Properly logging exceptions.
93+ - Check 4: Exception logging
11894  
119−## Updating Or Removing
120−- To update, re-run the installer with your preferred options (it will copy over updated rules). See `README.md`.
121−- To remove rules, delete files from `.cursor/rules` and remove any generated `.cursorignore` files if not needed.
122− 
95+## Metadata
96+- Priority: high
97+- Version: 1.1
98+- Tags: security, drupal, logging, monitoring, owasp, language:php, framework:drupal, category:security, subcategory:logging, standard:owasp-top10, risk:a09-logging-monitoring
12399 ## References
124−- Project README: [README.md](README.md)
125−- Tag standards: [TAG_STANDARDS.md](TAG_STANDARDS.md)
126−- All rule sources: `.cursor/rules/*.mdc`
100+- https://owasp.org/Top10/A09_2021-Security_Logging_and_Monitoring_Failures/
101+- https://www.drupal.org/docs/8/api/logging-api/overview
102+- https://www.drupal.org/docs/develop/security-in-drupal/writing-secure-code-for-drupal
103+- https://www.drupal.org/docs/8/modules/syslog
127104  
105+
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack