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"74µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"228µs
And I refer to "{result}" as "vpcService"24µs
And I load environment variable "CN03_RECEIVER_VPC_ID" as "ReceiverVpcId"26µs
And I load environment variable "CN03_NON_ALLOWLISTED_REQUESTER_VPC_ID" as "NonAllowlistedRequesterVpcId"35µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"24µs
And "{ReceiverVpcId}" is not nil20µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"198ms
And I attach "{result.Summary}" to the test output as "Disallow-list Enforcement Summary"48µs
And I attach "{result.Results}" to the test output as "Disallow-list Enforcement"79µs
Then "{result.ListDefined}" is true32µs
And "{result.TestedCount}" should be greater than "0"34µs
And "{result.AllCorrect}" is true19µs
And "{result.ViolationCount}" is "0"21µ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 (6443 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: 5ee7c87f-1045-4ed2-94c5-a39c3345583b, 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: dkbmQQu9ZtNEyUIL4GmGYmtQL-jSZj0qw9TxsTYimd_sG9kEc_PKOcfKuY7T2QzEqapRqKGYCUg0kANzImUkXgpqSh6K8ODBUecfgf_Jz_16t_KwJNCoV_RC6niExxInpsL3J8NOBbOKtSpuKVPt2gGhrXUKZFWf3_-4gl1Gv94lUQYkVJcyhSCGthq4BhLqme9L_CWLTHI7qjIJ2xf0RPA0uw1fDlv7HaRhmyjD_PgrJGGUW9F8ComE2EysthAdo0RTGmV-_lPJvnqmX4nnjjGg4g-S0DfxlvjhG3p8QMrl56DFGMNQOTPZkPEr_P1IE3_bpO_CAfYGozD8cWgMhjPO43Iu4rOb6vC4Na82cfucja1BRTU5TjDYDmEQE7DF7KpeZvC5hwpE-82V8HlE1phoa5f3zR88wJuk7_Um62h9MHz18TYKmZwhWNatVA6g3wdhwXH7ZwNCN08xwoV22GH-IAXJ0K_aZ0z5MuaYJsCpKQVyJGczJi8BNkdi4RiSBlp0l7yG4nr398gLYOnnYXf8iDp7sY1DJog-uW3X6B3GrDW6RndcqC0uaQKvIiOzfpq6Xe73JEZsydBkISUA6PUD8TPyDdANFTYQ_IbgI3RxxGztuctgTfxFbptT_V-cktcOKloOeZ2jpon254oZ_fCsNWoyU8aeK_CgWt2UTYs7Z85dbaa-I-Ywf8joAQfyTr9_x-bQov_vrlBOYmuB7Blo-6jrvQXzE7mb0quh_c1IEcfofI120z2mwbV1TgSieuB3Yvt8QjcE5KWm_MTjZ2US; 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: 5ee7c87f-1045-4ed2-94c5-a39c3345583b, 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: dkbmQQu9ZtNEyUIL4GmGYmtQL-jSZj0qw9TxsTYimd_sG9kEc_PKOcfKuY7T2QzEqapRqKGYCUg0kANzImUkXgpqSh6K8ODBUecfgf_Jz_16t_KwJNCoV_RC6niExxInpsL3J8NOBbOKtSpuKVPt2gGhrXUKZFWf3_-4gl1Gv94lUQYkVJcyhSCGthq4BhLqme9L_CWLTHI7qjIJ2xf0RPA0uw1fDlv7HaRhmyjD_PgrJGGUW9F8ComE2EysthAdo0RTGmV-_lPJvnqmX4nnjjGg4g-S0DfxlvjhG3p8QMrl56DFGMNQOTPZkPEr_P1IE3_bpO_CAfYGozD8cWgMhjPO43Iu4rOb6vC4Na82cfucja1BRTU5TjDYDmEQE7DF7KpeZvC5hwpE-82V8HlE1phoa5f3zR88wJuk7_Um62h9MHz18TYKmZwhWNatVA6g3wdhwXH7ZwNCN08xwoV22GH-IAXJ0K_aZ0z5MuaYJsCpKQVyJGczJi8BNkdi4RiSBlp0l7yG4nr398gLYOnnYXf8iDp7sY1DJog-uW3X6B3GrDW6RndcqC0uaQKvIiOzfpq6Xe73JEZsydBkISUA6PUD8TPyDdANFTYQ_IbgI3RxxGztuctgTfxFbptT_V-cktcOKloOeZ2jpon254oZ_fCsNWoyU8aeK_CgWt2UTYs7Z85dbaa-I-Ywf8joAQfyTr9_x-bQov_vrlBOYmuB7Blo-6jrvQXzE7mb0quh_c1IEcfofI120z2mwbV1TgSieuB3Yvt8QjcE5KWm_MTjZ2US"},{"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: 270139ef-27e2-4b46-b754-005a57dc6f16, 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: HFDbHV80j3yLcZf_ZesazMAtBVtVpqFDdYuOhy_YVMvQmUs5C-VlItE7zQqyWCnewqbO2SMReKzxBtf5DAb0fAMyS4ecloUiHLLIaCD99xYYH9LyLdqx3mKDR9z_F6AFfbbemk4eriXgtT6AmVqiVINNv4aOMIbBYXCjCBZSy4dk_w1b0B9mxXVV-a8crNU712hD0EhgFDQrg6Bc4lNqKIEftQsIeHOKq1bJJJCOA34y0NBXni83vpa1hrtgMxDv2wXxH7C-MCSSTurNwbO4QF_uP4mkhdS7LT37MiTVAAJcvEmEvy0TNvDNZ6lziZrRJPLKearH6QEUKKLXH5dWlj8SP8Mjj_OZYXgyW8OmydHCKIckvDAgukk2bQLeq20ZuIv5VZ-AvSERsgjqKlUI6ih-jrTriLKphmkT2omrkvulH3TM3r8OpJeDMkwZaTtzy5WwJA2nMqXemM8OlG7XUsMkIimKUJdoN2CruPRgqfCnUtz5qfNlObWymDqVIdK3cWD7rd9rAAvAA9RngMFNK6M52ZGLd4sJUwWCrlnzcYswrVRjuxzU3xdP5slbdh78lUCdpoak0SClYmq2wHVU29T-eYvoUI71XMbg9PUPhECIAsHwyPH4FQMbqf6gajJ2vLuPSt-xWDV8Tr52QLOT9CpB9-9lqycxBBP6elI0A2Q8psi6jtT9U7re8-Ylwz6A7k-eEW4yyLqPzMyWnMvU4XcL8m2kqm8ONyWeYEcOEAW8f79R2Dzpz_ga78wnCZyW6U4rPA_g6eH8p84k_jmHPBFN9A; 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: 270139ef-27e2-4b46-b754-005a57dc6f16, 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: HFDbHV80j3yLcZf_ZesazMAtBVtVpqFDdYuOhy_YVMvQmUs5C-VlItE7zQqyWCnewqbO2SMReKzxBtf5DAb0fAMyS4ecloUiHLLIaCD99xYYH9LyLdqx3mKDR9z_F6AFfbbemk4eriXgtT6AmVqiVINNv4aOMIbBYXCjCBZSy4dk_w1b0B9mxXVV-a8crNU712hD0EhgFDQrg6Bc4lNqKIEftQsIeHOKq1bJJJCOA34y0NBXni83vpa1hrtgMxDv2wXxH7C-MCSSTurNwbO4QF_uP4mkhdS7LT37MiTVAAJcvEmEvy0TNvDNZ6lziZrRJPLKearH6QEUKKLXH5dWlj8SP8Mjj_OZYXgyW8OmydHCKIckvDAgukk2bQLeq20ZuIv5VZ-AvSERsgjqKlUI6ih-jrTriLKphmkT2omrkvulH3TM3r8OpJeDMkwZaTtzy5WwJA2nMqXemM8OlG7XUsMkIimKUJdoN2CruPRgqfCnUtz5qfNlObWymDqVIdK3cWD7rd9rAAvAA9RngMFNK6M52ZGLd4sJUwWCrlnzcYswrVRjuxzU3xdP5slbdh78lUCdpoak0SClYmq2wHVU29T-eYvoUI71XMbg9PUPhECIAsHwyPH4FQMbqf6gajJ2vLuPSt-xWDV8Tr52QLOT9CpB9-9lqycxBBP6elI0A2Q8psi6jtT9U7re8-Ylwz6A7k-eEW4yyLqPzMyWnMvU4XcL8m2kqm8ONyWeYEcOEAW8f79R2Dzpz_ga78wnCZyW6U4rPA_g6eH8p84k_jmHPBFN9A"}] 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"26µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"130µs
And I refer to "{result}" as "vpcService"14µs
And I load environment variable "CN03_RECEIVER_VPC_ID" as "ReceiverVpcId"17µ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"16µs
And "{ReceiverVpcId}" is not nil16µs
Given "{NonAllowlistedRequesterVpcId}" is not nil20µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"92µs
Then "{result.AllowedListDefined}" is true22µs
And "{result.Allowed}" is false22µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"187ms
Then "{result.DryRunAllowed}" is false38µs
And "{result.AllowListDefined}" is true22µs
And "{result.RequesterInAllowList}" is false21µs
And "{result.GuardrailExpectation}" is "deny"26µs
And "{result.GuardrailMismatch}" is false18µs
And "{result.ExitCode}" should be greater than "0"24µs
And "{result.Reason}" contains "guardrail aligned"22µs
And "{result.ConflictType}" is ""20µs