security-and-hardening

Hardens web application code against OWASP vulnerabilities through validation, authentication, and secrets management patterns.

Updated Apr 21, 2026
One-click install
npx skills add https://github.com/alissonpef/copilot_agent_skills --skill security-and-hardening-alissonpef
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: security-and-hardening
Source: https://github.com/alissonpef/copilot_agent_skills/tree/main/.github/skills/security-and-hardening
Command: npx skills add https://github.com/alissonpef/copilot_agent_skills --skill security-and-hardening-alissonpef

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Web applications that accept user input, manage sessions, or integrate external services are exposed to injection, XSS, broken access control, and secret leakage. This Skill provides a structured security-first workflow so every line of code touching user data, authentication, or external systems follows hardened practices instead of ad-hoc fixes. ## Core Features & Use Cases - Three-Tier Boundary System: Clear rules for what to always do (parameterized queries, output encoding, security headers), what requires human approval (new auth flows, CORS changes, file uploads), and what to never do (commit secrets, log sensitive data, use eval with user input). - OWASP Top 10 Prevention Patterns: Ready-to-use TypeScript examples for SQL injection prevention, bcrypt password hashing, session cookie configuration, DOMPurify sanitization, authorization checks, helmet/CSP headers, and Zod schema validation. - Operational Guidance: npm audit triage decision tree, rate limiting setup, secrets management with .env conventions, and a full security review checklist. - Use Case: When adding a new API endpoint that accepts user input and stores data, apply the Skill to validate input with Zod at the boundary, parameterize database queries, enforce per-user authorization, and verify no secrets or stack traces leak in responses. ## Quick Start Use the security-and-hardening skill to review my new authentication endpoint and check it against the OWASP prevention checklist.

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]), or by using an ORM like Prisma that parameterizes inputs automatically. Never interpolate user input directly into SQL strings.

How do I validate user input at API boundaries?▼

Validate input at the route handler using a schema library like Zod. Define a schema with constraints on types, lengths, and allowed values, call safeParse on the request body, and return a 422 error with details when validation fails before touching business logic.

What is the correct way to store passwords and sessions?▼

Hash passwords with bcrypt, scrypt, or argon2 using at least 12 salt rounds, and never store plaintext. Configure session cookies with httpOnly, secure, and sameSite flags, keep the session secret in environment variables, and apply stricter rate limiting on auth endpoints.

How should I triage npm audit vulnerability reports?▼

Triage by severity and reachability: fix critical or high vulnerabilities immediately if the vulnerable code path is reachable, schedule moderate issues for the next release, and track low-severity items for routine updates. If no fix exists, document a workaround or allowlist entry with a review date.

When should security changes require human approval?▼

Human approval is required before adding new authentication flows, storing new categories of sensitive data like PII or payment info, changing CORS configuration, adding file upload handlers, modifying rate limiting, or granting elevated permissions. Routine hardening like headers and validation needs no approval.