-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathsecure-development-principles.mdc
More file actions
38 lines (27 loc) · 1.78 KB
/
secure-development-principles.mdc
File metadata and controls
38 lines (27 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
description:
globs:
alwaysApply: true
---
# Secure Development Principles
These rules define essential practices for writing and generating secure code.
They apply universally — to manual development, automated tooling, and AI-generated code.
All violations must include a clear explanation of which rule was triggered and why, to help developers understand and fix the issue effectively.
## 1. Do Not Use Raw User Input in Sensitive Operations
- **Rule:** Untrusted input must never be used directly in file access, command execution, database queries, or similar sensitive operations.
## 2. Do Not Expose Secrets in Public Code
- **Rule:** Secrets such as API keys, credentials, private keys, or tokens must not appear in frontend code, public repositories, or client-distributed files.
## 3. Enforce Secure Communication Protocols
- **Rule:** Only secure protocols (e.g., HTTPS, TLS) must be used for all external communications.
## 4. Avoid Executing Dynamic Code
- **Rule:** Dynamically constructed code or expressions must not be executed at runtime.
## 5. Validate All External Input
- **Rule:** Inputs from users, external APIs, or third-party systems must be validated before use.
## 6. Do Not Log Sensitive Information
- **Rule:** Logs must not contain credentials, tokens, personal identifiers, or other sensitive data.
## 7. Prevent Disabling of Security Controls
- **Rule:** Security checks must not be disabled, bypassed, or suppressed without documented and reviewed justification.
## 8. Limit Trust in Client-Side Logic
- **Rule:** Critical logic related to permissions, authentication, or validation must not rely solely on client-side code.
## 9. Detect and Eliminate Hardcoded Credentials
- **Rule:** Credentials must not be hardcoded in source files, configuration, or scripts.