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"15µ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"29µs
And "{ReceiverVpcId}" is not nil20µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"502ms
And I attach "{result.Summary}" to the test output as "Disallow-list Enforcement Summary"64µs
And I attach "{result.Results}" to the test output as "Disallow-list Enforcement"111µs
Then "{result.ListDefined}" is true43µs
And "{result.TestedCount}" should be greater than "0"30µs
And "{result.AllCorrect}" is true20µs
And "{result.ViolationCount}" is "0"38µ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 (6451 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: ef71c437-4f55-4ad4-a4ef-7d935ae601de, 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: OihlRvadaLmOG5MhV9tSEqYRxNRPo1GPB_w1nuIXu7CfJPVXysR15_19Hf9cs6Apn3yzAEoVNywzlFQVQiomUoBMcKYRLipQDxLl0tMvrOVxQqEWSPnWf1j9EbAgNYw-8LWgDUtEg2dxHdR559Y_hJX20C-ul3ZQcIFDG266KW1vMjmIRQYki4FA1sIsNprPrspDEhojEy3xIDjMIOBmqIy5tGOKaa-x61tvANJvzdJxzUfUlbjX33K0BPyETK_ybKdhCBZZV6PqLWkhyOXXYsiEJkqyhsftqFepUuD3WeY4rKfu504-rjiqHDaFegmRM9nS_bnsNdD55bcySeEbZwtPP9B0pUyPeuJ9ddetIgHbG7zhnrGBTeOn6qBEZDl9WrmerzK7GwPeBWwM5DTaQ7qtTN9Sf6L2kC0rIejfb4MzcJtHZNoH2XRXiIuqgo8iLpK_bI4xQRSIuZdHd6ZgOZ8ikV_Ud70MMJjjrtUOeJyaVwzk2vN015BTSRpJBXcRlzvPFWf7quH7qjiVLYx8zAzDtKoNTs9yvkxgEFwdloVU3Q2jyg4HXP72Yfjnm1DbqxBFc-uvAn6XByLX8xkNwD7UWWHLEfEknkOeBXfJp74RvvaPngarYwZVf99KQIqXMGqqH-1pgykOfJEeozMB4UqFfzg_LjofFDVyb6hfWJVytMteyxEuhBAoNYGunJJTOqlGvtxWQVnNxBleTipnABGdcCHIiAKSQyUZqQbBcQD-R9GE7M8XDrJj8fTYTsj7YlTKZ6OY2DmYi1HOm4u1Qv3E2Q; 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: ef71c437-4f55-4ad4-a4ef-7d935ae601de, 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: OihlRvadaLmOG5MhV9tSEqYRxNRPo1GPB_w1nuIXu7CfJPVXysR15_19Hf9cs6Apn3yzAEoVNywzlFQVQiomUoBMcKYRLipQDxLl0tMvrOVxQqEWSPnWf1j9EbAgNYw-8LWgDUtEg2dxHdR559Y_hJX20C-ul3ZQcIFDG266KW1vMjmIRQYki4FA1sIsNprPrspDEhojEy3xIDjMIOBmqIy5tGOKaa-x61tvANJvzdJxzUfUlbjX33K0BPyETK_ybKdhCBZZV6PqLWkhyOXXYsiEJkqyhsftqFepUuD3WeY4rKfu504-rjiqHDaFegmRM9nS_bnsNdD55bcySeEbZwtPP9B0pUyPeuJ9ddetIgHbG7zhnrGBTeOn6qBEZDl9WrmerzK7GwPeBWwM5DTaQ7qtTN9Sf6L2kC0rIejfb4MzcJtHZNoH2XRXiIuqgo8iLpK_bI4xQRSIuZdHd6ZgOZ8ikV_Ud70MMJjjrtUOeJyaVwzk2vN015BTSRpJBXcRlzvPFWf7quH7qjiVLYx8zAzDtKoNTs9yvkxgEFwdloVU3Q2jyg4HXP72Yfjnm1DbqxBFc-uvAn6XByLX8xkNwD7UWWHLEfEknkOeBXfJp74RvvaPngarYwZVf99KQIqXMGqqH-1pgykOfJEeozMB4UqFfzg_LjofFDVyb6hfWJVytMteyxEuhBAoNYGunJJTOqlGvtxWQVnNxBleTipnABGdcCHIiAKSQyUZqQbBcQD-R9GE7M8XDrJj8fTYTsj7YlTKZ6OY2DmYi1HOm4u1Qv3E2Q"},{"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: d937e892-ce9e-4d37-9816-31f56e62b463, 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: taUGtbm8UFrWHLIH8mavd87aft5puqcZN51P5O0LJSYPct24BvbtW9PyiksjXpCztZok84po3YAQUYQ3tcC1sQPldrI1fYScPHv6iUvyZs417GeFWsuGL7ws77DA6AHrOvo_zsma5NqMahqh5IF1VupTo8WfYcUh8aHb396LcZzqTsr7S0J7Bvl8SovLuuL3FR9EckO6uVtlJjDbSpSdCV_KxppxeXrKa5JfB18_zKzGWYFZZ96pbH20sdcKbuGxyvpRrEYxrjozIPVfYVPv6Ec2YWIUkZSddqU1vi0ug-CRJ_jXb-TTEcZpDBZsYiDO2TWlbv4PRDLW31NYNzuLezQhl_Uj1ilI4hRXU9JF3Kans0FQhLLzteQX_f3HhjHowusGJWRktNXJZGGnXV4-8cLuwOx7DS7ziO09A-x05nn6hPfueBHloQjrCUdNRRBLX4eX9nTJbgNICH0X1dpipfWcMLZJerbE-V3tQ10xK8boOJazvXdv50-iHQsexRVwkc6mPFQDFP9lXnFrmKgznMzN34tH9WRSKse-c2r_fZkav_p0pwg-JUiNzMJ05lIqZw644z6WPTLPbc8PBiIyPb-MwTwDl5NenI5Z_e50OWZ6ZOxKwhgNXpEg_15nYlgjdFqyVCrtNmzbZMUdbA7t1ZeRI1fcNfHE9oKZMkuoo2Lp6YaBbfpIPn0X4BPSLYUkUQLiISX8JA3H88_fgz25uEMlStBsp1NgQhH3lxviefUP014buvsunr1dO4ugFeJjfwUN2xW6_yQiJkNe1E9m7kb-2Dtq; 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: d937e892-ce9e-4d37-9816-31f56e62b463, 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: taUGtbm8UFrWHLIH8mavd87aft5puqcZN51P5O0LJSYPct24BvbtW9PyiksjXpCztZok84po3YAQUYQ3tcC1sQPldrI1fYScPHv6iUvyZs417GeFWsuGL7ws77DA6AHrOvo_zsma5NqMahqh5IF1VupTo8WfYcUh8aHb396LcZzqTsr7S0J7Bvl8SovLuuL3FR9EckO6uVtlJjDbSpSdCV_KxppxeXrKa5JfB18_zKzGWYFZZ96pbH20sdcKbuGxyvpRrEYxrjozIPVfYVPv6Ec2YWIUkZSddqU1vi0ug-CRJ_jXb-TTEcZpDBZsYiDO2TWlbv4PRDLW31NYNzuLezQhl_Uj1ilI4hRXU9JF3Kans0FQhLLzteQX_f3HhjHowusGJWRktNXJZGGnXV4-8cLuwOx7DS7ziO09A-x05nn6hPfueBHloQjrCUdNRRBLX4eX9nTJbgNICH0X1dpipfWcMLZJerbE-V3tQ10xK8boOJazvXdv50-iHQsexRVwkc6mPFQDFP9lXnFrmKgznMzN34tH9WRSKse-c2r_fZkav_p0pwg-JUiNzMJ05lIqZw644z6WPTLPbc8PBiIyPb-MwTwDl5NenI5Z_e50OWZ6ZOxKwhgNXpEg_15nYlgjdFqyVCrtNmzbZMUdbA7t1ZeRI1fcNfHE9oKZMkuoo2Lp6YaBbfpIPn0X4BPSLYUkUQLiISX8JA3H88_fgz25uEMlStBsp1NgQhH3lxviefUP014buvsunr1dO4ugFeJjfwUN2xW6_yQiJkNe1E9m7kb-2Dtq"}] 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"48µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"124µs
And I refer to "{result}" as "vpcService"16µ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"20µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"29µs
And "{ReceiverVpcId}" is not nil16µs
Given "{NonAllowlistedRequesterVpcId}" is not nil18µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"121µs
Then "{result.AllowedListDefined}" is true41µs
And "{result.Allowed}" is false22µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"364ms
Then "{result.DryRunAllowed}" is false48µs
And "{result.AllowListDefined}" is true34µs
And "{result.RequesterInAllowList}" is false28µs
And "{result.GuardrailExpectation}" is "deny"47µs
And "{result.GuardrailMismatch}" is false33µs
And "{result.ExitCode}" should be greater than "0"51µs
And "{result.Reason}" contains "guardrail aligned"28µs
And "{result.ConflictType}" is ""21µs