docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를 Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류. - 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로 자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거, 동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거. - 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming, Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business, Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로, 나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는 title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백). 원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지. - 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서. - 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는 지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지. - Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경. - 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
This commit is contained in:
@@ -0,0 +1,151 @@
|
||||
---
|
||||
id: wiki-2026-0508-시프트-레프트-shift-left
|
||||
title: 시프트 레프트 (Shift-Left)
|
||||
category: 10_Wiki/Topics
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [Shift Left, Shift-Left Testing, Shift-Left Security]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [devops, testing, security, ci-cd]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
tech_stack:
|
||||
language: agnostic
|
||||
framework: ci-cd
|
||||
---
|
||||
|
||||
# 시프트 레프트 (Shift-Left)
|
||||
|
||||
## 매 한 줄
|
||||
> **"매 결함은 매 발견 시점이 빠를수록 매 비용이 기하급수적으로 감소한다"**. Larry Smith가 2001년 매 명명. 매 testing / security / compliance 를 매 SDLC 의 좌측 (design / coding) 으로 매 이동. 매 2026 modern form은 매 IDE 안에서 매 SAST + AI assisted review (Claude Opus 4.7, GitHub Copilot) 가 매 commit 전 매 결함 탐지.
|
||||
|
||||
## 매 핵심
|
||||
|
||||
### 매 Cost curve (Boehm / NIST)
|
||||
- 매 design phase: 1x
|
||||
- 매 implementation: 5x
|
||||
- 매 testing: 10x
|
||||
- 매 production: 100x+
|
||||
|
||||
### 매 적용 영역
|
||||
- **Testing**: TDD / unit test in pre-commit hook.
|
||||
- **Security**: SAST (Semgrep, CodeQL), SCA (Dependabot, Snyk), secret scanning (gitleaks).
|
||||
- **Compliance**: policy as code (OPA / Conftest).
|
||||
- **Infrastructure**: tfsec, checkov.
|
||||
- **Quality**: lint / type check at IDE save.
|
||||
|
||||
### 매 응용
|
||||
1. Pre-commit hooks 으로 매 30 sec feedback.
|
||||
2. PR-blocking CI 로 매 main 매 clean.
|
||||
3. AI review (Claude Code / Copilot) 으로 매 design phase 매 결함 탐지.
|
||||
|
||||
## 💻 패턴
|
||||
|
||||
### Pre-commit hook config
|
||||
```yaml
|
||||
# .pre-commit-config.yaml
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v5.0.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- repo: https://github.com/gitleaks/gitleaks
|
||||
rev: v8.21.0
|
||||
hooks: [{ id: gitleaks }]
|
||||
- repo: https://github.com/returntocorp/semgrep
|
||||
rev: v1.95.0
|
||||
hooks: [{ id: semgrep, args: [--config=auto, --error] }]
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: pytest-changed
|
||||
name: pytest-changed
|
||||
entry: pytest --testmon
|
||||
language: system
|
||||
pass_filenames: false
|
||||
```
|
||||
|
||||
### GitHub Actions: shift-left CI
|
||||
```yaml
|
||||
on: [pull_request]
|
||||
jobs:
|
||||
shift-left:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with: { fetch-depth: 0 }
|
||||
- uses: github/codeql-action/init@v3
|
||||
with: { languages: python }
|
||||
- uses: github/codeql-action/analyze@v3
|
||||
- uses: aquasecurity/tfsec-action@v1
|
||||
- run: npx snyk test --severity-threshold=high
|
||||
- run: gitleaks detect --source . --redact
|
||||
```
|
||||
|
||||
### Policy as code (OPA / Rego)
|
||||
```rego
|
||||
package terraform.s3
|
||||
|
||||
deny[msg] {
|
||||
resource := input.resource_changes[_]
|
||||
resource.type == "aws_s3_bucket"
|
||||
not resource.change.after.server_side_encryption_configuration
|
||||
msg := sprintf("S3 bucket %v: encryption not configured", [resource.name])
|
||||
}
|
||||
```
|
||||
|
||||
### IDE-time SAST (VS Code Semgrep)
|
||||
```json
|
||||
{
|
||||
"semgrep.scan.configuration": ["auto", "p/owasp-top-ten"],
|
||||
"semgrep.scan.onSave": true,
|
||||
"editor.codeActionsOnSave": { "source.fixAll": "explicit" }
|
||||
}
|
||||
```
|
||||
|
||||
### AI design review (Claude Opus 4.7)
|
||||
```bash
|
||||
claude review --pre-commit \
|
||||
--rules "OWASP Top 10, race conditions, error handling" \
|
||||
$(git diff --cached --name-only)
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| 매 secret leak 매 방지 | gitleaks pre-commit + GitHub secret scanning |
|
||||
| 매 dependency vulnerability | Dependabot + Snyk in PR |
|
||||
| 매 IaC misconfiguration | tfsec + OPA |
|
||||
| 매 logic bug | TDD + property-based tests |
|
||||
| 매 design flaw | AI-assisted review (Claude / Copilot) |
|
||||
|
||||
**기본값**: 매 pre-commit (lint + secret) + PR-CI (SAST + SCA + tests).
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[CI/CD Pipeline & IDE Security Integration|DevSecOps]]
|
||||
- 응용: [[SAST]] · [[SCA_Fundamentals|SCA]]
|
||||
- Adjacent: [[TDD]] · [[Supply Chain Security]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: 매 PR review 의 first-pass / 매 security policy generation / 매 test case 생성.
|
||||
**언제 X**: 매 final security signoff — 매 human security engineer 필수.
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Shift-left without budget**: 매 dev 에 매 책임만 떠넘기기.
|
||||
- **Tool spam**: 매 30 가지 scanner — 매 noise 로 매 ignored.
|
||||
- **Block on everything**: 매 false positive 로 매 trust 상실.
|
||||
- **No baseline**: 매 legacy code 의 매 모든 finding block.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (Smith 2001 *Shift-Left Testing*, Forrester *State of Application Security 2025*, OWASP DevSecOps Guideline).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — 매 pre-commit, OPA, AI review 패턴 추가 |
|
||||
Reference in New Issue
Block a user