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"52µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"140µs
And I refer to "{result}" as "vpcService"16µ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"17µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"14µs
And "{ReceiverVpcId}" is not nil16µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"221ms
And I attach "{result.Summary}" to the test output as "Disallow-list Enforcement Summary"55µs
And I attach "{result.Results}" to the test output as "Disallow-list Enforcement"94µs
Then "{result.ListDefined}" is true31µs
And "{result.TestedCount}" should be greater than "0"34µs
And "{result.AllCorrect}" is true19µs
And "{result.ViolationCount}" is "0"19µ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: ba930b51-6574-4677-8f9b-c566317da315, 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: b1qElrl4JDucsQdvT3LpuCS8xLTEsj69_ke8hZciY_rWjaVqKDhOod4hCzLCjwiObqImJEZALV3d0sZY3XuunN9M5eg8cBpS1tPljQo2-YgbQNQINfSwSUoEOqkTXu2oc8KwaUVTMuHhCaEmGG_uwFmdxQbhoGlI5T4RcFDpR-0CB417nYpZ7Ts5fpiE3ZWMTl2JcRYx5tDTT2lvihoU3Jt6PbQZSik6vlnJ2n2ZrP5oWaaeKcNpKsaKUiHrDC0u3Ll3FI0gkVedeJ4-08S2olQXMhhpg98s9j6RNiIdgKt575nVRFDV8EleL33wdHhgdVuVQf04DcP3bFYEnSBpy9yJjrYp_Dk-XWglhP4Zuc6sdonbxlhwxGUFCttX8T14SMTRu2v_vNhCBdTp-n7tJy16spI3rXx7e0AP9UMRGnilpXOWPNF2T0wDPPutdtOKaMrPzXzEGxN1JV_v1JBvYHlsW4sn6CDr5Hc_0NKFci7M82M-Q0ZUN-bxkab1SuCEII0_k9muetA2hhVxHWl9ipr5MS6rYQf3mtllUiO3AQwTSoZ23yUj7Hc3_cXcTrC_mNEr2Umr2clA5O2HDiLYokFtprmUy2VUqWlxg3uRdvJCdoO9MmxxJo3mG2TSAmh-lyXfDqmZw3q2fASVxj5-wom2RKifMYmQu-Yu2T52Y4moBr3NXewO4BIJZi0FwHlCf_EdXvXrM9bqirnDCnTDnmkskdSAih8H-wHsatCF5zGTw2Wyz_cq9dmL00ymsgXjDwmNB-lfOj1MbJHvGh0FCGT5; 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: ba930b51-6574-4677-8f9b-c566317da315, 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: b1qElrl4JDucsQdvT3LpuCS8xLTEsj69_ke8hZciY_rWjaVqKDhOod4hCzLCjwiObqImJEZALV3d0sZY3XuunN9M5eg8cBpS1tPljQo2-YgbQNQINfSwSUoEOqkTXu2oc8KwaUVTMuHhCaEmGG_uwFmdxQbhoGlI5T4RcFDpR-0CB417nYpZ7Ts5fpiE3ZWMTl2JcRYx5tDTT2lvihoU3Jt6PbQZSik6vlnJ2n2ZrP5oWaaeKcNpKsaKUiHrDC0u3Ll3FI0gkVedeJ4-08S2olQXMhhpg98s9j6RNiIdgKt575nVRFDV8EleL33wdHhgdVuVQf04DcP3bFYEnSBpy9yJjrYp_Dk-XWglhP4Zuc6sdonbxlhwxGUFCttX8T14SMTRu2v_vNhCBdTp-n7tJy16spI3rXx7e0AP9UMRGnilpXOWPNF2T0wDPPutdtOKaMrPzXzEGxN1JV_v1JBvYHlsW4sn6CDr5Hc_0NKFci7M82M-Q0ZUN-bxkab1SuCEII0_k9muetA2hhVxHWl9ipr5MS6rYQf3mtllUiO3AQwTSoZ23yUj7Hc3_cXcTrC_mNEr2Umr2clA5O2HDiLYokFtprmUy2VUqWlxg3uRdvJCdoO9MmxxJo3mG2TSAmh-lyXfDqmZw3q2fASVxj5-wom2RKifMYmQu-Yu2T52Y4moBr3NXewO4BIJZi0FwHlCf_EdXvXrM9bqirnDCnTDnmkskdSAih8H-wHsatCF5zGTw2Wyz_cq9dmL00ymsgXjDwmNB-lfOj1MbJHvGh0FCGT5"},{"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: dd6c1705-0c47-4f43-b6a2-14f9db59fb0d, 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: rxTl5TVJPeMmf1pLCtLoMKsArK6_tLB3DBv_mJM8kzrC0kLaa3cxXdKzIyPk11a3JPBzlEFzgKA2PPJZyOa2PBpVAbzujY2v3QrMmkdFHSUbm69x_HVBCfzZZfm_a6vs-jGIopFEDvk4xR9Y_Q16to24_zQeaordrEK9y5oSGm2LyIfv_ZNa-kT9iBBDn6Fdkt6UV7uV5Ui874lCiQjenubYepSaQK4eK8t2jKliRikABxhLkncFWGgzXc7qeFvPLGZ3i5CLSSVooTFIkLehNemF2ZPRLc_j_WrPAdxZui-QMsT2FDLxYZQzpORHWnmanaKHcvKeTiYl7B6pr7_aHL2FdCE0NG3wBlWY2uavk-JWYTYaaKlLCQs1qgjM9taVeeQIrbrfn6AfDTd6gDOcebLX1kN9W0KXYlINr9yp_jxJD7rpglhWT-3kUHzbUeivJZCpySbe-B-1zSf4VenSSZgic_eHFAX1uBlVksC1CRmk1lGU9r8b5nGTanXMvtVJlcP_OefeZzNvPzRj947w-LheeUT_AA0B2IYqQUS04bBnEVzoHmaXir5HgifGThJSEGejRHlmfdZpLtlW6RDV2tBIHJH18IylQiAc8JSkSlJHNF9a03TDs5m5xpCYeHBt04PtZHs2cVzx9iLFnwLnenPOCpUip-R1TCjWDpdZea9CCah3gIDXKdillrbMigfPVfVHw6b3E6c7qp83rpFVx6RPcwZ3FpzF5nbMSA9C-OWOkiDeJmMewwYeY_jkddQc8J5OW9nGeVX97DFerZ3a4ITd; 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: dd6c1705-0c47-4f43-b6a2-14f9db59fb0d, 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: rxTl5TVJPeMmf1pLCtLoMKsArK6_tLB3DBv_mJM8kzrC0kLaa3cxXdKzIyPk11a3JPBzlEFzgKA2PPJZyOa2PBpVAbzujY2v3QrMmkdFHSUbm69x_HVBCfzZZfm_a6vs-jGIopFEDvk4xR9Y_Q16to24_zQeaordrEK9y5oSGm2LyIfv_ZNa-kT9iBBDn6Fdkt6UV7uV5Ui874lCiQjenubYepSaQK4eK8t2jKliRikABxhLkncFWGgzXc7qeFvPLGZ3i5CLSSVooTFIkLehNemF2ZPRLc_j_WrPAdxZui-QMsT2FDLxYZQzpORHWnmanaKHcvKeTiYl7B6pr7_aHL2FdCE0NG3wBlWY2uavk-JWYTYaaKlLCQs1qgjM9taVeeQIrbrfn6AfDTd6gDOcebLX1kN9W0KXYlINr9yp_jxJD7rpglhWT-3kUHzbUeivJZCpySbe-B-1zSf4VenSSZgic_eHFAX1uBlVksC1CRmk1lGU9r8b5nGTanXMvtVJlcP_OefeZzNvPzRj947w-LheeUT_AA0B2IYqQUS04bBnEVzoHmaXir5HgifGThJSEGejRHlmfdZpLtlW6RDV2tBIHJH18IylQiAc8JSkSlJHNF9a03TDs5m5xpCYeHBt04PtZHs2cVzx9iLFnwLnenPOCpUip-R1TCjWDpdZea9CCah3gIDXKdillrbMigfPVfVHw6b3E6c7qp83rpFVx6RPcwZ3FpzF5nbMSA9C-OWOkiDeJmMewwYeY_jkddQc8J5OW9nGeVX97DFerZ3a4ITd"}] 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"232µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"118µs
And I refer to "{result}" as "vpcService"16µ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"14µs
And "{ReceiverVpcId}" is not nil16µs
Given "{NonAllowlistedRequesterVpcId}" is not nil17µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"88µs
Then "{result.AllowedListDefined}" is true22µs
And "{result.Allowed}" is false18µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"107ms
Then "{result.DryRunAllowed}" is false36µs
And "{result.AllowListDefined}" is true22µs
And "{result.RequesterInAllowList}" is false21µs
And "{result.GuardrailExpectation}" is "deny"22µs
And "{result.GuardrailMismatch}" is false19µs
And "{result.ExitCode}" should be greater than "0"22µs
And "{result.Reason}" contains "guardrail aligned"22µs
And "{result.ConflictType}" is ""20µs