security-conventions
Skill234 starsChanged 3 months agoMITView on GitHub
Security checklist and conventions. Auto-injected into security-aware agents - not user-invocable.
- Reads credentials
1 other project uses a version of this.
Adopted by
Most recently taken up by
- ali-zohrevand/claude-sentineltheir own version, first seen Oct 20, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- ali-zohrevand/claude-sentinel★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository29 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- add-aspire-depSkill
- add-background-jobSkill
- add-ci-areaSkill
- add-email-templateSkill
- add-env-varSkill
- add-options-classSkill
- add-permissionSkill
- add-rate-limitSkill
- address-reviewSkill
- add-testSkill
- backend-conventionsSkill
- create-issueSkill
- create-prSkill
- create-releaseSkill
- frontend-conventionsSkill
- gen-typesSkill
- infra-conventionsSkill
- init-verifySkill
- manage-file-storageSkill
- new-endpointSkill
- new-entitySkill
- new-featureSkill
- new-pageSkill
- polish-uiSkill
- review-dependabotSkill
- review-designSkill
- review-prSkill
- verifySkill
The file
Files
Security Conventions
Architecture Context
- JWT access tokens in HttpOnly cookies, refresh token rotation
- Permission-based authorization via
[RequirePermission]attributes - Role hierarchy: Superuser > Admin > User > Custom
- PII masking server-side via
PiiMasker/WithMaskedPii- requiresusers.view_piipermission - CSRF protection via Origin header validation on mutations
- CSP with nonce-based script-src
- API proxy in SvelteKit forwards cookies + headers
Security Checklist
Authentication & Authorization
- Auth middleware cannot be bypassed (no unprotected routes that should be protected)
[RequirePermission]on every action that needs it - not just[Authorize]- Role hierarchy enforced - cannot manage users at/above your rank
- Cannot modify your own roles, lock yourself, or delete yourself
- Refresh token rotation works correctly - old tokens invalidated
- Permission changes invalidate affected users' tokens and cache
Input Validation
- All input validated on backend (FluentValidation) - frontend validation is UX only
- File uploads: size limits, MIME type validation, no path traversal
- URL fields: restrict to http/https schemes via
Uri.TryCreate - SQL injection: parameterized queries only (EF Core handles this, but check raw SQL)
- No string interpolation in LINQ/SQL queries
- Rate limiting on auth endpoints and mutations
PII Compliance
- Emails, phone numbers, usernames never exposed without
users.view_piipermission - PII masking happens server-side - never rely on frontend
- No PII in logs (structured logging with masking)
- No PII in URLs, tokens, or error messages
- Self-view exemption: users see their own unmasked data
- Audit trail for PII access
Information Leakage
- Error messages use
ErrorMessages.*constants - no stack traces, no internal details ProblemDetailsfor all error responses - no anonymous objects- Identity errors: log
.Descriptionserver-side, return static message to client - No sensitive data in JWT claims beyond what's needed
SetDbStatementForTextnever set totruein OTEL (captures SQL with PII)appsettings.Development.jsonandappsettings.Testing.jsonexcluded from publish
Cookie & Token Security
- HttpOnly, Secure, SameSite=Strict on auth cookies
- JWT secret is strong (64+ chars for HMAC SHA-256)
- Token lifetimes appropriate (short access, longer refresh)
- Refresh tokens are one-time-use with rotation
CSRF & CORS
- Origin header validated on all mutations via API proxy
- CORS restrictive by default - only
ALLOWED_ORIGINS - No
Access-Control-Allow-Origin: *in production
Response Headers
X-Content-Type-Options: nosniffX-Frame-Options: DENYReferrer-Policy: strict-origin-when-cross-origin- HSTS in production
- CSP nonce-based script-src
Infrastructure
- Secrets in env vars or
.env- never in code or config committed to git - Docker containers hardened (read-only root, no-new-privileges, caps dropped)
- Database credentials not exposed in connection strings in logs
- Health check endpoints don't leak sensitive info
Audit
- Security-significant actions audited via
IAuditService.LogAsync - Audit metadata serialized with
JsonSerializer.Serialize(not string interpolation) - Login, logout, password change, role change, permission change all audited
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

