Skip to content

chore: pin new Docker and fuzz dependencies by digest - #29

Closed
seonghobae wants to merge 3 commits into
developfrom
feat/clusterfuzzlite-fuzzing
Closed

chore: pin new Docker and fuzz dependencies by digest#29
seonghobae wants to merge 3 commits into
developfrom
feat/clusterfuzzlite-fuzzing

Conversation

@seonghobae

@seonghobae seonghobae commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • pin the new Docker and ClusterFuzzLite base images by digest so Scorecard no longer flags them as mutable container dependencies
  • switch the new ClusterFuzzLite build path from ad hoc pip install calls to the existing uv.lock flow via locked fuzz and nvidia extras
  • keep the lean image and fuzz smoke path reproducible while preserving the Apple Silicon/NVIDIA split introduced in the prior PRs

Verification

  • uv run pytest tests/test_docker_delivery.py tests/test_fuzzing_integration.py tests/test_project_metadata.py -q
  • uv run pytest tests/test_workflow_security.py tests/test_workflow_runtime_env.py -q
  • uv run pytest -q
  • PYTHONWARNINGS=error uv run pytest -q
  • uv run pytest --cov=src/newsdom_api --cov-branch --cov-report=term-missing --cov-fail-under=100 -q
  • uv run mkdocs build --strict
  • python3 -m py_compile fuzzers/dom_builder_fuzzer.py
  • ./.venv/bin/python fuzzers/dom_builder_fuzzer.py --smoke tests/fixtures/mineru_sample.json
  • podman build --format docker -t newsdom-api:test /tmp/newsdom-docker-context && podman run --rm -d --name newsdom-api-qa -p 18000:8000 localhost/newsdom-api:test && curl -sf http://127.0.0.1:18000/health

@seonghobae

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@seonghobae

Copy link
Copy Markdown
Collaborator Author

@coderabbitai approve

@seonghobae

Copy link
Copy Markdown
Collaborator Author

@coderabbitai resolve

@coderabbitai

coderabbitai Bot commented Apr 9, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

ClusterFuzz Lite 퍼징 기반 시설을 구축하는 변경입니다. 새로운 Dockerfile, 빌드 스크립트, GitHub Actions 워크플로우, DOM 빌더 퍼저, 퍼징 코퍼스, 통합 테스트를 추가하고 기존 Dockerfile과 프로젝트 메타데이터를 업데이트합니다.

Changes

Cohort / File(s) Summary
ClusterFuzz Lite 설정 파일
.clusterfuzzlite/Dockerfile, .clusterfuzzlite/build.sh, .clusterfuzzlite/project.yaml
ClusterFuzz Lite 통합을 위한 다단계 Docker 빌드, Python 의존성 설치 및 PyInstaller 바이너리 생성 스크립트, 프로젝트 언어 설정 파일을 추가합니다.
GitHub Actions 워크플로우
.github/workflows/clusterfuzzlite.yml
저장소 풀 요청 및 수동 트리거 시 AddressSanitizer를 사용하여 퍼저를 빌드하고 300초 동안 code-change 모드로 실행하는 GitHub Actions 워크플로우를 추가합니다.
Dockerfile 기본 이미지 매개변수화
Dockerfile, Dockerfile.nvidia
UV_IMAGE와 기본 Python/NVIDIA 이미지 ARG를 도입하고, 파이프 설치 대신 사전 빌드된 uv 바이너리를 중간 스테이지에서 복사하는 방식으로 변경합니다.
퍼저 구현
fuzzers/dom_builder_fuzzer.py, fuzzers/corpus/dom_builder_fuzzer/mineru_sample.json
DOM 빌더에 대한 smoke 테스트 및 atheris 퍼징 모드를 지원하는 퍼저 스크립트와 JSON 코퍼스 seed 파일을 추가합니다.
프로젝트 메타데이터
pyproject.toml, README.md
nvidiafuzz 선택적 의존성 그룹을 추가하고, 라이선스 필드를 SPDX 문자열 형식으로 업데이트하며, 퍼징 smoke 테스트 실행 방법을 README에 기록합니다.
테스트 업데이트
tests/test_docker_delivery.py, tests/test_fuzzing_integration.py, tests/test_project_metadata.py
Docker 이미지 핀 확인을 업데이트하고, ClusterFuzz Lite 통합 검증 및 퍼저 smoke 모드 실행 테스트를 추가하며, 라이선스 형식과 extras 의존성 검증 테스트를 추가합니다.

Sequence Diagram(s)

sequenceDiagram
    participant GH as GitHub Actions
    participant Checkout as Repository Checkout
    participant Build as ClusterFuzzLite Build Action
    participant Run as ClusterFuzzLite Run Action
    participant Fuzz as Fuzzer (dom_builder_fuzzer)
    participant DomBuilder as build_dom Function
    
    GH->>Checkout: workflow_dispatch / pull_request
    Checkout->>Build: Repository Contents
    Build->>Build: Run .clusterfuzzlite/build.sh
    Build->>Fuzz: PyInstaller Executable
    Build->>Run: Fuzzer Binaries Ready
    Run->>Fuzz: Execute Fuzzer (code-change mode, 300s)
    Fuzz->>Fuzz: atheris.Fuzz() generates inputs
    Fuzz->>DomBuilder: test_one_input(raw_bytes)
    DomBuilder->>DomBuilder: Parse & Coerce Input
    DomBuilder->>DomBuilder: Call build_dom()
    Run->>GH: Report Results
Loading
sequenceDiagram
    participant CLI as Command Line
    participant Main as main()
    participant SmokeMode as --smoke Mode
    participant FuzzMode as atheris Fuzz Mode
    participant Fuzzer as exercise_dom_builder()
    participant DOM as build_dom()
    
    CLI->>Main: Parse Arguments
    alt --smoke Provided
        Main->>SmokeMode: Load Seed File (mineru_sample.json)
        SmokeMode->>SmokeMode: Parse JSON & Coerce Content
        SmokeMode->>DOM: build_dom(content, document_id='smoke')
        DOM-->>SmokeMode: Return (success/error)
        SmokeMode->>Main: Exit 0
    else Fuzz Mode
        Main->>Main: atheris.Setup()
        Main->>Main: atheris.Fuzz()
        Main->>Fuzzer: test_one_input(raw_bytes)
        Fuzzer->>Fuzzer: Decode UTF-8 & Parse JSON
        Fuzzer->>DOM: build_dom(coerced_content, document_id='fuzz')
        DOM-->>Fuzzer: Return (continue)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • PR #28: 동일한 ClusterFuzzLite 통합 변경사항(.clusterfuzzlite/*, GitHub 워크플로우, fuzzers/dom_builder_fuzzer.py, 코퍼스 JSON, 관련 테스트)을 공유합니다.
  • PR #27: 저장소의 Dockerfile(DockerfileDockerfile.nvidia), 컨테이너 워크플로우, docker-delivery 테스트를 수정하는 코드 레벨 관련성이 있습니다.

Poem

🐰 퍼저 토끼가 뛰어내려
클러스터펴즈 한계로,
새로운 DOM 건설 경로!
Atheris로 재빨리 검사하고
취약점을 찾아내는구나!\ 🔍✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.53% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed 제목은 변경사항의 주요 내용을 명확하게 요약합니다. Docker와 fuzzing 의존성을 digest로 고정하는 것이 이 PR의 핵심 변경사항입니다.
Description check ✅ Passed 설명에는 변경사항 요약, Git Flow 대상 확인, 상세한 검증 단계가 포함되어 있어 템플릿 요구사항을 충족합니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/clusterfuzzlite-fuzzing
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch feat/clusterfuzzlite-fuzzing

Comment @coderabbitai help to get the list of available commands and usage tips.

@seonghobae
seonghobae enabled auto-merge (squash) April 9, 2026 19:36
@coderabbitai

coderabbitai Bot commented Apr 9, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@seonghobae

Copy link
Copy Markdown
Collaborator Author

PR #29 is superseded by #30, which carries the same pinned-dependency remediation on a clean branch from current develop.

@seonghobae seonghobae closed this Apr 9, 2026
auto-merge was automatically disabled April 9, 2026 19:38

Pull request was closed

@coderabbitai

coderabbitai Bot commented Apr 9, 2026

Copy link
Copy Markdown
✅ Actions performed

Comments resolved and changes approved.

1 similar comment
@coderabbitai

coderabbitai Bot commented Apr 9, 2026

Copy link
Copy Markdown
✅ Actions performed

Comments resolved and changes approved.

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.

1 participant