| Dimension | Shared | Only in A | Only in B | Overlap |
|---|---|---|---|---|
| Sections | 1 | 11 | 7 | 5% |
| Commands | 0 | 0 | 0 | — |
| Section tags | 1 | 4 | 0 | 20% |
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 Insecure Design Security Standards (OWASP A04:2021)
- + Rule Details
- + Filters
- + Enforcement Checks
- + Suggestions
- + Validation Checks
- + Metadata
- References
Commands
neither file has anySection tags
1 shared · 4 only in A · 0 only in B- − build
- − git-pr
- − do-not
- − agent-behaviour
- security
Line diff
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-insecure-design.mdc
@@ +1 @@
1---
2description: Detect and prevent insecure design patterns in Drupal as defined in OWASP Top 10:2021-A04
3globs: *.php, *.install, *.module, *.inc, *.theme, *.yml, *.info
4alwaysApply: false
5---
6# Drupal Insecure Design Security Standards (OWASP A04:2021)
7
8This rule enforces security best practices to prevent insecure design vulnerabilities in Drupal applications, as defined in OWASP Top 10:2021-A04.
9
10## Rule Details
11
12- **Name:** drupal_insecure_design
13
14- **Description:** Detect and prevent insecure design patterns in Drupal as defined in OWASP Top 10:2021-A04
15
16## Filters
17- file extension pattern: `\\.(php|inc|module|install|theme|info\\.yml)$`
18- file path pattern: `(modules|themes|profiles)/custom`
19
20## Enforcement Checks
21- Conditions:
22 - pattern `\\$permissions\\[['\"][^'\"]+['\"]\\]\\s*=\\s*array\\((?![^)]*(administer|manage|edit|delete)[^)]*(content|configuration|users)).*?\\);` – Permissions should follow Drupal naming patterns (verb + object) and be specific. Avoid overly broad permissions.
23 - Pattern 1: Insecure permission design
24 - pattern `if\\s*\\([^\\)]*===?\\s*['\"][a-zA-Z0-9_]+['\"]\\s*\\)` – Consider moving business logic rules to configuration to allow for proper adjustment without code changes.
25 - Pattern 2: Hard-coded business logic values
26 - pattern `preg_replace|str_replace|strip_tags` – Avoid ad hoc sanitization. Use Drupal's built-in sanitization tools: t(), Xss::filter(), etc.
27 - Pattern 3: Ad hoc input sanitization
28 - pattern `class\\s+[a-zA-Z0-9_]+Controller.+\\{[^}]*->query\\(` – Follow separation of concerns. Move database logic to services or repositories, not in controllers.
29 - Pattern 4: Database logic in controllers
30 - pattern `function\\s+[a-zA-Z0-9_]+_entity_access\\([^)]*\\)\\s*\\{[^}]*return\\s+AccessResult::allowed\\(\\);` – Avoid unconditional access grants. Implement proper conditional checks based on roles, permissions, or entity ownership.
31 - Pattern 5: Weak entity access policy
32 - pattern `session_start|session_set_cookie_params` – Avoid custom session management. Use Drupal's session handling system and services.
33 - Pattern 6: Custom session management
34 - pattern `(?:\\\\Drupal::[a-zA-Z_]+\\(\\).*){3,}` – Excessive static service calls indicate poor dependency injection. Use proper service injection.
35 - Pattern 7: Excessive global state dependency
36 - pattern `password_verify\\(|password_hash\\(` – Avoid custom authentication. Use Drupal's built-in authentication system and services.
37 - Pattern 8: Custom user authentication
38 - pattern `function\\s+[a-zA-Z0-9_]+_schema\\(\\)[^{]*\\{[^}]*return\\s+\\$schema;(?![^}]*validate_utf8|[^}]*'not null')` – Database schemas should enforce data integrity with proper constraints (NOT NULL, length, etc.).
39 - Pattern 9: Missing schema definitions
40 - pattern `\\$config\\[['\"](mdc:?!secure_|security_|private_)[^'\"]+['\"]\\]\\s*=\\s*(?:FALSE|0|'0'|\"0\");` – Security-related configuration should default to secure settings (opt-in for potentially insecure features).
41 - Pattern 10: Insecure defaults
42
43## Suggestions
44- Guidance:
45**Drupal Secure Design Best Practices:**
46
471. **Secure Architecture Principles:**
48 - Follow the principle of least privilege for all user roles and permissions
49 - Implement defense in depth with multiple security layers
50 - Use Drupal's entity/field API for structured data instead of custom tables
51 - Employ service-oriented architecture with proper dependency injection
52 - Follow Drupal coding standards to leverage community security expertise
53
542. **Permission System Design:**
55 - Design granular permissions following the verb+object pattern
56 - Avoid creating omnipotent permissions that grant excessive access
57 - Use context-aware access systems like Entity Access or Node Grants
58 - Consider record-based and field-based access for better control
59 - Document permission architecture and security implications
60
613. **Module Architecture:**
62 - Separate concerns into appropriate services
63 - Use hooks judiciously and document security implications
64 - Implement proper validation and sanitization layers
65 - Design APIs with security in mind from the start
66 - Provide secure default configurations
67
684. **Data Modeling Security:**
69 - Implement appropriate validation constraints on entity fields
70 - Design schema definitions with integrity constraints
71 - Use appropriate field types for sensitive data
72 - Implement field-level access control when needed
73 - Consider encryption for sensitive stored data
74
755. **Error Handling and Logging:**
76 - Design contextual error messages (detailed for admins, general for users)
77 - Implement appropriate logging for security events
78 - Avoid exposing sensitive data in error messages
79 - Design fault-tolerant systems that fail securely
80 - Include appropriate transaction management
81
82## Validation Checks
83- Conditions:
84 - pattern `protected\\s+\\$[a-zA-Z0-9_]+;[^}]*public\\s+function\\s+__construct\\([^\\)]*\\)` – Using proper dependency injection pattern.
85 - Check 1: Proper dependency injection
86 - pattern `config\\/schema\\/[a-zA-Z0-9_]+\\.schema\\.yml` – Providing configuration schema for validation.
87 - Check 2: Configuration schema usage
88 - pattern `\\$permissions\\[['\"][a-z\\s]+[a-z0-9\\s]+['\"]\\]\\s*=\\s*\\[` – Following permission naming conventions.
89 - Check 3: Proper permission definition
90 - pattern `@EntityAccessControl\\(|class\\s+[a-zA-Z0-9_]+AccessControlHandler\\s+extends\\s+` – Using dedicated access control handlers for entities.
91 - Check 4: Entity access handlers
92
93## Metadata
94- Priority: high
95- Version: 1.1
96- Tags: security, drupal, design, architecture, owasp, language:php, framework:drupal, category:security, subcategory:design, standard:owasp-top10, risk:a04-insecure-design
97## References
98- https://owasp.org/Top10/A04_2021-Insecure_Design/
99- https://www.drupal.org/docs/develop/security-in-drupal
100- https://www.drupal.org/docs/8/api/entity-api/access-control-for-entities
101- https://www.drupal.org/docs/8/api/configuration-api/configuration-schemametadata
102
103
@@ −1 +1 @@
1−# Cursor Agents Guide (Using Cursor Rules)
1+---
2+description: Detect and prevent insecure design patterns in Drupal as defined in OWASP Top 10:2021-A04
3+globs: *.php, *.install, *.module, *.inc, *.theme, *.yml, *.info
4+alwaysApply: false
5+---
6+# Drupal Insecure Design Security Standards (OWASP A04: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 insecure design vulnerabilities in Drupal applications, as defined in OWASP Top 10:2021-A04.
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_insecure_design
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 insecure design patterns in Drupal as defined in OWASP Top 10:2021-A04
2115
22−Tag taxonomy is documented in `TAG_STANDARDS.md`.
16+## Filters
17+- file extension pattern: `\\.(php|inc|module|install|theme|info\\.yml)$`
18+- file path pattern: `(modules|themes|profiles)/custom`
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 `\\$permissions\\[['\"][^'\"]+['\"]\\]\\s*=\\s*array\\((?![^)]*(administer|manage|edit|delete)[^)]*(content|configuration|users)).*?\\);` – Permissions should follow Drupal naming patterns (verb + object) and be specific. Avoid overly broad permissions.
23+ - Pattern 1: Insecure permission design
24+ - pattern `if\\s*\\([^\\)]*===?\\s*['\"][a-zA-Z0-9_]+['\"]\\s*\\)` – Consider moving business logic rules to configuration to allow for proper adjustment without code changes.
25+ - Pattern 2: Hard-coded business logic values
26+ - pattern `preg_replace|str_replace|strip_tags` – Avoid ad hoc sanitization. Use Drupal's built-in sanitization tools: t(), Xss::filter(), etc.
27+ - Pattern 3: Ad hoc input sanitization
28+ - pattern `class\\s+[a-zA-Z0-9_]+Controller.+\\{[^}]*->query\\(` – Follow separation of concerns. Move database logic to services or repositories, not in controllers.
29+ - Pattern 4: Database logic in controllers
30+ - pattern `function\\s+[a-zA-Z0-9_]+_entity_access\\([^)]*\\)\\s*\\{[^}]*return\\s+AccessResult::allowed\\(\\);` – Avoid unconditional access grants. Implement proper conditional checks based on roles, permissions, or entity ownership.
31+ - Pattern 5: Weak entity access policy
32+ - pattern `session_start|session_set_cookie_params` – Avoid custom session management. Use Drupal's session handling system and services.
33+ - Pattern 6: Custom session management
34+ - pattern `(?:\\\\Drupal::[a-zA-Z_]+\\(\\).*){3,}` – Excessive static service calls indicate poor dependency injection. Use proper service injection.
35+ - Pattern 7: Excessive global state dependency
36+ - pattern `password_verify\\(|password_hash\\(` – Avoid custom authentication. Use Drupal's built-in authentication system and services.
37+ - Pattern 8: Custom user authentication
38+ - pattern `function\\s+[a-zA-Z0-9_]+_schema\\(\\)[^{]*\\{[^}]*return\\s+\\$schema;(?![^}]*validate_utf8|[^}]*'not null')` – Database schemas should enforce data integrity with proper constraints (NOT NULL, length, etc.).
39+ - Pattern 9: Missing schema definitions
40+ - pattern `\\$config\\[['\"](mdc:?!secure_|security_|private_)[^'\"]+['\"]\\]\\s*=\\s*(?:FALSE|0|'0'|\"0\");` – Security-related configuration should default to secure settings (opt-in for potentially insecure features).
41+ - Pattern 10: Insecure defaults
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 Secure Design 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. **Secure Architecture Principles:**
48+ - Follow the principle of least privilege for all user roles and permissions
49+ - Implement defense in depth with multiple security layers
50+ - Use Drupal's entity/field API for structured data instead of custom tables
51+ - Employ service-oriented architecture with proper dependency injection
52+ - Follow Drupal coding standards to leverage community security expertise
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. **Permission System Design:**
55+ - Design granular permissions following the verb+object pattern
56+ - Avoid creating omnipotent permissions that grant excessive access
57+ - Use context-aware access systems like Entity Access or Node Grants
58+ - Consider record-based and field-based access for better control
59+ - Document permission architecture and security implications
9160
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)
61+3. **Module Architecture:**
62+ - Separate concerns into appropriate services
63+ - Use hooks judiciously and document security implications
64+ - Implement proper validation and sanitization layers
65+ - Design APIs with security in mind from the start
66+ - Provide secure default configurations
10367
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`
68+4. **Data Modeling Security:**
69+ - Implement appropriate validation constraints on entity fields
70+ - Design schema definitions with integrity constraints
71+ - Use appropriate field types for sensitive data
72+ - Implement field-level access control when needed
73+ - Consider encryption for sensitive stored data
11074
111−See `TAG_STANDARDS.md` for the complete tag taxonomy and guidance.
75+5. **Error Handling and Logging:**
76+ - Design contextual error messages (detailed for admins, general for users)
77+ - Implement appropriate logging for security events
78+ - Avoid exposing sensitive data in error messages
79+ - Design fault-tolerant systems that fail securely
80+ - Include appropriate transaction management
11281
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.
82+## Validation Checks
83+- Conditions:
84+ - pattern `protected\\s+\\$[a-zA-Z0-9_]+;[^}]*public\\s+function\\s+__construct\\([^\\)]*\\)` – Using proper dependency injection pattern.
85+ - Check 1: Proper dependency injection
86+ - pattern `config\\/schema\\/[a-zA-Z0-9_]+\\.schema\\.yml` – Providing configuration schema for validation.
87+ - Check 2: Configuration schema usage
88+ - pattern `\\$permissions\\[['\"][a-z\\s]+[a-z0-9\\s]+['\"]\\]\\s*=\\s*\\[` – Following permission naming conventions.
89+ - Check 3: Proper permission definition
90+ - pattern `@EntityAccessControl\\(|class\\s+[a-zA-Z0-9_]+AccessControlHandler\\s+extends\\s+` – Using dedicated access control handlers for entities.
91+ - Check 4: Entity access handlers
11892
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−
93+## Metadata
94+- Priority: high
95+- Version: 1.1
96+- Tags: security, drupal, design, architecture, owasp, language:php, framework:drupal, category:security, subcategory:design, standard:owasp-top10, risk:a04-insecure-design
12397 ## References
124−- Project README: [README.md](README.md)
125−- Tag standards: [TAG_STANDARDS.md](TAG_STANDARDS.md)
126−- All rule sources: `.cursor/rules/*.mdc`
98+- https://owasp.org/Top10/A04_2021-Insecure_Design/
99+- https://www.drupal.org/docs/develop/security-in-drupal
100+- https://www.drupal.org/docs/8/api/entity-api/access-control-for-entities
101+- https://www.drupal.org/docs/8/api/configuration-api/configuration-schemametadata
127102
103+
