security-and-hardening
하는 일
공격과 데이터 유출로부터 보호해 코드를 더 안전하게 만드는 도구입니다. 민감한 정보를 다루는지, 사용자 입력을 안전하게 처리하는지 확인합니다.
사용하는 경우
- ✓외부로부터 정보를 받는 프로그램의 부분을 만들 때.
- ✓비밀번호, 개인 정보, 결제 정보를 보호해야 할 때.
- ✓프로그램을 다른 서비스나 API와 통합할 때.
스킬 링크
https://github.com/addyosmani/agent-skills/blob/main/skills/security-and-hardening/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“사용자 입력이 제 코드에서 보안 문제를 일으키지 않도록 하려면 어떻게 해야 하나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
사용자 정보나 다른 시스템의 데이터처럼 코드가 외부 데이터를 어떻게 처리하는지 분석합니다. 그다음 이 데이터가 프로그램을 공격하는 데 쓰이지 않도록 막는 방법을 제안합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Security and Hardening
Overview
Security-first development practices for web applications. Treat every external input as hostile, every secret as sacred, and every authorization check as mandatory. Security isn't a phase — it's a constraint on every line of code that touches user data, authentication, or external systems.
When to Use
- Building anything that accepts user input
- Implementing authentication or authorization
- Storing or transmitting sensitive data
- Integrating with external APIs or services
- Adding file uploads, webhooks, or callbacks
- Handling payment or PII data
Process: Threat Model First
Controls bolted on without a threat model are guesses. Before hardening, spend five minutes thinking like an attacker:
- Map the trust boundaries. Where does untrusted data cross into your system? HTTP requests, form fields, file uploads, webhooks, third-party APIs, message queues, and LLM output — plus the local values that look internal because the OS handed them to you: another process's command line or environment, filenames on a shared volume, a path in a job payload. Trust follows who wrote a value, not which channel delivered it. Every boundary is attack surface.
- Name the assets. What's worth stealing or breaking? Credentials, PII, payment data, admin actions, money movement.
- Run STRIDE over each boundary — a quick lens, not a ceremony:
| Threat | Ask | Typical mitigation |
|---|---|---|
| Spoofing | Can someone impersonate a user/service? | Authentication, signature verification |
| Tampering | Can data be altered in transit or at rest? | Integrity checks, parameterized queries, HTTPS |
| Repudiation | Can an action be denied later? | Audit logging of security events |
| Information disclosure | Can data leak? | Encryption, field allowlists, generic errors |
| Denial of service | Can it be overwhelmed? | Rate limiting, input size caps, timeouts |
| Elevation of privilege | Can a user gain rights they shouldn't? | Authorization checks, least privilege |
- Write abuse cases next to use cases. For each feature, ask "how would I misuse this?" — then make that your first test.
If you can't name the trust boundaries for a feature, you're not ready to secure it. This is OWASP A04: Insecure Design — most breaches begin in design, not code.
The Three-Tier Boundary System
Always Do (No Exceptions)
- Validate all external input at the system boundary (API routes, form handlers)
- Parameterize all database queries — never concatenate user input into SQL
- Encode output to prevent XSS (use framework auto-escaping, don't bypass it)
- Use HTTPS for all external communication
- Hash passwords with bcrypt/scrypt/argon2 (never store plaintext)
- Set security headers (CSP, HSTS, X-Frame-Options, X-Content-Type-Options)
- Use httpOnly, secure, sameSite cookies for sessions
- Run the detected package manager's native audit against the committed lockfile before every release
Ask First (Requires Human Approval)
- Adding new authentication flows or changing auth logic
- Storing new categories of sensitive data (PII, payment info)
- Adding new external service integrations
- Changing CORS configuration
- Adding file upload handlers
- Modifying rate limiting or throttling
- Granting elevated permissions or roles
Never Do
- Never commit secrets to version control (API keys, passwords, tokens)
- Never log sensitive data (passwords, tokens, full credit card numbers)
- Never trust client-side validation as a security boundary
- Never disable security headers for convenience
- Never use
eval()orinnerHTMLwith user-provided data - Never store sessions in client-accessible storage (localStorage for auth tokens)
- Never expose stack traces or internal error details to users
Hardening Controls
The rules below are the workflow; a concrete implementation of each lives in references/hardening-patterns.md. Open the section you need when you reach that code, not before.
Injection, XSS, and access control
- Parameterize every query. Never build SQL, NoSQL, or shell commands from input strings.
- Encode output through the framework's auto-escaping. If raw HTML is unavoidable, sanitize with an allowlist sanitizer first.
…
자주 묻는 질문
'취약점(vulnerabilities)'이란 무엇인가요?
악의적인 행위자가 정보에 접근하거나, 시스템을 손상시키거나, 제어권을 얻기 위해 악용할 수 있는 코드의 결함입니다.
'외부 입력은 모두 적대적으로 취급하라'는 무슨 뜻인가요?
프로그램 외부에서 오는 모든 데이터(사용자가 입력한 내용 등)에 항상 의심을 가지고, 사용하기 전에 안전한지 확인해야 한다는 뜻입니다.
비밀번호를 평문으로 저장하면 안 되는 이유는 무엇인가요?
누군가 데이터베이스에 접근하면 평문 비밀번호는 즉시 노출됩니다. 복잡한 코드로 변환한 '해시된' 비밀번호를 저장하는 것이 훨씬 안전합니다.
상세 정보
작성자의 원본 설명
Hardens code against vulnerabilities. Use when auditing an input handler for vulnerabilities, when handling user input, authentication, data storage, or external integrations, or when checking a login flow is safe against the OWASP Top Ten. Use when building any feature that accepts untrusted data, manages user sessions, or interacts with third-party services. Use when auditing dependencies for kn
repo: addyosmani/agent-skills
인기도
- GitHub 스타
- 107k
- 순위
- #780
- 라이선스
- MIT
- 업데이트
- 2026. 10. 13.
댓글
- …
이 저장소의 다른 스킬
api-and-interface-design
107k잘 정의된 API와 인터페이스를 만드는 데 도움을 줍니다. 소프트웨어의 서로 다른 부분이 통신하는 방식을 설계할 때 유용합니다.
browser-testing-with-devtools
107k에이전트가 실제 브라우저에서 코드를 직접 테스트하도록 돕습니다. 사용 환경에서 어떻게 작동하는지 확인하고, 오류와 성능 문제를 찾는 데 유용합니다.
ci-cd-and-automation
107k반복 작업을 자동화하고, 프로젝트를 배포하며, 인프라를 관리하도록 에이전트에게 가르칩니다.
code-review-and-quality
107k여러 측면에서 상세한 코드 검토를 수행합니다. 새 변경 사항을 병합하기 전에 품질을 확인하고 향후 문제를 막는 데 유용합니다.