Isolate builds from approved production deployments - #173
Draft
elliot-bitcast wants to merge 1 commit into
Draft
Conversation
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.
Build jobs currently use the shared AWS deployment identity before production approval. This change builds an image without AWS credentials and carries its immutable, checksum-verified archive into a separately authorized deployment job. Production uses a repository-scoped role and protected environment; ordinary staging releases remain automatic.
The deployment publishes the built artifact without rebuilding it. Service releases use a registry digest. The validator preserves the newly merged Terraform-template selection, including its Loki configuration, and verifies the AWS-recorded registering principal is bitcast-terraform; a forged ManagedBy tag is rejected. CODEOWNERS protects all of .github, including the ownership file itself. Image publishers that feed existing scheduled latest tags can publish only after production approval. The production canary and owner still deploy sequentially under one human approval.
Rollout dependency: deploy and verify the scoped roles and GitHub protection settings from https://github.com/bitcast-network/bitcast-infra/pull/767 before merging this PR. Keep the old shared roles only until all consumers have migrated; retire them through the separate final cutover.
Validation: actionlint and Bash syntax checks pass. Companion Terraform policies pass configuration validation and IAM simulation of own-resource access and cross-repository/development-to-production denial. No live service or extra payment task was triggered by this patch.
The validator template identity predicate passes eight checks for both AWS tag encodings, accepting the Terraform role and rejecting the development role, lookalike roles and other accounts.