Scenario: Enforcement proof (dry-run): all disallowed requesters are denied against in-scope receiver VPC
@vpc @tlp-amber @tlp-red @CCC.VPC.CN03 @CCC.VPC.CN03.AR01 @Destructive @MAIN @DEFAULT @CCC.VPCGiven a cloud api for "{Instance}" in "api"31µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"125µs
And I refer to "{result}" as "vpcService"25µs
And I load environment variable "CN03_RECEIVER_VPC_ID" as "ReceiverVpcId"15µs
And I load environment variable "CN03_NON_ALLOWLISTED_REQUESTER_VPC_ID" as "NonAllowlistedRequesterVpcId"30µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"16µs
And "{ReceiverVpcId}" is not nil13µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"530ms
And I attach "{result.Summary}" to the test output as "Disallow-list Enforcement Summary"54µs
And I attach "{result.Results}" to the test output as "Disallow-list Enforcement"86µs
Then "{result.ListDefined}" is true43µs
And "{result.TestedCount}" should be greater than "0"53µs
And "{result.AllCorrect}" is true23µs
And "{result.ViolationCount}" is "0"28µs
📎 Attachments:Disallow-list Enforcement Summary
View Content (56 bytes)
all 2 disallow-list VPC(s) correctly denied by guardrail
Disallow-list Enforcement
View JSON (6449 bytes)
[{"AllowListDefined":true,"ConflictMessage":"","ConflictType":"","DryRunAllowed":false,"ErrorCode":"UnauthorizedOperation","ExitCode":1,"GuardrailExpectation":"deny","GuardrailMismatch":false,"Origin":"terraform-fixture","PeerOwnerId":"","PeerVpcId":"vpc-071bf2e1e2416f266","Reason":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: 64199e08-eebc-4b7d-b37d-613a8dd93e12, api error UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:sts::211203495394:assumed-role/TerraformRole/GitHubActions is not authorized to perform: ec2:CreateVpcPeeringConnection on resource: arn:aws:ec2:us-east-1:211203495394:vpc-peering-connection/* with an explicit deny in an identity-based policy: arn:aws:iam::211203495394:policy/CN03PeeringGuardrail. Encoded authorization failure message: qeaXKOsXT16MALj6BjCNtXfR92h2J6tsKtFwZtpYtvQ0jwPdn9Nbdzt9LQbOe9wmz1NQzFr8ZN3WsO6oZCCxRENaLXNIWcYglf6zom0qcxLPb6ri7VC-HdxTgi7_lPJByYWXhTLcUM_IouIF0Hl8nZQxe-Gh2it3xnzv1HwPDH84ncfAzrej67XzZLLKNdm99Xc9bVK9hN1iddfBTB5wTeL1F6W-4neLUMgFWqc-CHAFfD1hD_0SfJEiCiD_E-YBmcwmBRAG-0_EacLVv4ZNEwzyzaec4Q6veyBwf21TsnmDVQ6bdGV-aFtsD4vjzYrTTe0m-YSht4XvMJOQZmD9KVmrwYY3Nih0jS_yYocNVQtYjgFBJBSpPluGX-rRier_oqxqOu-Z5HWUXbq__PoShoFEUZbz6w69OpwhJVtSkPz5L3e4LwQ5s_L7fJq0enZmrLMvDhVpvBfYydwqI5qpGD6hNeKSspJPvHp6MCn9De9qNK1lSO7qVzgFYmEIuyyHZv7pIccZug2EBix6CuC5amKROeffpp3UZixiJuwoUoCIUNjyQd7ureym-y2Zd0HM-a64tt-9-JWezh8d_WHBmgqWoHlzJDJ-aOM6lzY6vR0mZY-Vptx4UvFYSl_7KiZxdKrGOIaddZfhzyAqZ9d65FAHTIOLGNaoQGsXq0ZXU36AoYEKHsQLWvxr2NcucgJ3r7xJ5wLTQ1liJvqjKKTPfdI3vjxVkFBF9ohuwkH3C8M3cQwAuBJT6a5N-dYAptmNujYBMHFWKl_xZ25XeiGqa7MZ_Q; CN03 guardrail aligned: allow-list expects deny for requester vpc-02ff4e20289c915b9","ReceiverVpcId":"vpc-071bf2e1e2416f266","RequesterInAllowList":false,"RequesterVpcId":"vpc-02ff4e20289c915b9","Stderr":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: 64199e08-eebc-4b7d-b37d-613a8dd93e12, api error UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:sts::211203495394:assumed-role/TerraformRole/GitHubActions is not authorized to perform: ec2:CreateVpcPeeringConnection on resource: arn:aws:ec2:us-east-1:211203495394:vpc-peering-connection/* with an explicit deny in an identity-based policy: arn:aws:iam::211203495394:policy/CN03PeeringGuardrail. Encoded authorization failure message: qeaXKOsXT16MALj6BjCNtXfR92h2J6tsKtFwZtpYtvQ0jwPdn9Nbdzt9LQbOe9wmz1NQzFr8ZN3WsO6oZCCxRENaLXNIWcYglf6zom0qcxLPb6ri7VC-HdxTgi7_lPJByYWXhTLcUM_IouIF0Hl8nZQxe-Gh2it3xnzv1HwPDH84ncfAzrej67XzZLLKNdm99Xc9bVK9hN1iddfBTB5wTeL1F6W-4neLUMgFWqc-CHAFfD1hD_0SfJEiCiD_E-YBmcwmBRAG-0_EacLVv4ZNEwzyzaec4Q6veyBwf21TsnmDVQ6bdGV-aFtsD4vjzYrTTe0m-YSht4XvMJOQZmD9KVmrwYY3Nih0jS_yYocNVQtYjgFBJBSpPluGX-rRier_oqxqOu-Z5HWUXbq__PoShoFEUZbz6w69OpwhJVtSkPz5L3e4LwQ5s_L7fJq0enZmrLMvDhVpvBfYydwqI5qpGD6hNeKSspJPvHp6MCn9De9qNK1lSO7qVzgFYmEIuyyHZv7pIccZug2EBix6CuC5amKROeffpp3UZixiJuwoUoCIUNjyQd7ureym-y2Zd0HM-a64tt-9-JWezh8d_WHBmgqWoHlzJDJ-aOM6lzY6vR0mZY-Vptx4UvFYSl_7KiZxdKrGOIaddZfhzyAqZ9d65FAHTIOLGNaoQGsXq0ZXU36AoYEKHsQLWvxr2NcucgJ3r7xJ5wLTQ1liJvqjKKTPfdI3vjxVkFBF9ohuwkH3C8M3cQwAuBJT6a5N-dYAptmNujYBMHFWKl_xZ25XeiGqa7MZ_Q"},{"AllowListDefined":true,"ConflictMessage":"","ConflictType":"","DryRunAllowed":false,"ErrorCode":"UnauthorizedOperation","ExitCode":1,"GuardrailExpectation":"deny","GuardrailMismatch":false,"Origin":"terraform-fixture","PeerOwnerId":"","PeerVpcId":"vpc-071bf2e1e2416f266","Reason":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: cd789670-09a9-4db2-a316-e01ab72a6da1, api error UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:sts::211203495394:assumed-role/TerraformRole/GitHubActions is not authorized to perform: ec2:CreateVpcPeeringConnection on resource: arn:aws:ec2:us-east-1:211203495394:vpc-peering-connection/* with an explicit deny in an identity-based policy: arn:aws:iam::211203495394:policy/CN03PeeringGuardrail. Encoded authorization failure message: O2bvTI9GnfEDDrMB8Ads3MoS8zHn1jlB_n2CTNrv8HyEd3WkK0nZf72hByt1txecmyTelqECyt3qq9aqmdfsHCqLFcu5Pah-IrNwgw1NMmFRsmdL99sQsdGwXVuan2R-F-uXNLASxakYSao5wstuk6V9UNyDtbewtObbF4frGJ5rJ0CYJ8ofsbpGgetVJRPUv7ZAw7fti0nbGOGRvFbWVZ4PMxhdienQhZAIrbVHuN4HULU7JZJjoWXqgV6GMXMitawEs0rWJ5rUGgF8Ymi57MIO0BSWLvNYPB0dO3wS9edcSl1bucZQck5w-95J1zF_LNPTAHyP3lYxkYPEDvIHpXH_nNAhKarJ6VofTQTnfRJsKBO3pxDV7skMRHT_q5zFF1w2SdAShDT5J1mdB0QU_4Zmz-nQbj6avW2SVPgh9KQLiI4ZAWqhPLqy1257Cz_INp3KCvVI9DTxZSXKwWTQn6t9X8JOozaPhJEh21KJGo8ijlGlvOqSln_JKacKa6mb0nRo6WgYCwJcCadqi9j4pJTFaHrLJDWBTZMaxy60NzC1LNEknsYCF3nizN4sg_i540aM1IeGePybv_vmpfUSosAAehvAF8Xz80xyOsXkldCO5zygIi97cDVnBt_BZXD1f2UurwOGjtz540PtqkH-CwinKn3M3lzuVaEe0pfv6LLYyKYuEL5avYqrYvftthmM80sW741-KD_CEJ6wX9f2MbXGMl0AXjNlysnXYVJ-FlktZtIC1MVI5hDMwoFgPtMNCIn14jINd3NJ80r79JhZ4W3tKTU; CN03 guardrail aligned: allow-list expects deny for requester vpc-0d617b955f0a44661","ReceiverVpcId":"vpc-071bf2e1e2416f266","RequesterInAllowList":false,"RequesterVpcId":"vpc-0d617b955f0a44661","Stderr":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: cd789670-09a9-4db2-a316-e01ab72a6da1, api error UnauthorizedOperation: You are not authorized to perform this operation. User: arn:aws:sts::211203495394:assumed-role/TerraformRole/GitHubActions is not authorized to perform: ec2:CreateVpcPeeringConnection on resource: arn:aws:ec2:us-east-1:211203495394:vpc-peering-connection/* with an explicit deny in an identity-based policy: arn:aws:iam::211203495394:policy/CN03PeeringGuardrail. Encoded authorization failure message: O2bvTI9GnfEDDrMB8Ads3MoS8zHn1jlB_n2CTNrv8HyEd3WkK0nZf72hByt1txecmyTelqECyt3qq9aqmdfsHCqLFcu5Pah-IrNwgw1NMmFRsmdL99sQsdGwXVuan2R-F-uXNLASxakYSao5wstuk6V9UNyDtbewtObbF4frGJ5rJ0CYJ8ofsbpGgetVJRPUv7ZAw7fti0nbGOGRvFbWVZ4PMxhdienQhZAIrbVHuN4HULU7JZJjoWXqgV6GMXMitawEs0rWJ5rUGgF8Ymi57MIO0BSWLvNYPB0dO3wS9edcSl1bucZQck5w-95J1zF_LNPTAHyP3lYxkYPEDvIHpXH_nNAhKarJ6VofTQTnfRJsKBO3pxDV7skMRHT_q5zFF1w2SdAShDT5J1mdB0QU_4Zmz-nQbj6avW2SVPgh9KQLiI4ZAWqhPLqy1257Cz_INp3KCvVI9DTxZSXKwWTQn6t9X8JOozaPhJEh21KJGo8ijlGlvOqSln_JKacKa6mb0nRo6WgYCwJcCadqi9j4pJTFaHrLJDWBTZMaxy60NzC1LNEknsYCF3nizN4sg_i540aM1IeGePybv_vmpfUSosAAehvAF8Xz80xyOsXkldCO5zygIi97cDVnBt_BZXD1f2UurwOGjtz540PtqkH-CwinKn3M3lzuVaEe0pfv6LLYyKYuEL5avYqrYvftthmM80sW741-KD_CEJ6wX9f2MbXGMl0AXjNlysnXYVJ-FlktZtIC1MVI5hDMwoFgPtMNCIn14jINd3NJ80r79JhZ4W3tKTU"}] Scenario: Enforcement proof (dry-run): non-allowlisted requester is denied even when not explicitly listed as disallowed
@vpc @tlp-amber @tlp-red @CCC.VPC.CN03 @CCC.VPC.CN03.AR01 @Destructive @MAIN @CCC.VPCGiven a cloud api for "{Instance}" in "api"29µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"133µs
And I refer to "{result}" as "vpcService"16µs
And I load environment variable "CN03_RECEIVER_VPC_ID" as "ReceiverVpcId"18µs
And I load environment variable "CN03_NON_ALLOWLISTED_REQUESTER_VPC_ID" as "NonAllowlistedRequesterVpcId"20µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"17µs
And "{ReceiverVpcId}" is not nil16µs
Given "{NonAllowlistedRequesterVpcId}" is not nil18µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"92µs
Then "{result.AllowedListDefined}" is true23µs
And "{result.Allowed}" is false20µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"357ms
Then "{result.DryRunAllowed}" is false38µs
And "{result.AllowListDefined}" is true24µs
And "{result.RequesterInAllowList}" is false23µs
And "{result.GuardrailExpectation}" is "deny"26µs
And "{result.GuardrailMismatch}" is false22µs
And "{result.ExitCode}" should be greater than "0"26µs
And "{result.Reason}" contains "guardrail aligned"26µs
And "{result.ConflictType}" is ""23µs