Skip to content

Commit 4892d36

Browse files
Merge pull request #15 from beginwebdev2002/fix/security-md-formatting-16519438413380662730
docs: update security.md to adhere to repository rules
2 parents e8fee76 + 79d9271 commit 4892d36

1 file changed

Lines changed: 18 additions & 14 deletions

File tree

.jules/rules/security.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ tags:
99
---
1010
# 🛡️ System Security & Hardening Rules for Jules
1111

12-
## 🎯 1. Context & Scope
12+
## 📝 1. Context & Scope
1313
- **Primary Goal:** Protect application data and user privacy by strictly enforcing **secure coding** practices and preventing common **OWASP Top 10** vulnerabilities.
1414
- **Target Tooling:** Jules AI agent (Security Audits, Authentication Logic Generation).
1515
- **Tech Stack Version:** Agnostic (Cybersecurity Best Practices).
@@ -20,21 +20,21 @@ tags:
2020

2121
---
2222

23-
## 🌐 2. Global Threat Mitigation Protocols
23+
## 🌍 2. Global Threat Mitigation Protocols
2424

2525
> [!WARNING]
2626
> **Secret Leakage:** Never hardcode secrets, API keys, passwords, or tokens in the codebase. Always load sensitive data via environment variables (`process.env`) and inject them securely.
2727
28-
### 🛑 OWASP Top 10 Prevention
28+
### 🛡️ OWASP Top 10 Prevention
2929
1. **Injection (SQLi, NoSQLi, Command):** Never directly concatenate user input into database queries or shell commands. Always use parameterized queries (Prepared Statements) or an approved ORM/Query Builder.
30-
2. **Cross-Site Scripting (XSS):** Automatically escape or sanitize all untrusted user content before rendering it in the browser. Do not use dangerously permissive innerHTML setters without a strict HTML sanitizer (like DOMPurify).
30+
2. **Cross-Site Scripting (XSS):** Automatically escape or sanitize all untrusted user content before rendering it in the browser. Do not use unsafe innerHTML setters without a strict HTML sanitizer (like DOMPurify).
3131
3. **Cross-Site Request Forgery (CSRF):** State-changing endpoints must require modern CSRF mitigation, such as SameSite cookies or Anti-CSRF tokens.
3232

33-
### 🔐 Identity & Access Management (IAM)
33+
### 🔑 Identity & Access Management (IAM)
3434
1. **Authentication:** Passwords must be hashed using strong, salted algorithms (e.g., Argon2, bcrypt). Plaintext passwords must never hit the database or logs.
3535
2. **Authorization:** Implement Principle of Least Privilege (PoLP). Role-Based Access Control (RBAC) or Attribute-Based Access Control (ABAC) must be checked at the *server level*, not just hidden on the client UI.
3636

37-
### 🏛️ Security Architecture
37+
### 🏰 Security Architecture
3838

3939
```mermaid
4040
graph TD
@@ -45,18 +45,19 @@ graph TD
4545
D -->|Sanitized Payload| F[(Database)]
4646
D -.->|No PII Logged| G[Logs: PII Masking]
4747
48-
style A fill:#f9f,stroke:#333,stroke-width:2px
49-
style B fill:#bbf,stroke:#333,stroke-width:2px
50-
style C fill:#fbb,stroke:#333,stroke-width:2px
51-
style D fill:#bfb,stroke:#333,stroke-width:2px
52-
style E fill:#f00,stroke:#333,stroke-width:2px,color:#fff
53-
style F fill:#ccc,stroke:#333,stroke-width:2px
54-
style G fill:#ddd,stroke:#333,stroke-width:2px,stroke-dasharray: 5 5
5548
%% Added Design Token Styles for Mermaid Diagrams
5649
classDef default fill:#e1f5fe,stroke:#03a9f4,stroke-width:2px,color:#000;
5750
classDef component fill:#e8f5e9,stroke:#4caf50,stroke-width:2px,color:#000;
5851
classDef layout fill:#f3e5f5,stroke:#9c27b0,stroke-width:2px,color:#000;
5952
53+
class A default;
54+
class B layout;
55+
class C component;
56+
class D layout;
57+
class E component;
58+
class F default;
59+
class G default;
60+
6061
```
6162

6263
| Security Layer | Pattern/Standard | Jules Requirement |
@@ -68,10 +69,13 @@ graph TD
6869

6970
---
7071

71-
## 3. Checklist for Jules Agent
72+
## 📋 3. Checklist for Jules Agent
7273

7374
When generating new backend endpoints, architectures, or frontend forms:
7475
- [ ] Validate and sanitize all incoming payload data against a strict schema (e.g., Zod, Class-Validator).
7576
- [ ] Ensure authentication tokens (JWT, Session IDs) are stored securely (HttpOnly, Secure, SameSite cookies).
7677
- [ ] Confirm no sensitive system stack traces or error details are returned to the client in HTTP responses.
7778
- [ ] Verify that updating or fetching a resource confirms the requesting user actually owns that resource (Insecure Direct Object Reference prevention).
79+
80+
## ❓ 4. Frequently Asked Questions
81+
- If the file is already ready, then change it according to the repository rules.

0 commit comments

Comments
 (0)