Skip to content

test(supply-chain): reproduce Maven wrapper integrity gap on current develop - #311

Closed
seonghobae wants to merge 4 commits into
developfrom
security/maven-wrapper-checksum-4408b60
Closed

test(supply-chain): reproduce Maven wrapper integrity gap on current develop#311
seonghobae wants to merge 4 commits into
developfrom
security/maven-wrapper-checksum-4408b60

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Rebuilds issue #265 test-first from exact protected develop@4408b6086fd725ff1629d8f048cf28f3a2b40b1b because PR #281 is two protected commits behind and no longer descends from the live tip.

This branch intentionally contains only MavenWrapperIntegrityTest. The test requires the fixed Maven 3.9.11 distribution URL to remain bound to its reviewed SHA-256 and requires an integrity preflight immediately before every CI/SBOM Maven Wrapper invocation. Protected source at this base does not yet satisfy either requirement, so exact-head CI must produce causal RED before production/workflow changes are copied forward.

The two protected commits since #281's merge base touch only CDC source/tests and do not overlap this supply-chain lane. No old-head checks, reviews, or model evidence transfer. After current-head RED, apply the smallest fail-closed GREEN and rerun all exact-head security/SBOM/CI gates.

Summary by CodeRabbit

  • 개선 사항
    • Maven Wrapper의 배포 버전, 다운로드 주소 및 SHA-256 체크섬을 검증해 변조나 잘못된 설정을 조기에 감지합니다.
    • 운영체제별 CI 및 SBOM 생성 과정에 사전 무결성 검사가 추가되었습니다.
    • 검증에 실패하면 테스트 또는 SBOM 생성이 진행되지 않아 빌드 신뢰성이 향상됩니다.
  • 테스트
    • Maven Wrapper 설정과 관련 자동화 절차가 예상된 검증 조건을 충족하는지 확인하는 테스트를 추가했습니다.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 81 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6647e0f1-8cee-4872-bdd8-e9fe47b07c2b

📥 Commits

Reviewing files that changed from the base of the PR and between 417f6bc and 09460c2.

📒 Files selected for processing (1)
  • etl-service/src/test/java/com/xtrmetl/etl/documentation/MavenWrapperWindowsInvocationMatcherTest.java
📝 Walkthrough

Walkthrough

Maven Wrapper 속성에 SHA-256 체크섬을 추가했습니다. 검증 유틸리티가 필수 속성의 중복과 기대값을 확인합니다. CI 및 SBOM 워크플로는 Maven 실행 전에 검증을 수행합니다. 관련 JUnit 테스트도 추가했습니다.

Changes

Maven Wrapper 무결성

Layer / File(s) Summary
무결성 검증 유틸리티
.github/scripts/VerifyMavenWrapperIntegrity.java
속성 파일의 존재 여부, 필수 키의 중복 여부, Wrapper 버전·배포 유형·URL·SHA-256 값의 일치를 검증합니다.
CI 및 SBOM 사전 검증
.mvn/wrapper/maven-wrapper.properties, .github/workflows/ci.yml, .github/workflows/sbom.yml
Maven 배포 ZIP의 SHA-256 값을 설정합니다. 일반 및 self-hosted 작업에서 운영체제별 Maven 실행 전에 검증 단계를 실행합니다.
무결성 회귀 테스트
etl-service/src/test/java/com/xtrmetl/etl/documentation/MavenWrapperIntegrityTest.java
Wrapper 속성의 고정값과 SHA-256 형식을 검증합니다. CI 및 SBOM 워크플로의 Maven 호출 앞에 동일 조건의 사전 검증 단계가 있는지 확인합니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Mergeability Score: 🟡 Moderate · up to 417f6

The PR adds Maven-wrapper checksum and preflight enforcement, but its Windows invocation check currently fails to recognize the command form used by the workflows. That can leave a required Windows integrity check unenforced, so the PR is not merge-ready until the matcher is corrected and the relevant checks pass.

Sequence Diagram(s)

sequenceDiagram
  participant GitHubWorkflow
  participant VerifyMavenWrapperIntegrity
  participant maven-wrapper.properties
  participant MavenWrapper
  GitHubWorkflow->>VerifyMavenWrapperIntegrity: 운영체제별 사전 검증 실행
  VerifyMavenWrapperIntegrity->>maven-wrapper.properties: 속성 파일 읽기
  VerifyMavenWrapperIntegrity-->>GitHubWorkflow: 검증 성공 또는 예외 반환
  GitHubWorkflow->>MavenWrapper: 테스트 또는 SBOM 작업 실행
Loading

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 Maven Wrapper 무결성 문제를 재현하는 공급망 변경이라는 PR의 핵심 목적과 관련됩니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch security/maven-wrapper-checksum-4408b60

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@seonghobae
seonghobae marked this pull request as ready for review August 13, 2026 01:26

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/scripts/VerifyMavenWrapperIntegrity.java (1)

61-71: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

키 매칭을 = 이외의 구분자까지 허용하세요.

requireUniquePropertykey + "=" 접두사만 셉니다. java.util.Properties 형식은 key = valuekey:value도 허용합니다. 누군가 공백을 넣어 distributionUrl = ...로 저장하면 matches가 0이 되어 "found 0" 메시지로 실패합니다. 값 자체는 정상인데 실패 원인이 오해를 유발합니다.

동작은 fail-closed로 유지되므로 보안 결함은 아닙니다. 진단 정확도만 개선하는 변경입니다.

♻️ 제안 수정
     private static void requireUniqueProperty(List<String> sourceLines, String key) {
+        java.util.regex.Pattern keyPattern =
+                java.util.regex.Pattern.compile("^" + java.util.regex.Pattern.quote(key) + "\\s*[=:]");
         long matches = sourceLines.stream()
                 .map(String::trim)
-                .filter(line -> line.startsWith(key + "="))
+                .filter(line -> keyPattern.matcher(line).find())
                 .count();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/scripts/VerifyMavenWrapperIntegrity.java around lines 61 - 71,
Update requireUniqueProperty to recognize java.util.Properties key separators:
optional whitespace followed by either '=' or ':' after the key, while
preserving the existing exactly-one match validation and error behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@etl-service/src/test/java/com/xtrmetl/etl/documentation/MavenWrapperIntegrityTest.java`:
- Around line 138-140: Update containsWrapperInvocation to match Windows wrapper
commands using the mvnw.cmd pattern so workflow text is detected correctly,
while preserving Unix detection. Revise the related invocation-count validation
to require at least one Unix and one Windows invocation rather than assuming
wrapperInvocations == 2.

---

Nitpick comments:
In @.github/scripts/VerifyMavenWrapperIntegrity.java:
- Around line 61-71: Update requireUniqueProperty to recognize
java.util.Properties key separators: optional whitespace followed by either '='
or ':' after the key, while preserving the existing exactly-one match validation
and error behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7d3bba6d-64a8-4a90-8d50-1c002db12a74

📥 Commits

Reviewing files that changed from the base of the PR and between 4408b60 and 417f6bc.

📒 Files selected for processing (5)
  • .github/scripts/VerifyMavenWrapperIntegrity.java
  • .github/workflows/ci.yml
  • .github/workflows/sbom.yml
  • .mvn/wrapper/maven-wrapper.properties
  • etl-service/src/test/java/com/xtrmetl/etl/documentation/MavenWrapperIntegrityTest.java

Comment on lines +138 to +140
private static boolean containsWrapperInvocation(String line) {
return line.contains("./mvnw ") || line.contains(".\\mvnw.cmd ");
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
echo "--- 워크플로 실제 텍스트 ---"
rg -n 'mvnw' .github/workflows/ci.yml .github/workflows/sbom.yml
echo "--- 단일 백슬래시 패턴 존재 여부 (0건이면 테스트가 Windows 스텝을 못 잡음) ---"
rg -nF '.\mvnw.cmd ' .github/workflows/ci.yml .github/workflows/sbom.yml || echo "matches=0"
echo "--- 이중 백슬래시 패턴 ---"
rg -nF '.\\mvnw.cmd ' .github/workflows/ci.yml .github/workflows/sbom.yml || true

Repository: ContextualWisdomLab/mightyETL

Length of output: 1324


Windows 래퍼 호출 매칭 조건을 수정하세요.

.github/workflows/ci.yml.github/workflows/sbom.yml의 Windows 명령은 텍스트 .\\mvnw.cmd 를 사용합니다. 현재 containsWrapperInvocation의 Java 리터럴 ".\\mvnw.cmd "는 실행 시 .\mvnw.cmd 가 되므로 Windows 호출을 매칭하지 못합니다.

Windows 호출을 mvnw.cmd 기준으로 매칭하도록 수정하세요. 워크플로별 호출 수가 다르므로 wrapperInvocations == 2로 고정하지 말고, Unix 및 Windows 호출이 각각 존재하는지 검증하세요.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@etl-service/src/test/java/com/xtrmetl/etl/documentation/MavenWrapperIntegrityTest.java`
around lines 138 - 140, Update containsWrapperInvocation to match Windows
wrapper commands using the mvnw.cmd pattern so workflow text is detected
correctly, while preserving Unix detection. Revise the related invocation-count
validation to require at least one Unix and one Windows invocation rather than
assuming wrapperInvocations == 2.

Sources: Coding guidelines, Learnings

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