Repository navigation
fix(iam): scope DenyNoTag to security groups so apps can create their task SG - #177
Merged
Merged
Conversation
… task SG #156 gives every app its own security group, created by the team CI role. The developer boundary's DenyNoTag denied ec2:CreateSecurityGroup on Resource "*" unless aws:RequestTag/team matches. AWS also authorizes that action against the VPC, where request tags are never in the context, so the IfExists deny always fired (frosting deploy 41034182549: explicit deny, DenyNoTag, on vpc/...). Teams never created SGs before, so it went unseen. Scope the statement to security-group resources. The tag is still required on the SG itself (IAM simulator: SG without team tag is still denied). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Terraform Plan🚧 Changes detected — Plan: 0 to add, 5 to change, 0 to destroy. Plan outputLLM ReviewRisk: 🟡 MEDIUM Plan updates 5 IAM managed policies in place (0 add, 0 destroy): the developer boundary and four team guardrail policies, all changing the EC2 security-group Deny statement's resource scope and the DenyBadName naming statement.
|
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.
Why
After #156, every app deploy creates its own task security group (
{team}-{app}-tasks). The first deploy, frosting run 41034182549, failed:The decoded message names
DenyNoTag. That statement deniesec2:CreateSecurityGrouponResource = "*"withStringNotEqualsIfExists aws:RequestTag/team. AWS also authorizes the action against the VPC, and request tags are never in that context, soIfExistsmakes the deny always match. Teams never created SGs before #156, so nobody noticed. Every app's next deploy fails until this is fixed.What
DenyNoTagis scoped toarn:aws:ec2:*:*:security-group/*. Theteamtag is still required on the security group itself.How verified
simulate-custom-policywith the boundary as the permissions boundary):The simulator puts request tags on both resources. In real calls the VPC never gets them, which is the "none" row for the VPC.
terraform validatesucceeds.Rollout
After apply, re-run the failed frosting deploy. cupcake, jzwatch and testteam pick it up on their next deploy.
🤖 Generated with Claude Code