Agent skill
secure-coding
Implementing OWASP Proactive Controls (Input Validation, Output Encoding, AuthZ/AuthN).
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/coding-andreibesleaga-gabbe-7
SKILL.md
secure-coding Skill
This skill guides the implementation of security controls during development (Shift Left).
1. Input Validation (Defense)
"Never trust input."
- Syntactic Validation: Is it an email? Is it a number? (Use Zod/Pydantic).
- Semantic Validation: Is
start_datebeforeend_date? Istransfer_amount> 0? - Allow-list: Only accept known bad characters (e.g.,
[a-zA-Z0-9]). Block everything else.
2. Output Encoding (Defense)
"Context matters."
- HTML Context: Escape
<-><. (Prevent XSS). - SQL Context: Use Parameterized Queries. (Prevent SQLi).
- JSON Context: Ensure valid JSON structure.
3. Authentication & Authorization
- NIST Guidelines:
- Passwords: Min 12 chars, no complexity rules, check against pwned passwords.
- MFA: Required for admin/privileged actions.
- Sessions: Absolute timeout (e.g., 12 hours) + Idle timeout (e.g., 30 mins).
- Authorization:
- Broken:
if (user.isAdmin)(Client-side check). - Fixed:
if (ctx.user.hasPermission('delete:user'))(Server-side check).
- Broken:
4. Cryptography
- At Rest: Use AES-256-GCM (Authenticated Encryption).
- In Transit: TLS 1.3 only.
- Hashing: Argon2id or bcrypt (work factor > 12).
- Secrets: Never hardcode. Use
process.env.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?