Repository navigation
Harden CI, add e2e dependency updates, remove stale dead_code allows, and stop proxy header override - #923
Open
yahia008 wants to merge 4 commits into
Open
Harden CI, add e2e dependency updates, remove stale dead_code allows, and stop proxy header override#923yahia008 wants to merge 4 commits into
yahia008 wants to merge 4 commits into
Conversation
… no `concurrency`, Closes StellarGateLabs#899
… `e2e/`, so Playwr Closes StellarGateLabs#900
…s whose comments s Closes StellarGateLabs#901
…e app's `Referrer- Closes StellarGateLabs#902
|
@yahia008 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.
Summary
Harden CI, add e2e dependency updates, remove stale dead_code allows, and stop proxy header override
What was solved
#899 — Harden CI workflows: no
permissionsblock, noconcurrency, actions on mutable tags, Node 20 (EOL), and uncached tool installsHarden
.github/workflows/ci.ymlper the issue: add least-privilege top-levelpermissions(withchecks: writescoped to the audit job), add aconcurrencygroup that cancels superseded non-main runs, pin third-party actions to full commit SHAs with version comments, bump theopenapijob from Node 20 to Node 22, and pin/cache thecargo-tarpaulininstall (via--versionand/ortaiki-e/install-action). The Dockerfile'scargo-chefinstall is mentioned but is outside the workflow file; keep changes focused onci.ymlunless a minimal Dockerfile pin is clearly warranted.Addressed:
ci.ymldeclares least-privilegepermissions(top-levelcontents: read, withchecks: writeonly on theauditjob forrustsec/audit-check)concurrency: { group: ci-${{ github.ref }}, cancel-in-progress: true }so superseded PR runs are cancelled (non-main refs)ci.ymlto a full commit SHA with a version comment (checkout, rust-toolchain, cache, audit-check, install-action, etc.)#900 — Dependabot doesn't cover the npm lockfile in
e2e/, so Playwright and its transitive dependencies never get updatesAdd an npm Dependabot ecosystem entry for the
e2e/Playwright project so its lockfile gets grouped weekly updates, and optionally add an npm audit step to the supply-chain workflow.Addressed:
npmpackage-ecosystem entry to.github/dependabot.ymltargetingdirectory: "/e2e"with a weekly Monday 07:00 schedule andopen-pull-requests-limit: 5.playwrightgroup matching@playwright/*andplaywright*, and apatch-and-minorgroup for minor/patch updates.labels: ["dependencies"]andcommit-message.prefix: "chore(deps-e2e)"on the npm entry.#901 — Remove stale
#[allow(dead_code)]attributes whose comments say the code is unused when it is usedRemove the two stale
#[allow(dead_code)]attributes and their misleading comments fromreset_secsinsrc/api/mod.rsanddelivery_to_jsoninsrc/api/payments.rs, since both functions are now called in production paths. Optionally scan otherallow(dead_code)occurrences insrc/and remove any that are similarly stale, but keep edits surgical and limited to the issue's stated goal.Addressed:
#[allow(dead_code)]and the misleading comment abovereset_secsinsrc/api/mod.rs#[allow(dead_code)]and the misleading comment abovedelivery_to_jsoninsrc/api/payments.rs#902 — The Caddy reverse-proxy config overwrites the app's
Referrer-Policy: no-referrerwith a weaker policyFix the production Caddy reverse-proxy config so it no longer overrides the app's stricter
Referrer-Policy: no-referrer(and redundantX-Content-Type-Options), extendscripts/check-deploy-consistency.shto catch regressions where the Caddyfile sets an app-owned security header with a different value, and document inDEPLOYMENT.mdthat the app owns its security headers and the proxy must not override them.Addressed:
Referrer-PolicyandX-Content-Type-Optionsfrom thedeploy/Caddyfileheader block (or use Caddy's?Header valuefallback form) so responses through production Caddy carryReferrer-Policy: no-referreras set by the app.scripts/check-deploy-consistency.shto fail if the Caddyfile sets an app-owned security header with a value differing from what the app sets.DEPLOYMENT.mdstating the app owns its security headers and the proxy must not override them.Changes
Dockerfile(modify)README.md(modify).github/workflows/ci.yml(modify).github/workflows/supply-chain.yml(modify)scripts/check-deploy-consistency.sh(modify).github/dependabot.yml(modify)deploy/Caddyfile(modify)Approach
permissionsblock, noconcurrency, actions on mutable tags, Node 20 (EOL), and uncached tool installs #899 — Harden CI workflows: nopermissionsblock, noconcurrency, actions on mutable tags, Node 20 (EOL), and uncached tool installs (Changed: .github/workflows/ci.yml, Dockerfile, .github/workflows/ci.yml)e2e/, so Playwright and its transitive dependencies never get updates #900 — Dependabot doesn't cover the npm lockfile ine2e/, so Playwright and its transitive dependencies never get updates (Changed: .github/dependabot.yml, .github/workflows/supply-chain.yml)#[allow(dead_code)]attributes whose comments say the code is unused when it is used #901 — Remove stale#[allow(dead_code)]attributes whose comments say the code is unused when it is used (Changed: README.md)Referrer-Policy: no-referrerwith a weaker policy #902 — The Caddy reverse-proxy config overwrites the app'sReferrer-Policy: no-referrerwith a weaker policy (Changed: deploy/Caddyfile, scripts/check-deploy-consistency.sh, scripts/check-deploy-consistency.sh)Issues
Closes #899
Closes #900
Closes #901
Closes #902