Fix/ci security reliability issues#1226
Open
levi0005 wants to merge 5 commits into
Open
Conversation
services/api/Dockerfile does not exist, so the container-scan build step always failed. continue-on-error swallowed the failure and the Trivy step was gated on if: success(), so the API image scan silently never ran while the job reported green. Build now targets the real root Dockerfile and the step is no longer allowed to fail silently, so a real vulnerability will fail the job.
CreatedAt = timestamp() in the AWS provider default_tags block changes on every plan/apply invocation, so every taggable resource showed a spurious in-place update on every single run. This broke the ability to get a clean terraform plan, which terraform.yml uses as a CI gate, and risked unnecessary resource churn on every deploy. Dropping the tag lets repeated plans against unchanged config report "No changes."
Rust audit steps in dependency-scan.yml were marked continue-on-error and the follow-up gate only checked for "critical" severity, so high-severity Rust CVEs were logged but never failed the build. This was inconsistent with the npm audit in the same file (fails on critical and high) and with test.yml's contracts-crate audit (no continue-on-error). The Rust audit steps for both contracts/predict-iq and services/api now fail the job on either critical or high severity findings, and no longer swallow failures.
…ease actions-rs/toolchain@v1 and actions/create-release@v1 come from archived/unmaintained repositories (the actions-rs org has been archived since 2021, and actions/create-release was deprecated) and receive no security patches. Rust toolchain setup in contract-deployment.yml, release.yml, test.yml, and performance.yml now uses the actively maintained dtolnay/rust-toolchain, matching the convention already used elsewhere in the repo. contract-deployment.yml's GitHub Release creation now uses softprops/action-gh-release, already used twice in release.yml.
Documents the four fixes on this branch (API container scan Dockerfile path, Terraform default_tags timestamp churn, Rust dependency audit severity gate, archived GitHub Actions), following the repo's existing IMPLEMENTATION_SUMMARY_*.md convention.
|
@levi0005 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Problem: The container-scanning job built docker build -t predictiq-api:${{ github.sha }} -f services/api/Dockerfile ., but services/api/Dockerfile doesn't exist anywhere in the repo — only the root Dockerfile and services/tts/Dockerfile do. The build step had continue-on-error: true, and the Trivy scan step was gated on if: success(), so the build silently failed every time and the Trivy scan for the API image never ran — yet the job reported green.
Fix: Changed the build to -f Dockerfile (repo root), and removed continue-on-error: true and the if: success() gate, so a real build failure now fails the job and Trivy always runs against a real image.
Problem: The AWS provider's default_tags block included CreatedAt = timestamp(), applied to every taggable resource. Since timestamp() evaluates fresh on every plan/apply, every taggable resource showed a spurious in-place tag update on every single run, breaking the ability to get a clean terraform plan — which terraform.yml uses as a CI gate — and risking unnecessary resource churn on every deploy.
Fix: Removed the CreatedAt = timestamp() line from default_tags entirely. (Left the unrelated, legitimate timestamp() usage in modules/rds/main.tf's final-snapshot-identifier alone, since that only evaluates at destroy time, not on every plan.)
Problem: The first cargo audit --deny warnings step for both contracts/predict-iq and services/api was marked continue-on-error: true, and the follow-up step only parsed .advisory.severity == "critical" from the JSON output and exited non-zero solely for critical findings. High-severity Rust CVEs were logged but never failed the build — inconsistent with the npm audit in the same file (fails on critical and high) and with test.yml's contracts-crate audit (no continue-on-error at all).
Fix: Removed continue-on-error: true from both initial audit steps, and extended both follow-up severity-check steps (contracts/predict-iq and services/api) to also count and fail on high-severity advisories, not just critical.
Problem: actions-rs/toolchain@v1 (used in contract-deployment.yml:35, release.yml:88, test.yml:497, performance.yml:47 and 230) and actions/create-release@v1 (contract-deployment.yml:239) both come from archived/unmaintained repos — the actions-rs org has been archived since 2021, and actions/create-release was deprecated in favor of softprops/action-gh-release, which release.yml already uses twice elsewhere in the same repo. These receive no security patches and are inconsistent with the actively-maintained dtolnay/rust-toolchain used elsewhere.
Fix: Replaced every actions-rs/toolchain@v1 occurrence with dtolnay/rust-toolchain@stable (translating profile/override/target inputs to targets/components as appropriate for each job), and replaced contract-deployment.yml's actions/create-release@v1 step with softprops/action-gh-release@v2 (translating release_name → name, keeping tag_name/body/draft/prerelease). Confirmed via grep -rn "actions-rs/toolchain|actions/create-release" .github/workflows that zero matches remain.
Type of Change
Testing Done
Bundle Size
Checklist
docs/architecture.mdRelated Issues
Closes #1208
Closes #1209
Closes #1210
Closes #1211