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"121µs
And I refer to "{result}" as "vpcService"20µs
And I load environment variable "CN03_RECEIVER_VPC_ID" as "ReceiverVpcId"25µs
And I load environment variable "CN03_NON_ALLOWLISTED_REQUESTER_VPC_ID" as "NonAllowlistedRequesterVpcId"28µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"26µs
And "{ReceiverVpcId}" is not nil23µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"172ms
And I attach "{result.Summary}" to the test output as "Disallow-list Enforcement Summary"43µs
And I attach "{result.Results}" to the test output as "Disallow-list Enforcement"84µs
Then "{result.ListDefined}" is true28µs
And "{result.TestedCount}" should be greater than "0"37µs
And "{result.AllCorrect}" is true27µs
And "{result.ViolationCount}" is "0"32µ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 (6439 bytes)
[{"AllowListDefined":true,"ConflictMessage":"","ConflictType":"","DryRunAllowed":false,"ErrorCode":"UnauthorizedOperation","ExitCode":1,"GuardrailExpectation":"deny","GuardrailMismatch":false,"Origin":"terraform-fixture","PeerOwnerId":"","PeerVpcId":"vpc-05f4e0d1e4eccf07f","Reason":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: e6fba93a-9529-4641-b0d2-fe321e2b5322, 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: 7MYKlHO5uUieyUXsklJ7bUIL9ZApGbEUnwlUSq5Cc4aUAIjWxs696Mr1hg2XV9q3VQsr8QUVhGKsxOxouq3ZupcBActoX6Z9P_6cWA7CJ1it1pE9v-76YyNBJ4D0hp794zcQBS7hP73PZIcqX9N5mjS12KVOtDgZkC7LJS3fC4xPd2-pTKHG0s6wPYvW6fxPBj7PvNzlrGuZrUGTIayWM0lKbGIsa836ZN364UXsV2ncTfZBFkaBPobaqrBOithNFrnf-Z1w2SEfXLqjmObHOnnwInrvxbgXCK5iKyrih9Jp9TU3X_stn2DGNw6s9WLfNKXypgq_yfVITiRRXmM1iGMolBEyj6AAMJz3MT_NmC4MWwz-2GSK88_CI5Uha0g_bkjcd_49QttpB3nVGIDLjNXHybVq1UpBCk1YxP-L4hjZigpenykFgyQNoqw3BuatLVwlwLm_R4gmaiscuWlm8jRyun0o_eYs62-E9oy3euO58iybbkeYkmdhgKF9XK3wwbalApXwhhrz2u6lXmVCFXwrN0i5ubscJ7zvtSc_O0V2W6_-uUiJYqXywi1jLtaKW0rHsjgmOsZ09KjyMOOZAR9K-AZp4aRMIJVT48iSUNG9MowmAOrzFSglI4b3AiRYGHAzhQE_cOS81LPoMamH2EIjbCaJ2MPiNPaXofJErIcuGP8sF6DHJFuWUckbdYKbljY8fSpklqiYNwoJhx0P88m5YL3riXVoBybvvJQkUvNOw46ZTGzrAm5nKPIL5I0hxtTmTaVAeoAgjmULSSLV2q17; CN03 guardrail aligned: allow-list expects deny for requester vpc-0351e15653a529b6c","ReceiverVpcId":"vpc-05f4e0d1e4eccf07f","RequesterInAllowList":false,"RequesterVpcId":"vpc-0351e15653a529b6c","Stderr":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: e6fba93a-9529-4641-b0d2-fe321e2b5322, 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: 7MYKlHO5uUieyUXsklJ7bUIL9ZApGbEUnwlUSq5Cc4aUAIjWxs696Mr1hg2XV9q3VQsr8QUVhGKsxOxouq3ZupcBActoX6Z9P_6cWA7CJ1it1pE9v-76YyNBJ4D0hp794zcQBS7hP73PZIcqX9N5mjS12KVOtDgZkC7LJS3fC4xPd2-pTKHG0s6wPYvW6fxPBj7PvNzlrGuZrUGTIayWM0lKbGIsa836ZN364UXsV2ncTfZBFkaBPobaqrBOithNFrnf-Z1w2SEfXLqjmObHOnnwInrvxbgXCK5iKyrih9Jp9TU3X_stn2DGNw6s9WLfNKXypgq_yfVITiRRXmM1iGMolBEyj6AAMJz3MT_NmC4MWwz-2GSK88_CI5Uha0g_bkjcd_49QttpB3nVGIDLjNXHybVq1UpBCk1YxP-L4hjZigpenykFgyQNoqw3BuatLVwlwLm_R4gmaiscuWlm8jRyun0o_eYs62-E9oy3euO58iybbkeYkmdhgKF9XK3wwbalApXwhhrz2u6lXmVCFXwrN0i5ubscJ7zvtSc_O0V2W6_-uUiJYqXywi1jLtaKW0rHsjgmOsZ09KjyMOOZAR9K-AZp4aRMIJVT48iSUNG9MowmAOrzFSglI4b3AiRYGHAzhQE_cOS81LPoMamH2EIjbCaJ2MPiNPaXofJErIcuGP8sF6DHJFuWUckbdYKbljY8fSpklqiYNwoJhx0P88m5YL3riXVoBybvvJQkUvNOw46ZTGzrAm5nKPIL5I0hxtTmTaVAeoAgjmULSSLV2q17"},{"AllowListDefined":true,"ConflictMessage":"","ConflictType":"","DryRunAllowed":false,"ErrorCode":"UnauthorizedOperation","ExitCode":1,"GuardrailExpectation":"deny","GuardrailMismatch":false,"Origin":"terraform-fixture","PeerOwnerId":"","PeerVpcId":"vpc-05f4e0d1e4eccf07f","Reason":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: 413c0a87-1954-460a-a85f-9a2da2ddf805, 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: 8-ZOc6-Vj0RFheMNTHMS7lZ3BRLP_64khtdmEeP9FSbwgYi9_x2qcIIVLdMHJl_aBG4vemxVnSVrhxoCkBVJTt6PN1yzugCxumNi1Erc3aBPlZvtDpNJ32o8Q3z5yb4Cn6e_LjDoopYpMh3VMwImPIcogv2CaDtryY3k6sYtHLap5pLazO_97pC3DdOvOpCMhzr1DDyPMybdm5NEwkKQ3ir1neQHla7KvK2H6nOYKpVdTFb2Z84RQGhUfN-LVTwjHRLR7K6yZ74AlfNvH9Ul1PVbW7_fxrgQK0JYwZH-9VOzj5CzH4Kuk0SC3h8A2txqk1-jsYlPOn8KE8FJGxrNNC0YGf0Arhfh4-uQTMcYMfypOMKf2ByyHsVe7PyUtEWnoyCH78pDXFtSkNv-3YfstIa9jRE7_jPn5TxumOzU0HmHB4UzXc2o5-lGae0PLi-HXzdDGelIJFQGUQd-sFROm-0g6QfWo3ftC6_g7RWkxXIKiIPidFUOrU1y5YXuFz-3srDk7cLUKgKZqTPSGb-YHLcOjLxazhXeEBvsobc-txrfRaTyCt8Gm5FFF2qU0D4k3OGxPiy6aUAzVvJTVccA6qzeJFdMeJcovPXdj7YzNVijn1jqZg6CV0jTlT-DBaSoGhlds3KjlrsuE1UasiC8gBFs9pJ-UrUMpNY85Xj2W9ZbBvvjdkJSvN6XvVaCHYZ1V0GOr1ANjewXYlDNm4myzuicjPO8Bonq8wzxk5mH7KJPIY5JYHlc7Xy3kORgptw892lUjWk3shCevxZR7SdJ9k93; CN03 guardrail aligned: allow-list expects deny for requester vpc-0fd941576fc1de4a0","ReceiverVpcId":"vpc-05f4e0d1e4eccf07f","RequesterInAllowList":false,"RequesterVpcId":"vpc-0fd941576fc1de4a0","Stderr":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: 413c0a87-1954-460a-a85f-9a2da2ddf805, 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: 8-ZOc6-Vj0RFheMNTHMS7lZ3BRLP_64khtdmEeP9FSbwgYi9_x2qcIIVLdMHJl_aBG4vemxVnSVrhxoCkBVJTt6PN1yzugCxumNi1Erc3aBPlZvtDpNJ32o8Q3z5yb4Cn6e_LjDoopYpMh3VMwImPIcogv2CaDtryY3k6sYtHLap5pLazO_97pC3DdOvOpCMhzr1DDyPMybdm5NEwkKQ3ir1neQHla7KvK2H6nOYKpVdTFb2Z84RQGhUfN-LVTwjHRLR7K6yZ74AlfNvH9Ul1PVbW7_fxrgQK0JYwZH-9VOzj5CzH4Kuk0SC3h8A2txqk1-jsYlPOn8KE8FJGxrNNC0YGf0Arhfh4-uQTMcYMfypOMKf2ByyHsVe7PyUtEWnoyCH78pDXFtSkNv-3YfstIa9jRE7_jPn5TxumOzU0HmHB4UzXc2o5-lGae0PLi-HXzdDGelIJFQGUQd-sFROm-0g6QfWo3ftC6_g7RWkxXIKiIPidFUOrU1y5YXuFz-3srDk7cLUKgKZqTPSGb-YHLcOjLxazhXeEBvsobc-txrfRaTyCt8Gm5FFF2qU0D4k3OGxPiy6aUAzVvJTVccA6qzeJFdMeJcovPXdj7YzNVijn1jqZg6CV0jTlT-DBaSoGhlds3KjlrsuE1UasiC8gBFs9pJ-UrUMpNY85Xj2W9ZbBvvjdkJSvN6XvVaCHYZ1V0GOr1ANjewXYlDNm4myzuicjPO8Bonq8wzxk5mH7KJPIY5JYHlc7Xy3kORgptw892lUjWk3shCevxZR7SdJ9k93"}] 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"40µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"143µs
And I refer to "{result}" as "vpcService"21µs
And I load environment variable "CN03_RECEIVER_VPC_ID" as "ReceiverVpcId"20µ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 nil18µs
Given "{NonAllowlistedRequesterVpcId}" is not nil18µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"90µs
Then "{result.AllowedListDefined}" is true21µs
And "{result.Allowed}" is false37µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"72ms
Then "{result.DryRunAllowed}" is false34µs
And "{result.AllowListDefined}" is true21µs
And "{result.RequesterInAllowList}" is false19µs
And "{result.GuardrailExpectation}" is "deny"21µs
And "{result.GuardrailMismatch}" is false19µs
And "{result.ExitCode}" should be greater than "0"24µs
And "{result.Reason}" contains "guardrail aligned"22µs
And "{result.ConflictType}" is ""19µs