Skip to content

feat: VSCode(VSIX) 전용 정적 분석기 + 마켓 lifecycle 연동 (Tier1)#10

Merged
Interludeal merged 1 commit into
developfrom
feature/vscode-analysis
Jun 9, 2026
Merged

feat: VSCode(VSIX) 전용 정적 분석기 + 마켓 lifecycle 연동 (Tier1)#10
Interludeal merged 1 commit into
developfrom
feature/vscode-analysis

Conversation

@J4EH00N

@J4EH00N J4EH00N commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

무엇을

VSCode 확장(VSIX)을 정적 룰 기반으로 위험 탐지하는 전용 분석기를 추가합니다. 기존 Chrome 분석 경로는 변경하지 않고(browser=="vscode" additive 분기), 검색→홀딩→스케줄러→/file_scan→판정→마켓 lifecycle까지 연결됩니다.

왜 (배경)

  • VSIX는 Chrome식 manifest.json이 아니라 extension/package.json 구조 → 기존 스캐너는 매니페스트를 못 찾아 정적분석이 조용히 스킵되던 문제.
  • VSCode는 선언적 권한 시스템이 없어 사실상 풀권한 → 코드 본문 정적 분석이 1차 신호.
  • 동적 분석은 브라우저 확장 전용이라 VSCode엔 미적용 → 정적 룰만 우선.

변경 사항

신규 모듈 backend/vscode_analysis/

  • rules.py — 15룰 정의 + publisher 화이트리스트 + C2/메타데이터 상수 + 정규식
  • manifest_scan.py — package.json 룰 (M-001,002,004,005,006)
  • code_scan.py — 코드·시크릿 룰 (C-003,004,006,007,009,010,011 / X-001,002,003) + 오탐 예외
  • decision.py — 판정 (Critical→거부제안+검토 / 그 외 검토, 자동 approve 없음, 파싱실패 fail-closed)
  • runner.pyrun_vscode_static_analysis(vsix) 진입점

main.py (전부 additive, Chrome 코드 불변)

  • /file_scanbrowser=="vscode" early-branch + _run_vscode_scan()
  • Nexus review/ 업로드 + Web UI /api/receive 콜백 + 대시보드 표시용 risk_level 교정

테스트 backend/tests/vscode_analysis/ — 70개

정밀도(오탐 억제) 설계

  1. Publisher 화이트리스트 — 정책 룰(M-002)만 면제. eval·C2 등 Critical 코드룰은 publisher 무관하게 항상 발화(침해된 신뢰 publisher = 공급망 공격 대비).
  2. node_modules vendored 제외 — 오탐 우려 룰(C-003·C-011)만. 상수·시그니처 Critical 룰은 vendored에서도 발화.
  3. 보안-인지 예외 — 클라우드 메타데이터 IP: instance(VM 탐지 텔레메트리)는 면제, identity/oauth2/token·AWS·GCP 토큰 경로는 Critical 유지.

검증

  • 70 테스트 통과
  • 양성 5종(ESLint·Prettier·GitLens·Python·VSCode-Icons) → Critical 오탐 0
  • GlassWorm형 합성 샘플 → C-003·C-004·C-006 발화 → 거부 제안
  • 로컬 E2E: 검색→분석요청→홀딩→스케줄러→/file_scan→판정→대시보드 표시 확인

알려진 후속 / 범위 외

  • [M1] web_payload.overall.risk_level 표기: VSCode 분기에서 교정했으나, 근본 보정은 공유 web_payload.py 변경이라 팀 합의 후 별도 처리 권장.
  • 후속 단계: Tier2(외부 IOC/SHA/npm 피드), Tier3(AST: C-001/002/005/008/012), Tier4(교차파일·조합 매트릭스).

영향

  • Chrome 경로 무회귀(additive 분기/신규 모듈만). DB·lifecycle·Nexus 경로 변경 0.

VSCode 확장을 정적 룰로 위험 탐지. Chrome 경로 불변(browser=="vscode" additive 분기).

- backend/vscode_analysis/: rules(15룰)/manifest_scan/code_scan/decision/runner
  - Manifest 5(M-001,002,004,005,006) / 코드 7(C-003,004,006,007,009,010,011) / 시크릿 3(X-001,002,003)
  - 오탐 억제: publisher 화이트리스트(정책룰 한정), node_modules vendored 제외(C-003/011 한정),
    C-007 보안-인지 예외(instance 메타데이터 면제 / identity·token은 Critical 유지)
  - 판정: review 기본, Critical→거부제안. 자동 approve 없음. 파싱실패 fail-closed
- main.py: /file_scan에 browser=="vscode" early-branch + _run_vscode_scan
  (Nexus review/ 업로드 + Web /api/receive 콜백 + risk_level 교정) — 전부 additive
- backend/tests/vscode_analysis/: 70 테스트 (양성 5종 Critical 0, GlassWorm 합성 탐지)
@J4EH00N J4EH00N force-pushed the feature/vscode-analysis branch from 3c0aef7 to 370ab39 Compare June 5, 2026 13:06
@Interludeal Interludeal merged commit b2db78f into develop Jun 9, 2026
1 check passed
@Interludeal Interludeal deleted the feature/vscode-analysis branch June 9, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants