security-and-hardening

Applies OWASP defenses, input validation, and secrets management to application code.

4|Updated Jun 19, 2026
One-click install
npx skills add https://github.com/douglance/sdlc-plugin --skill security-and-hardening-douglance
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: security-and-hardening
Source: https://github.com/douglance/sdlc-plugin/tree/main/.rulesync/skills/security-and-hardening
Command: npx skills add https://github.com/douglance/sdlc-plugin --skill security-and-hardening-douglance

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents common web application vulnerabilities—SQL injection, XSS, broken authentication, and exposed secrets—by enforcing concrete security rules and review checklists during development. ## Core Features & Use Cases - Always/Ask-First/Never Boundary: A three-tier policy that defines which security actions are mandatory, which require human approval, and which are forbidden outright. - OWASP Top 10 Defenses: Code-level patterns for parameterized queries, bcrypt password hashing, session cookie flags, CSP headers, and output encoding, with a dedicated OWASP.md reference. - Operational Guidance: Schema validation with zod, file upload restrictions, rate limiting with express-rate-limit, npm audit triage, and a security review checklist. - Use Case: When adding a login endpoint, apply the skill to hash passwords with bcrypt, set httpOnly/secure/sameSite session cookies, add rate limiting to auth routes, and verify no secrets leak into responses. ## Quick Start Review my Express authentication endpoint for security issues and apply the required hardening fixes.

Frequently Asked Questions about security-and-hardening

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent SQL injection in Node.js applications?▼

Prevent SQL injection by using parameterized queries instead of string concatenation, such as db.query('SELECT * FROM users WHERE id = $1', [userId]). ORMs like Prisma also parameterize inputs automatically when using their query methods.

How to validate user input at API boundaries with zod?▼

Define a zod schema describing allowed fields, types, and constraints, then call safeParse on the request body in the route handler. Return a 422 response with flattened error details when validation fails, and use the typed result data when it succeeds.

What session cookie settings should I use for authentication?▼

Set cookies with httpOnly to block JavaScript access, secure to require HTTPS, and sameSite lax for CSRF protection. Store the session secret in an environment variable and disable resave and saveUninitialized.

How do I triage npm audit vulnerabilities?▼

Triage by severity and reachability: fix critical or high vulnerabilities immediately if the vulnerable code path is reachable, update to patched versions when available, and document deferred fixes with a reason and review date. Dev-only moderate issues can wait for regular dependency updates.

Why should auth tokens not be stored in localStorage?▼

localStorage is accessible to any JavaScript running on the page, so an XSS vulnerability can steal tokens stored there. Use httpOnly cookies for session tokens instead, which JavaScript cannot read.