You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This branch is the active development branch and is not the main branch. Once this feature branch is merged and deleted, the cleanup workflow will reference a non-existent branch and silently check out whatever default fallback GitHub applies — or fail. More critically, any commit pushed to feat/multicloud-web-frontend by any collaborator (or a compromised contributor) automatically becomes the Terraform configuration used by the terraform destroy workflow.
This is a supply-chain risk: the destroy workflow should reference a protected, stable ref (e.g. main, a tag, or the workflow's own ${{ github.ref }} with environment protection).
Location
.github/workflows/cleanup-staging.yml lines 58, 120, 183, 248 (current HEAD on main)
Suggested fix
Replace the hardcoded branch ref with:
${{ github.ref }} (triggers on workflow_dispatch, so uses the branch selected at trigger time)
Or omit the ref entirely (defaults to the branch the workflow_dispatch runs on)
Add a GitHub Environment (staging-destroy) with required reviewers so the workflow can only run after explicit approval
Also add a validation step that the checked-out Terraform config matches an expected SHA or tag before applying terraform destroy.
Severity rationale
MEDIUM — only workflow_dispatch triggers this workflow, with the "destroy" confirmation guard. The immediate practical risk is accidental breakage when the branch is deleted. The secondary risk (supply-chain via feature branch) is real but requires collaborator access to the branch.
Adding a deeper variant: the workflow_dispatch trigger on cleanup-staging.yml has no branch restriction, so the workflow can be manually triggered from any branch that includes the file. Because it performs terraform destroy -auto-approve across three clouds, a branch-specific edit of the destroy commands or the github-staging.tfvars could be used to destroy non-staging infra. The hardcoded ref: makes the checkout authoritative for the workflow itself, but the destroy commands use tfvars from that fixed ref too — still a blast-radius issue if github-staging.tfvars is modified on the hardcoded branch.
Verified: PR #565 (commit 16462db) merged into origin/feat/multicloud-web-frontend. Commit 'closes #386'. Drops the four hardcoded 'ref: feat/multicloud-web-frontend' overrides from .github/workflows/cleanup-staging.yml so the workflow uses its default checkout ref.
Activity
cristim commentedon May 14, 2026
Adding a deeper variant: the
workflow_dispatchtrigger oncleanup-staging.ymlhas no branch restriction, so the workflow can be manually triggered from any branch that includes the file. Because it performsterraform destroy -auto-approveacross three clouds, a branch-specific edit of the destroy commands or thegithub-staging.tfvarscould be used to destroy non-staging infra. The hardcodedref:makes the checkout authoritative for the workflow itself, but the destroy commands use tfvars from that fixed ref too — still a blast-radius issue ifgithub-staging.tfvarsis modified on the hardcoded branch.sec(iac/aws): drop hardcoded branch ref from cleanup-staging.yml (closes
sec(iac/aws): drop hardcoded branch ref from cleanup-staging.yml (closes
cristim commentedon May 28, 2026
Verified: PR #565 (commit 16462db) merged into origin/feat/multicloud-web-frontend. Commit 'closes #386'. Drops the four hardcoded 'ref: feat/multicloud-web-frontend' overrides from .github/workflows/cleanup-staging.yml so the workflow uses its default checkout ref.