Communitygithub.com

YepAPI/skills — 인증 보안

bcrypt/argon2 해싱, 무차별 대입 공격 방어, 안전한 비밀번호 재설정 등 인증 보안 규칙을 제공합니다.

skills — 인증 보안란 무엇인가요?

이 스킬은 인증 시스템의 보안을 강화하기 위한 개발자 지침을 제공합니다. 비밀번호는 bcrypt(비용 계수 12+) 또는 argon2id로 해시하고, SHA/MD5 같은 취약한 알고리즘을 사용하지 않습니다. 로그인 엔드포인트는 IP당 분당 최대 5회, 계정당 시간당 10회로 속도를 제한하며, 실패 횟수에 따라 지수적으로 잠금 시간이 증가하다가 10회 실패 시 15분간 하드 잠금됩니다. 비밀번호 재설정 토큰은 암호학적으로 안전한 난수이며 1회용이고 1시간 후 만료됩니다. 또한, 사용자에게 항상 '잘못된 이메일 또는 비밀번호'라는 일반적인 오류 메시지를 반환하여 어떤 필드가 잘못되었는지 숨깁니다. 마지막으로, 비밀번호 최소 길이는 8자로 강화하고 HaveIBeenPwned API로 유출 비밀번호를 확인합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/YepAPI/skills/tree/HEAD/skills/auth-security

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

인증 보안

규칙

  • 비밀번호는 bcrypt(비용 계수 12+) 또는 argon2id로 해시 — 절대 평문으로 저장하거나 SHA/MD5를 사용하지 마세요
  • 로그인 엔드포인트에 속도 제한: IP당 분당 최대 5회, 계정당 시간당 10회
  • 지수적 잠금 구현: 실패 시 1초, 2초, 4초, 8초... 증가, 10회 실패 시 15분간 하드 잠금
  • 비밀번호 재설정 토큰: 암호학적으로 안전한 난수, 1회용, 최대 1시간 만료
  • 일반 오류 반환: "잘못된 이메일 또는 비밀번호" — 어떤 필드가 잘못되었는지 절대 공개하지 마세요
  • 비밀번호 최소 길이 8자 강제, 유출된 비밀번호 목록(HaveIBeenPwned API)과 대조 확인
import bcrypt from "bcrypt";

// 회원가입 시 해시
const hash = await bcrypt.hash(password, 12);

// 로그인 시 확인
const valid = await bcrypt.compare(password, storedHash);
if (!valid) {
  await incrementFailedAttempts(userId);
  return res.status(401).json({ error: "Invalid email or password" });
}
await resetFailedAttempts(userId);
// 무차별 대입 잠금 확인
async function checkLockout(userId: string) {
  const attempts = await getFailedAttempts(userId);
  if (attempts.count >= 10) {
    const lockoutEnd = attempts.lastAttempt + 15 * 60 * 1000;
    if (Date.now() < lockoutEnd) throw new Error("Account temporarily locked");
  }
}

피해야 할 사항

  • 비밀번호를 평문, base64 또는 복호화 가능한 암호로 저장하는 것
  • 비밀번호에 SHA-256 사용 — 빠르기 때문에 무차별 대입 공격에 취약함
  • 로그인 또는 비밀번호 재설정 시 이메일 존재 여부를 드러내는 것
  • 비밀번호 재설정 링크가 만료되지 않거나 재사용 가능한 것
  • 단일 IP에서 무제한 로그인 시도를 허용하는 것

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

YepAPI/skills

WCAG 2.1 AA — semantic HTML, keyboard navigation, screen readers.

YepAPI/skills

Experiment setup, variant splitting, statistical significance, and feature flag integration.

YepAPI/skills

CRUD generators, data tables, user management, role-based access, and bulk operations.

YepAPI/skills

Monitor what ChatGPT and Gemini say about your brand using YepAPI.

YepAPI/skills

Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

YepAPI/skills

Commander.js, interactive prompts with Clack, spinners, colors, config files, exit codes, and npm publishing.

YepAPI/skills

cmdk integration, Cmd+K trigger, fuzzy search, grouped actions, keyboard navigation, and dynamic action registration.

YepAPI/skills

Content planning with trend and sentiment data from YepAPI.

YepAPI/skills

Content calendar, keyword-driven planning, and content briefs.

YepAPI/skills

Theme switching with CSS variables, system preference detection, next-themes, and persistence.

YepAPI/skills

Threaded comments, @mentions, reactions, moderation queue, optimistic UI, and cursor pagination.

YepAPI/skills

Competitive analysis between domains using YepAPI.

YepAPI/skills

Layout grids, KPI cards, data tables with sorting/filtering, sidebar navigation, and responsive breakpoints.

YepAPI/skills

Data encryption — TLS everywhere, AES-256-GCM for PII, bcrypt passwords, encrypted backups.

YepAPI/skills

Chart patterns with Recharts/Nivo/D3, responsive containers, color scales, and accessibility.

YepAPI/skills

Drizzle schema definition, push vs migrate, type-safe queries, relations, transactions, and prepared statements.

YepAPI/skills

Upload handling, resize/compress, CDN delivery, blur placeholders, and next/image patterns.

YepAPI/skills

Local business and Google Maps research using YepAPI.

YepAPI/skills

Cursor-based pagination, IntersectionObserver, virtualized lists with @tanstack/react-virtual, and scroll position restoration.

YepAPI/skills

Chat UI components, streaming responses with AI SDK, context window management, and RAG patterns.

관련 스킬