isolate prod Lambda deploy permissions to main-only role#94
Open
HikaruEgashira wants to merge 1 commit intomainfrom
Open
isolate prod Lambda deploy permissions to main-only role#94HikaruEgashira wants to merge 1 commit intomainfrom
HikaruEgashira wants to merge 1 commit intomainfrom
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.
Motivation
lambda:UpdateFunctionCodeand was assumable by any workflow/branch (repo:plenoai/pleno-live:*), allowing branch pushes or modified workflows to update the production Lambda outside the controlled deploy flow.Description
aws_iam_role.github_actions_deploywhose OIDC trust policy is restricted to themainbranch viarepo:plenoai/pleno-live:ref:refs/heads/maininpackages/infra/github-oidc.tf.lambda:UpdateFunctionCode,lambda:GetFunction,lambda:GetFunctionConfiguration) to the new deploy role and add anecr-pushpolicy for that role, keeping the original sharedpleno-live-github-actionsrole for non-deploy automation.output "github_actions_deploy_role_arn"and update the production workflow.github/workflows/deploy-server.ymlto assumearn:aws:iam::951872725222:role/pleno-live-github-actions-deployfor deploy operations.packages/infra/github-oidc.tfand.github/workflows/deploy-server.yml.Testing
git diff --checkto ensure no whitespace or index errors and it passed.rgforgithub_actions_lambda|role-to-assume|ref:refs/heads/main|UpdateFunctionCode|pleno-live-github-actions-deployto verify updated references and the changes were found as expected.terraform fmt packages/infra/github-oidc.tfbut Terraform is not installed in this environment, so Terraform formatting/validation could not be executed here.Codex Task