Initial commit
This commit is contained in:
commit
3a1960d860
51 files changed
+3395
No files matched your search
@@ -0,0 +1,17 @@
|
||||
---
|
||||
description: Security basics — secrets, auth, injection, and safe defaults
|
||||
alwaysApply: true
|
||||
---
|
||||
|
||||
# Security Basics
|
||||
|
||||
- Never commit secrets, API keys, tokens, or passwords. Use environment variables.
|
||||
- Never log passwords, tokens, session IDs, or full credit card numbers.
|
||||
- Parameterize all database queries. Never concatenate user input into SQL.
|
||||
- Escape or sanitize user-generated content before rendering in HTML.
|
||||
- Validate and whitelist file uploads: type, size, and storage path.
|
||||
- Use HTTPS for all external API calls in production code paths.
|
||||
- Apply least-privilege: services and DB users get only the permissions they need.
|
||||
- Check authorization on every mutating endpoint — authentication alone is not enough.
|
||||
- Set secure cookie flags (`HttpOnly`, `Secure`, `SameSite`) for session cookies.
|
||||
- Do not disable TLS certificate verification in production code.
|
||||
Reference in new issue
Block a user