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"43µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"138µs
And I refer to "{result}" as "vpcService"25µ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"18µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"17µs
And "{ReceiverVpcId}" is not nil15µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"506ms
And I attach "{result.Summary}" to the test output as "Disallow-list Enforcement Summary"67µs
And I attach "{result.Results}" to the test output as "Disallow-list Enforcement"111µs
Then "{result.ListDefined}" is true41µs
And "{result.TestedCount}" should be greater than "0"37µs
And "{result.AllCorrect}" is true25µs
And "{result.ViolationCount}" is "0"25µ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 (6449 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: 9e02abec-e1d1-4a55-88a2-011e20e2b133, 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: LMNbyrCUIsKsQ_kcQ5NjiopiNWgmPpGxBk8TBq6XZCai8OHBUG3WUkxySUk6Sq58exyBqAodkybumLICl5vXZHXdno-d5U91H-xwdEnfBDT5N9AZiEfi4EoryQOxvFEMjpMRYNZSnUGHSPvb4aC9qlMvso2dEzBSh8QL4jF_bu10bXF6rF5uMbtZf4ZuKOWdZcZraKpqN7s3FGHOm0QzYak2THbJIuebbtcRcaB-L819J4DFMxFJCPfISVrpKJhd_t-OfK8g5AMlXP9o0oX2BHRihPLkdnVJ5B25cW2_M4WKJSi33Eo5Uk90m9t0kxKXjqlgcxyEu0s0TT2xB4JGyBFZ5ppqrxp4jjNcMkJmTMXSoPlHnQvaw407nL45mZw51hQQ1rzRktwDh61KnCUKiQfIo4v6qJpqp94CYNxLnHEQT4cI5udqTJ-8uK51f9m8g1dotTMvki0qR3sxc260zJfdx4zbrDsp5hODsnpYK1m4xvW0s8AFGl_fHlZI7jVVcaPuBZFPKvyZvPOgfFTw_cOpXCyWzth6RrLmLL5e6sgI6CcQzt0_Xksew45TEdccNuwqKecCZpj0DFwjXpYXqWbSSlPtX4gnJKfAzVRI2V3Z813CdBHqVInEe3Sf80UuFXn_N4NENtpJoYlfXXhn9JgX-NpzsqI8DNslScKE1MbtQBmFqa8V9D-RgeIRzDy-6fxSbhP6bbmdUL8rP6Ya_E6eZublvqIo1gF0M6MmuBoTow4rWB9--gAqGSlVuIkloxHaP210qMKD1IMs2zWtGTkp-g; 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: 9e02abec-e1d1-4a55-88a2-011e20e2b133, 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: LMNbyrCUIsKsQ_kcQ5NjiopiNWgmPpGxBk8TBq6XZCai8OHBUG3WUkxySUk6Sq58exyBqAodkybumLICl5vXZHXdno-d5U91H-xwdEnfBDT5N9AZiEfi4EoryQOxvFEMjpMRYNZSnUGHSPvb4aC9qlMvso2dEzBSh8QL4jF_bu10bXF6rF5uMbtZf4ZuKOWdZcZraKpqN7s3FGHOm0QzYak2THbJIuebbtcRcaB-L819J4DFMxFJCPfISVrpKJhd_t-OfK8g5AMlXP9o0oX2BHRihPLkdnVJ5B25cW2_M4WKJSi33Eo5Uk90m9t0kxKXjqlgcxyEu0s0TT2xB4JGyBFZ5ppqrxp4jjNcMkJmTMXSoPlHnQvaw407nL45mZw51hQQ1rzRktwDh61KnCUKiQfIo4v6qJpqp94CYNxLnHEQT4cI5udqTJ-8uK51f9m8g1dotTMvki0qR3sxc260zJfdx4zbrDsp5hODsnpYK1m4xvW0s8AFGl_fHlZI7jVVcaPuBZFPKvyZvPOgfFTw_cOpXCyWzth6RrLmLL5e6sgI6CcQzt0_Xksew45TEdccNuwqKecCZpj0DFwjXpYXqWbSSlPtX4gnJKfAzVRI2V3Z813CdBHqVInEe3Sf80UuFXn_N4NENtpJoYlfXXhn9JgX-NpzsqI8DNslScKE1MbtQBmFqa8V9D-RgeIRzDy-6fxSbhP6bbmdUL8rP6Ya_E6eZublvqIo1gF0M6MmuBoTow4rWB9--gAqGSlVuIkloxHaP210qMKD1IMs2zWtGTkp-g"},{"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: e25d9c3a-2c84-4acc-b7eb-77cc1ea60fb4, 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: HJ7_abETt3ClVFjS7op6da6kyHWKMIrmtikx06-4X0RI8zjmL6j4GdNLZlEHp_zcE-rEiEQmbloK16HifHffD6dB5kfv9CB5trL9DaVYj2uX34vhvCbr20PBmddeEAY4GiQKm4UWSVYXAul4dwQY8z0HiY52n2BSAbIoz32boRdfkx3cVYNZrCd_8wQPz7g-X03pv5gau0As2pbnjK5sZaCrKcGo_vAYxaANi8owIednNTdOeVB0wk0wpLnDBGYF2MUUhRjrZ0mW_PrFpPakZGVge6b5O7ekQlzaL_cDon8a9INH8z7WM-lLeYKR8WiFBsQd7nWLq6B8a5JDRKiBLRiIzLrx-B1Oo6XN2IRvLqTZ8uMsyYJ3KEvWKog_enmI3_8h1A6JPfZOZhGjInlgjUC6hKlDymqeMtxrdIPv0i5XXxQ2V7hVvBHOLhXcD-vecNaMOmCRAHmTvMd-r1gzO3p9MfIr2H01a51xG2Uwc21DhHqss426N1nqeE_x-Y7kclRLuMuLRApGx9cysDP_h04_OC2_xrxTpuWQgw-oetc16A4JYfgUZyhgYAWRzNGBb54sBG4hvg9ZRa_fGqZYFmJ_rtfLUdIKJyqAIw1CgyP4oPTbbYpkqarTMoeXjJoTmGCl8M1KGc1_mYy5yQSXzAIJBfg0g_cxUcoKnkH8POjGbL3HEDFNrBX3QokRdWhrELg-uoz7mkjZWCEb_MikOh0ijjHxXvO1fiIf_FYN9RDZ49ual1hY8KldqO8bJVAXrmIEBfpDB3WRUF4EN8TPabDVTKc; 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: e25d9c3a-2c84-4acc-b7eb-77cc1ea60fb4, 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: HJ7_abETt3ClVFjS7op6da6kyHWKMIrmtikx06-4X0RI8zjmL6j4GdNLZlEHp_zcE-rEiEQmbloK16HifHffD6dB5kfv9CB5trL9DaVYj2uX34vhvCbr20PBmddeEAY4GiQKm4UWSVYXAul4dwQY8z0HiY52n2BSAbIoz32boRdfkx3cVYNZrCd_8wQPz7g-X03pv5gau0As2pbnjK5sZaCrKcGo_vAYxaANi8owIednNTdOeVB0wk0wpLnDBGYF2MUUhRjrZ0mW_PrFpPakZGVge6b5O7ekQlzaL_cDon8a9INH8z7WM-lLeYKR8WiFBsQd7nWLq6B8a5JDRKiBLRiIzLrx-B1Oo6XN2IRvLqTZ8uMsyYJ3KEvWKog_enmI3_8h1A6JPfZOZhGjInlgjUC6hKlDymqeMtxrdIPv0i5XXxQ2V7hVvBHOLhXcD-vecNaMOmCRAHmTvMd-r1gzO3p9MfIr2H01a51xG2Uwc21DhHqss426N1nqeE_x-Y7kclRLuMuLRApGx9cysDP_h04_OC2_xrxTpuWQgw-oetc16A4JYfgUZyhgYAWRzNGBb54sBG4hvg9ZRa_fGqZYFmJ_rtfLUdIKJyqAIw1CgyP4oPTbbYpkqarTMoeXjJoTmGCl8M1KGc1_mYy5yQSXzAIJBfg0g_cxUcoKnkH8POjGbL3HEDFNrBX3QokRdWhrELg-uoz7mkjZWCEb_MikOh0ijjHxXvO1fiIf_FYN9RDZ49ual1hY8KldqO8bJVAXrmIEBfpDB3WRUF4EN8TPabDVTKc"}] 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"45µ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"16µs
And I load environment variable "CN03_NON_ALLOWLISTED_REQUESTER_VPC_ID" as "NonAllowlistedRequesterVpcId"18µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"16µs
And "{ReceiverVpcId}" is not nil17µs
Given "{NonAllowlistedRequesterVpcId}" is not nil17µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"87µs
Then "{result.AllowedListDefined}" is true21µs
And "{result.Allowed}" is false17µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"441ms
Then "{result.DryRunAllowed}" is false33µs
And "{result.AllowListDefined}" is true40µs
And "{result.RequesterInAllowList}" is false22µs
And "{result.GuardrailExpectation}" is "deny"22µs
And "{result.GuardrailMismatch}" is false30µs
And "{result.ExitCode}" should be greater than "0"26µs
And "{result.Reason}" contains "guardrail aligned"24µs
And "{result.ConflictType}" is ""34µs