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"128µs
And I refer to "{result}" as "vpcService"21µs
And I load environment variable "CN03_RECEIVER_VPC_ID" as "ReceiverVpcId"29µ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"27µs
And "{ReceiverVpcId}" is not nil18µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"480ms
And I attach "{result.Summary}" to the test output as "Disallow-list Enforcement Summary"59µs
And I attach "{result.Results}" to the test output as "Disallow-list Enforcement"94µs
Then "{result.ListDefined}" is true41µs
And "{result.TestedCount}" should be greater than "0"64µs
And "{result.AllCorrect}" is true21µs
And "{result.ViolationCount}" is "0"33µ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-027ef85c88b9d68c2","Reason":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: f6dd6b90-9c38-4c52-b40d-a04075dacddc, 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: 60PAcZ7LfEphX2qR2_ZHcHynadWG7FEuzn7PfRlmmfTVl2Img3u6jZSoyFurR5xp480R2Og9pyDpUXzt1LwxbZeNBVvLkLoqkj1CR7ja7r6-2HgQrr5kKmEFjE1WoM0PZXIuSfSf6GlXUMI0KdziFyNRJxtfrXWfIlXjEDNPN4VRq_V2JqB0sTUF9KOIQ3-jyGycX9x2Oxvfl5A5dW4j0AuPN6rFyjI-b6aKbcKBeUg-PVVK-FqA0OUaWFkhEKo3B1nE_9llfJPDbDlkMfbnzwu_6onWzeHaILFG3i2ew9t1vCPiMcBhKC7A8GUzDsrbKMfFptxPJz9wDXpxhHv7tW70mX_VuzEoBDHZgQKEiKZ1VAODXqx_PBM-ov5xZ2nRHqh27o3yyaZYjzn_d8gm2Wj1fXLDSKIOWzCD3XOOLDud3J5xfx_xlXDA7gVk_koa02O3eQpFdum6ZmNctz97EZ11nE27YLepmD7qaqdpSDjkoVbagCk_G_nn2KDJy4fb5iFa1BXTrkoWiCxCnTeahC3XMFvjMCa7w_8rIx1mtvbzWGwODJe3oGoCgjX4bwgsHmNSgRwa5tiOZWvERFesjKknLsnYowdfUjwuJBtsJMEDLoAo151CTqTjoTe180qH-_KVqFqqIlGHq_o9RGXsNbqY0b8ETVoFN6YjxwKEfBfBDcEvbrHf05hgCIHKNDkxu7GGR4usUFBfulWDauzWLWE7a2JYx9vf6sbpooYPYDwO8Rw-1HQeMPouMaa3l91BA0HTJc0c6iGarR1FwvxY_rnd; CN03 guardrail aligned: allow-list expects deny for requester vpc-00ceb92e81affe793","ReceiverVpcId":"vpc-027ef85c88b9d68c2","RequesterInAllowList":false,"RequesterVpcId":"vpc-00ceb92e81affe793","Stderr":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: f6dd6b90-9c38-4c52-b40d-a04075dacddc, 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: 60PAcZ7LfEphX2qR2_ZHcHynadWG7FEuzn7PfRlmmfTVl2Img3u6jZSoyFurR5xp480R2Og9pyDpUXzt1LwxbZeNBVvLkLoqkj1CR7ja7r6-2HgQrr5kKmEFjE1WoM0PZXIuSfSf6GlXUMI0KdziFyNRJxtfrXWfIlXjEDNPN4VRq_V2JqB0sTUF9KOIQ3-jyGycX9x2Oxvfl5A5dW4j0AuPN6rFyjI-b6aKbcKBeUg-PVVK-FqA0OUaWFkhEKo3B1nE_9llfJPDbDlkMfbnzwu_6onWzeHaILFG3i2ew9t1vCPiMcBhKC7A8GUzDsrbKMfFptxPJz9wDXpxhHv7tW70mX_VuzEoBDHZgQKEiKZ1VAODXqx_PBM-ov5xZ2nRHqh27o3yyaZYjzn_d8gm2Wj1fXLDSKIOWzCD3XOOLDud3J5xfx_xlXDA7gVk_koa02O3eQpFdum6ZmNctz97EZ11nE27YLepmD7qaqdpSDjkoVbagCk_G_nn2KDJy4fb5iFa1BXTrkoWiCxCnTeahC3XMFvjMCa7w_8rIx1mtvbzWGwODJe3oGoCgjX4bwgsHmNSgRwa5tiOZWvERFesjKknLsnYowdfUjwuJBtsJMEDLoAo151CTqTjoTe180qH-_KVqFqqIlGHq_o9RGXsNbqY0b8ETVoFN6YjxwKEfBfBDcEvbrHf05hgCIHKNDkxu7GGR4usUFBfulWDauzWLWE7a2JYx9vf6sbpooYPYDwO8Rw-1HQeMPouMaa3l91BA0HTJc0c6iGarR1FwvxY_rnd"},{"AllowListDefined":true,"ConflictMessage":"","ConflictType":"","DryRunAllowed":false,"ErrorCode":"UnauthorizedOperation","ExitCode":1,"GuardrailExpectation":"deny","GuardrailMismatch":false,"Origin":"terraform-fixture","PeerOwnerId":"","PeerVpcId":"vpc-027ef85c88b9d68c2","Reason":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: 136752e7-dd92-4012-badb-319ace10d036, 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: R5cX6f2JKqkGMXWJaZRh497Im78s1lSjaJLYKk7z1p_RgT4n0TzPCSdLMvl7QXjb-dKuhkpiga97kHRtGD_gORAzHP7O7KOfC7e9q2SxRtyNUmucJ_Cey_44Q8D2VpqBbOdECUsylDhRu3zmPqFcqyahkzfDvkpEJwg-_WfZMRAuWPHG8zK2fEvzvvdmvdxG8oPInFYRGNULLaZQJdjU6DqlB1cb6qn71SInIIGzv8NB7P8R1TzI9gHJiehKS7sH_84A1uEI-VGUOiPS-MEO6AzpFKX41KRalSYro3yEK6aqR2P9K2sltHNlEOS_uAwWjSH6zWD313Kw5NPaFtXIFiV3TKVvfcZTvOnlmNkh-G1bXKYdoQdhLWklFIfOHQPUaQyEJnVRJhtFEg79gUL9hd2trTGTjNnOZfQWRkebvFccPFvMCieexvfxIR__poJUR-T4BpxMssmyobRZQ1NlfnMo7p2M1PRzbegQ6G4_1A7NIp_DzQEZ5mSx_aTM3V07SoQ2gKi0gOhbzMZasFBHhEgdRZEE6ONdOiQUgRprsHv06MmzxEbJCWh3fA1Lz81Ghr8Pa9l15yI4N3IXVFkuQcSKMOw1bFAbE91ARgGGwaDJCpqyg9SAi20WwknZcXi56I3MmUIt68UK2VZcKIAbL15YvYxphfQ4Qw8fLIrVqMdOD_0eGspLqqYEAwlt7wd-QHS2Nyq4Tr2rVscHio9XuSlxGYYf0bZeGpvhOnTqYTWBwA4qy9dz8JnuX46vzBQ1BIuPM3H-ca37VYAI22v5GV6V; CN03 guardrail aligned: allow-list expects deny for requester vpc-03e0763d329ec1a53","ReceiverVpcId":"vpc-027ef85c88b9d68c2","RequesterInAllowList":false,"RequesterVpcId":"vpc-03e0763d329ec1a53","Stderr":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: 136752e7-dd92-4012-badb-319ace10d036, 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: R5cX6f2JKqkGMXWJaZRh497Im78s1lSjaJLYKk7z1p_RgT4n0TzPCSdLMvl7QXjb-dKuhkpiga97kHRtGD_gORAzHP7O7KOfC7e9q2SxRtyNUmucJ_Cey_44Q8D2VpqBbOdECUsylDhRu3zmPqFcqyahkzfDvkpEJwg-_WfZMRAuWPHG8zK2fEvzvvdmvdxG8oPInFYRGNULLaZQJdjU6DqlB1cb6qn71SInIIGzv8NB7P8R1TzI9gHJiehKS7sH_84A1uEI-VGUOiPS-MEO6AzpFKX41KRalSYro3yEK6aqR2P9K2sltHNlEOS_uAwWjSH6zWD313Kw5NPaFtXIFiV3TKVvfcZTvOnlmNkh-G1bXKYdoQdhLWklFIfOHQPUaQyEJnVRJhtFEg79gUL9hd2trTGTjNnOZfQWRkebvFccPFvMCieexvfxIR__poJUR-T4BpxMssmyobRZQ1NlfnMo7p2M1PRzbegQ6G4_1A7NIp_DzQEZ5mSx_aTM3V07SoQ2gKi0gOhbzMZasFBHhEgdRZEE6ONdOiQUgRprsHv06MmzxEbJCWh3fA1Lz81Ghr8Pa9l15yI4N3IXVFkuQcSKMOw1bFAbE91ARgGGwaDJCpqyg9SAi20WwknZcXi56I3MmUIt68UK2VZcKIAbL15YvYxphfQ4Qw8fLIrVqMdOD_0eGspLqqYEAwlt7wd-QHS2Nyq4Tr2rVscHio9XuSlxGYYf0bZeGpvhOnTqYTWBwA4qy9dz8JnuX46vzBQ1BIuPM3H-ca37VYAI22v5GV6V"}] 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"43µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"124µs
And I refer to "{result}" as "vpcService"15µs
And I load environment variable "CN03_RECEIVER_VPC_ID" as "ReceiverVpcId"16µs
And I load environment variable "CN03_NON_ALLOWLISTED_REQUESTER_VPC_ID" as "NonAllowlistedRequesterVpcId"19µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"31µs
And "{ReceiverVpcId}" is not nil17µs
Given "{NonAllowlistedRequesterVpcId}" is not nil16µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"107µs
Then "{result.AllowedListDefined}" is true23µs
And "{result.Allowed}" is false36µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"334ms
Then "{result.DryRunAllowed}" is false53µs
And "{result.AllowListDefined}" is true28µs
And "{result.RequesterInAllowList}" is false46µs
And "{result.GuardrailExpectation}" is "deny"32µs
And "{result.GuardrailMismatch}" is false38µs
And "{result.ExitCode}" should be greater than "0"71µs
And "{result.Reason}" contains "guardrail aligned"46µs
And "{result.ConflictType}" is ""28µs