-
Notifications
You must be signed in to change notification settings - Fork 33
fix(ci): update curl pin to pqc-enabled tag so PQC keys are generated #3579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -126,9 +126,9 @@ runs: | |||||||||||||||
| - name: Download latest init-temp-keys.sh, docker-compose.yaml, and watch.sh | ||||||||||||||||
| shell: bash | ||||||||||||||||
| run: | | ||||||||||||||||
| curl https://raw.githubusercontent.com/opentdf/platform/refs/tags/watch-sh-fix/.github/scripts/init-temp-keys.sh > otdf-test-platform/.github/scripts/init-temp-keys.sh | ||||||||||||||||
| curl https://raw.githubusercontent.com/opentdf/platform/refs/tags/watch-sh-fix/docker-compose.yaml > otdf-test-platform/docker-compose.yaml | ||||||||||||||||
| curl https://raw.githubusercontent.com/opentdf/platform/refs/tags/watch-sh-fix/.github/scripts/watch.sh > otdf-test-platform/.github/scripts/watch.sh | ||||||||||||||||
| curl https://raw.githubusercontent.com/opentdf/platform/refs/tags/pqc-enabled/.github/scripts/init-temp-keys.sh > otdf-test-platform/.github/scripts/init-temp-keys.sh | ||||||||||||||||
| curl https://raw.githubusercontent.com/opentdf/platform/refs/tags/pqc-enabled/docker-compose.yaml > otdf-test-platform/docker-compose.yaml | ||||||||||||||||
| curl https://raw.githubusercontent.com/opentdf/platform/refs/tags/pqc-enabled/.github/scripts/watch.sh > otdf-test-platform/.github/scripts/watch.sh | ||||||||||||||||
|
Comment on lines
+129
to
+131
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security: Downloaded scripts lack integrity verification. The three scripts are fetched via
The PR description states the tag "points to main HEAD," which is ambiguous—if the tag is intended to track main, this introduces non-deterministic builds and increases the attack surface. 🛡️ Recommended fix to add integrity verificationOption 1: Use commit SHAs instead of tags for immutability - curl https://raw.githubusercontent.com/opentdf/platform/refs/tags/pqc-enabled/.github/scripts/init-temp-keys.sh > otdf-test-platform/.github/scripts/init-temp-keys.sh
- curl https://raw.githubusercontent.com/opentdf/platform/refs/tags/pqc-enabled/docker-compose.yaml > otdf-test-platform/docker-compose.yaml
- curl https://raw.githubusercontent.com/opentdf/platform/refs/tags/pqc-enabled/.github/scripts/watch.sh > otdf-test-platform/.github/scripts/watch.sh
+ # Replace COMMIT_SHA with the actual commit SHA of the pqc-enabled tag
+ COMMIT_SHA="<commit-sha-of-pqc-enabled-tag>"
+ curl https://raw.githubusercontent.com/opentdf/platform/${COMMIT_SHA}/.github/scripts/init-temp-keys.sh > otdf-test-platform/.github/scripts/init-temp-keys.sh
+ curl https://raw.githubusercontent.com/opentdf/platform/${COMMIT_SHA}/docker-compose.yaml > otdf-test-platform/docker-compose.yaml
+ curl https://raw.githubusercontent.com/opentdf/platform/${COMMIT_SHA}/.github/scripts/watch.sh > otdf-test-platform/.github/scripts/watch.shOption 2: Add checksum verification after download curl https://raw.githubusercontent.com/opentdf/platform/refs/tags/pqc-enabled/.github/scripts/init-temp-keys.sh > otdf-test-platform/.github/scripts/init-temp-keys.sh
+ echo "<expected-sha256-checksum> otdf-test-platform/.github/scripts/init-temp-keys.sh" | sha256sum --check
curl https://raw.githubusercontent.com/opentdf/platform/refs/tags/pqc-enabled/docker-compose.yaml > otdf-test-platform/docker-compose.yaml
+ echo "<expected-sha256-checksum> otdf-test-platform/docker-compose.yaml" | sha256sum --check
curl https://raw.githubusercontent.com/opentdf/platform/refs/tags/pqc-enabled/.github/scripts/watch.sh > otdf-test-platform/.github/scripts/watch.sh
+ echo "<expected-sha256-checksum> otdf-test-platform/.github/scripts/watch.sh" | sha256sum --check🤖 Prompt for AI AgentsVersion mismatch risk between downloaded scripts and platform code. The scripts are downloaded from the fixed When
Consider using the same ref for both the platform checkout and the script downloads to ensure version consistency. 🔧 Proposed fix to align script downloads with platform checkout- curl https://raw.githubusercontent.com/opentdf/platform/refs/tags/pqc-enabled/.github/scripts/init-temp-keys.sh > otdf-test-platform/.github/scripts/init-temp-keys.sh
- curl https://raw.githubusercontent.com/opentdf/platform/refs/tags/pqc-enabled/docker-compose.yaml > otdf-test-platform/docker-compose.yaml
- curl https://raw.githubusercontent.com/opentdf/platform/refs/tags/pqc-enabled/.github/scripts/watch.sh > otdf-test-platform/.github/scripts/watch.sh
+ PLATFORM_REF="${{ inputs.platform-ref }}"
+ curl https://raw.githubusercontent.com/opentdf/platform/${PLATFORM_REF}/.github/scripts/init-temp-keys.sh > otdf-test-platform/.github/scripts/init-temp-keys.sh
+ curl https://raw.githubusercontent.com/opentdf/platform/${PLATFORM_REF}/docker-compose.yaml > otdf-test-platform/docker-compose.yaml
+ curl https://raw.githubusercontent.com/opentdf/platform/${PLATFORM_REF}/.github/scripts/watch.sh > otdf-test-platform/.github/scripts/watch.shThis ensures the scripts are from the same ref as the platform code being tested. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
| - name: Set up go (platform's go version) | ||||||||||||||||
| id: setup-go | ||||||||||||||||
| uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0 | ||||||||||||||||
|
|
||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
curlcommands do not use the-f/--failflag. By default,curldoes not return a non-zero exit code when encountering HTTP errors (such as 404 Not Found or 500 Internal Server Error). Instead, it will write the error response body to the destination files, which will cause confusing failures in subsequent steps when the runner attempts to execute the invalid shell scripts or parse the invalid YAML.Using
-sSfLensures thatcurlfails the step immediately on HTTP errors, runs silently unless there is an error, and correctly follows any redirects.