Communitygithub.com

lguidolin/심층 방어 보안

신뢰할 수 없는 입력, 비밀, 인증/권한 부여 또는 의존성을 처리할 때, 또는 새로운 공격 표면을 위협 모델링할 때 사용합니다. 키워드 — STRIDE, 위협 모델, 최소 권한, 비밀 관리, 공급망, 의존성 스캐닝, 입력 유효성 검사, 감사 로그, 심층 방어.

심층 방어 보안란 무엇인가요?

이 스킬은 심층 방어(Defense in Depth) 보안 원칙을 적용하는 데 중점을 둡니다. 보안을 단일 계층에 의존하는 대신 여러 계층이 서로를 보완하며, 하나의 계층이 실패하더라도 전체 시스템이 안전하게 유지되도록 설계합니다. 주요 원칙으로는 STRIDE를 활용한 위협 모델링, 최소 권한 원칙, 비밀 관리, 입력 유효성 검사, 의존성 공급망 보안, 감사 로깅 등이 있습니다. 이 스킬은 Claude Code, Cursor 등 다양한 AI 에이전트 플랫폼에서 사용할 수 있으며, SKILL.md 문서를 기반으로 개발자에게 보안 관련 의사 결정을 안내합니다. 특히 신규 엔드포인트, 비밀 처리, 의존성 추가, 권한 상승 작업과 같은 일반적인 상황에 대한 빠른 참조 표를 제공하여 실무에서 바로 활용할 수 있도록 돕습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/lguidolin/agent-skills/tree/main/skills/defense-in-depth-security

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

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

문서

심층 방어 보안은(는) 무엇을 하나요?

개요

보안은 계층화되어 있으며, 어떤 단일 계층이라도 실패할 수 있다고 가정하고, 작동하는 최소 권한만 부여합니다. 공격자는 당신이 잊어버린 계층을 찾습니다. 하나의 벽에 의존하는 시스템은 그 벽에 하나의 버그만 있어도 무너지지만, 중첩된 최소 권한 제어는 단일 계층의 실패에도 살아남습니다.

원칙 (보편적)

  • 신뢰할 수 없는 입력, 비밀, 또는 사용자 데이터를 처리하는 모든 것을 구축하기 전에 위협 모델링을 수행하십시오. 새로운 표면마다 간단한 STRIDE 평가(스푸핑, 변조, 부인, 정보 노출, 서비스 거부, 권한 상승)를 적용합니다. 모델과 완화 조치를 기록하십시오(recording-decisions 참조).
  • 심층 방어. 단일 제어는 "그 자체로" 보안이 아닙니다. 인증, 권한 부여, 입력 유효성 검사, 데이터 계층 강제 적용은 각각 다른 계층이 우회될 수 있다고 가정합니다.
  • 모든 곳에서 최소 권한 — 역할, 토큰, 서비스 계정, DB 권한. 기본적으로 접근 권한 없음; 최소한만 부여; 사용하지 않는 것은 철회.
  • 비밀은 코드, 이미지, 또는 커밋된 설정 파일에 절대 저장하지 않습니다. 런타임에 비밀 저장소에서 가져오며, 교체(rotation)되고, 필요한 워크로드에만 범위가 지정됩니다.
  • 신뢰 경계에서 모든 입력의 유효성을 검증하십시오. 모든 외부 시스템의 출력을 신뢰할 수 없는 데이터로 취급하고, 절대 명령어로 취급하지 마십시오.
  • 의존성 공급망은 공격 표면입니다. 잠금 파일을 커밋하고 무결성을 검사하며; 의존성을 스캔하고 업데이트하며; 기본 이미지를 고정(pin)하고 스캔합니다.
  • 민감한 작업은 감사(audit)됩니다. — 누가, 언제, 무엇을 했는지 — 그래야 남용과 실수를 재구성할 수 있습니다.

빠른 참조

표면첫 번째 질문들
사용자 입력을 받는 새 엔드포인트STRIDE 모델은 무엇인가? 유효성 검사는 어디에 있는가? 작동하는 최소 역할은 무엇인가?
비밀을 포함하는 모든 것비밀 저장소(코드/이미지 아님)에 있는가? 범위가 지정되었는가? 교체 가능한가?
새 의존성잠금 파일이 고정(pin)되었는가? 스캔되었는가? 잘 지원되는가?
권한 상승 변경감사(audit)되는가? 행위자가 애플리케이션 계층뿐만 아니라 데이터 계층에서도 권한이 부여되었는가?

스택 메커니즘

RLS를 최종 강제 계층으로, GraphQL 깊이/비용 제한을 DoS 제어로, 비밀을 위한 Key Vault, CI에서 pnpm audit/Trivy — postgres-postgraphile-rls-and-sql 및 cloud-delivery-aks를 참조하십시오.

강제 적용: CI에서 의존성 감사 + 이미지 스캐닝 + 비밀 스캐닝(차단); 위협 모델 및 감사 범위는 검토자 판단에 따릅니다.

전체 근거: 헌법 제X조 및 제XIV조, engineering-constitution/references/engineering-constitution.md에 번들로 제공됩니다.

Individual skills in this repo

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

lguidolin/change-hygiene-and-code-craft

Use when writing or refactoring code, structuring a commit or PR, or deciding whether to abstract duplication. Symptoms — mixing reorg with logic changes, a PR doing several things at once, a file growing large, the second copy of similar code, or unsure whether to DRY something up.

lguidolin/cloud-delivery-aks

Use when deploying to Kubernetes or Azure Kubernetes Service (AKS), configuring cloud secrets, setting up progressive rollout/canary, per-PR ephemeral environments, or k8s health probes. Keywords — Kubernetes, AKS, Key Vault, Argo Rollouts, Flagger, canary, blue-green, liveness, readiness, PodDisruptionBudget, HPA, rollback, GHCR.

lguidolin/commit-history-rewrite

Use when an existing repository has messy commit history that needs to conform to conventional commits before adopting release-please, or when intermediate WIP/fixup/merge commits need to be cleaned up.

lguidolin/conventional-commits-and-releases

Use when committing, writing a commit message, opening a PR that will be squash-merged, or configuring automated versioning/changelogs. Keywords — conventional commits, release-please, semver, feat/fix/chore, breaking change, changelog.

lguidolin/designing-before-building

Use when starting a feature, fixing a non-trivial bug, or about to write implementation code — before any code exists. Symptoms you need this: "this is simple, I'll just code it", reaching for the editor before a design is approved, or an idea that hasn't been turned into a spec and plan.

lguidolin/engineering-constitution

Use when starting work in a project that follows the engineering constitution, orienting to its rules, or deciding which engineering practice applies to a task — spec writing, commits, testing, security, deploys, database, or UI work.

lguidolin/graphql-contract-testing

Use when writing a GraphQL query/mutation that the UI and a test will share, or building route/schema contract or smoke tests. Symptoms — copying a query into a test, a test asserting on query text, schema change that didn't break the UI build, or RLS/permission drift. Keywords — graphql-codegen, typed document, contract test, route smoke test.

lguidolin/init-repo-CI

Use when setting up a new repository with conventional commits, release-please, and CI automation, or when retrofitting an existing repository that lacks automated versioning and PR validation workflows.

lguidolin/interface-craft-and-accessibility

Use when building or styling UI — components, layouts, forms, design tokens — or making accessibility decisions. Keywords — a11y, WCAG, keyboard navigation, focus state, contrast, design system, minimalist UI, component reuse, ARIA, semantic HTML.

lguidolin/merge-gates-and-automation

Use when setting up or changing CI, pre-push hooks, or a task runner, or deciding what must pass before merge. Symptoms — tempted to put authoritative checks only in a local hook, skip CI, bypass with --no-verify, or unsure what gates a merge vs. runs locally.

lguidolin/observability-and-slos

Use when adding logging, metrics, tracing, health checks, SLOs, or alerting — or when building a service surface that needs to be operable and debuggable. Keywords — structured logs, OpenTelemetry, correlation id, RED metrics, liveness, readiness, SLI, SLO, error budget, alerting.

lguidolin/performance-and-scale

Use when working on hot paths, list endpoints, pagination, data-access in loops, or public interfaces/schemas. Symptoms — unbounded queries, N+1 access, no latency budget, optimizing without measuring, or changing an interface many consumers depend on. Keywords — pagination, N+1, Hyrum's Law, performance budget, bundle size.

lguidolin/postgres-postgraphile-rls-and-sql

Use when writing PostgreSQL, PostGraphile config, Row-Level Security policies, SQL schema files, or working on the Browser→App→PostGraphile→Postgres data path. Keywords — RLS, SECURITY DEFINER, search_path, pgSettings, grants, roles, GraphQL depth limit, query cost, statement_timeout, SQL file organization.

lguidolin/recording-decisions

Use when a design or architecture decision has been made and needs to be captured — writing a decision record or ADR, updating a decision index, noting a deferred idea, or superseding a past decision. Keywords — ADR, decision record, rationale, rejected alternatives, dependency index.

lguidolin/resilience-and-deploy-safety

Use when planning a deploy, designing a rollback, or responding to an incident or writing a postmortem. Keywords — deploy safety, rollback, immutable artifact, progressive delivery, canary, blast radius, incident response, blameless postmortem, error budget.

lguidolin/ship-it

Use when the user wants to ship work — push, PR, archive decision records, merge, and clean up. Handles the full lifecycle from committing final changes through post-merge cleanup including converting specs/plans to compact decision records.

lguidolin/tests-as-a-control

Use when writing or modifying tests, when a test breaks during a refactor, or when testing permission/role rules. Symptoms — tempted to edit a test to make it pass, testing only the happy path, a deny-test that started passing, flaky tests, or unsure what to assert.

lguidolin/zero-downtime-migrations

Use when changing a database schema where data must survive the change — adding/removing/renaming columns, constraints, indexes, or backfilling. Symptoms — a destructive migration bundled with a code deploy, a NOT NULL column with a backfill, a table-locking UPDATE, or a rename. Keywords — expand/contract, parallel change, backfill, NOT VALID, CREATE INDEX CONCURRENTLY, graphile-migrate.

관련 스킬