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"139µs
And I refer to "{result}" as "vpcService"22µ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"20µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"16µs
And "{ReceiverVpcId}" is not nil14µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"180ms
And I attach "{result.Summary}" to the test output as "Disallow-list Enforcement Summary"58µs
And I attach "{result.Results}" to the test output as "Disallow-list Enforcement"62µs
Then "{result.ListDefined}" is true31µs
And "{result.TestedCount}" should be greater than "0"40µs
And "{result.AllCorrect}" is true26µ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 (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: d533c3e3-a43d-4482-8eea-5db9b7c8e4e9, 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: z_6LUwseruCA406tjuUcZ7III66QjyZSr5W7t_6NyJgPv8Q1Fy9s_jsn4VvPo_jqOrOUOwWK9W2jT3dIeQcMgcaHSMuBJiHABa60SpdbwUJ1Mv_DKbs1X-_eypsxTbsFaweTKeOtI6V8FVnRWf6I-w0nspeZFNrfvYfPlIMGGJX4JzKSO3v6_4X4R7HVxWwd6n_-hlVzUX5gwIMgvFeu_IJSauaGXnUsVCxWJU8_gdiuL2cnX1jG8rNXdIgyumOVzC5Q441vvgQsgC8yGE1QO0fwMDVG1wCA0BT1yqsXToyd31nVjKuiwCQseabwx3YVFBZKBt_7bl3LqtEGXctcPKa0t3PE46PZl3Zx9qYeM_soERQeeDSpzw2Bz4SKdWFvVz-uaRchHoncCvnB32DIXJu9tpnsugesl_9vJdXTBKlJIRG6v5uKA1UESqsPOz00AhtiZgLCazZS0HXb86sonibAUghi8dZKqbd-HGPP7AnvJGIsrAD_IrfraR3JOz_JaqBtcjH82RQ0gj4bNW4u2EpLHOaHpkoDbmGnDz4RALFMm_14BU87_sKXp4bBR5SLxpmZwALL0xFKGIqY7bmLsnVl0j9yLsxXekMeWgWlh2Rn1vW6x9DuX4XBhK_eukedq_G0GZwbzhXX6MUxQctoZhd2aPjnwqgrYVsaNUbRFEp5LWkP52QACAQ1ssmkz48MVEAJupGnxpmclWfV-qXdbaSaJd9WeFuUX0g77OE1Xpr19B5i2HseL-vVOZRV0RiBoXZpUFQzDdFmXb9CcbpJ764A; 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: d533c3e3-a43d-4482-8eea-5db9b7c8e4e9, 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: z_6LUwseruCA406tjuUcZ7III66QjyZSr5W7t_6NyJgPv8Q1Fy9s_jsn4VvPo_jqOrOUOwWK9W2jT3dIeQcMgcaHSMuBJiHABa60SpdbwUJ1Mv_DKbs1X-_eypsxTbsFaweTKeOtI6V8FVnRWf6I-w0nspeZFNrfvYfPlIMGGJX4JzKSO3v6_4X4R7HVxWwd6n_-hlVzUX5gwIMgvFeu_IJSauaGXnUsVCxWJU8_gdiuL2cnX1jG8rNXdIgyumOVzC5Q441vvgQsgC8yGE1QO0fwMDVG1wCA0BT1yqsXToyd31nVjKuiwCQseabwx3YVFBZKBt_7bl3LqtEGXctcPKa0t3PE46PZl3Zx9qYeM_soERQeeDSpzw2Bz4SKdWFvVz-uaRchHoncCvnB32DIXJu9tpnsugesl_9vJdXTBKlJIRG6v5uKA1UESqsPOz00AhtiZgLCazZS0HXb86sonibAUghi8dZKqbd-HGPP7AnvJGIsrAD_IrfraR3JOz_JaqBtcjH82RQ0gj4bNW4u2EpLHOaHpkoDbmGnDz4RALFMm_14BU87_sKXp4bBR5SLxpmZwALL0xFKGIqY7bmLsnVl0j9yLsxXekMeWgWlh2Rn1vW6x9DuX4XBhK_eukedq_G0GZwbzhXX6MUxQctoZhd2aPjnwqgrYVsaNUbRFEp5LWkP52QACAQ1ssmkz48MVEAJupGnxpmclWfV-qXdbaSaJd9WeFuUX0g77OE1Xpr19B5i2HseL-vVOZRV0RiBoXZpUFQzDdFmXb9CcbpJ764A"},{"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: 903f0ff7-3113-4ec9-bb20-ed6f2861b0d2, 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: zMAvYln3Gqc5dqpAuS2Tdd5koXFm1GWINo2HngRmLK7M-HrSMm55AwB9BmNsi4tNQ5cqcEz2XozlbytNFmDNzXrQAXfHhD9Bp3S7tOpcN7X-dh7i7crmDyXwIuuCDafjA_2b4j-5ipbWoLzFbu7WM_TNsZ9OGRJ-qDDm4hb2InTkjqvI85YRTpBjbvrcOay503BUzVETof-82GSAIYBReRXG2g8nfSyk_vMsaRQAtbSdOCYGzigqEXpit2AwxTuvNz7G0W0QMymOPeakZdmKRMgJ0FugXIgF4TUwiC0XJTt57-lizcLaJD-UUBnvjC1zuxm-2hzqx-ZI91Hu_qxM5aSkF8I-dEThBBT6-3DsOhn9Fs7oOmNuMB0FD9r_F97SB8cY8oAwZx3ajigQ7X-TaNzQ1tifGZRHwYluJ7REELUiQW-mFS6iI6WMlQ_He6LMue8Un1Zv6LpGFTncmc2c8z8C_yV5Ra-yexgWazaeH3UYUbNaYelpEvKKt9aJBVP6HfXzdjeF9NI2lvElB4zsTOgnZryjAZJSSIhIB6Yo68JNLmEX8K_0-MgMKavLUWGbhPPQT79iWW0smKdN3Cfg0SxbueBwqfK-a8XUXKjKwyP56p13tKzgZQe4HBLxGwkeVEXnRavTAUiKgWArz7dY90tAMNwgBX9-2wYQ0dbwYVG72z-Ag3TfND9iYyEUSGfEHI6kCdwavvEbcPplyqTXQjzVTj8Ra0R9a5F6MLPQuhBMYH7oHxubMxfCQGMPD522VYR90xbgjlDhN3pza3_THwFJ; 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: 903f0ff7-3113-4ec9-bb20-ed6f2861b0d2, 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: zMAvYln3Gqc5dqpAuS2Tdd5koXFm1GWINo2HngRmLK7M-HrSMm55AwB9BmNsi4tNQ5cqcEz2XozlbytNFmDNzXrQAXfHhD9Bp3S7tOpcN7X-dh7i7crmDyXwIuuCDafjA_2b4j-5ipbWoLzFbu7WM_TNsZ9OGRJ-qDDm4hb2InTkjqvI85YRTpBjbvrcOay503BUzVETof-82GSAIYBReRXG2g8nfSyk_vMsaRQAtbSdOCYGzigqEXpit2AwxTuvNz7G0W0QMymOPeakZdmKRMgJ0FugXIgF4TUwiC0XJTt57-lizcLaJD-UUBnvjC1zuxm-2hzqx-ZI91Hu_qxM5aSkF8I-dEThBBT6-3DsOhn9Fs7oOmNuMB0FD9r_F97SB8cY8oAwZx3ajigQ7X-TaNzQ1tifGZRHwYluJ7REELUiQW-mFS6iI6WMlQ_He6LMue8Un1Zv6LpGFTncmc2c8z8C_yV5Ra-yexgWazaeH3UYUbNaYelpEvKKt9aJBVP6HfXzdjeF9NI2lvElB4zsTOgnZryjAZJSSIhIB6Yo68JNLmEX8K_0-MgMKavLUWGbhPPQT79iWW0smKdN3Cfg0SxbueBwqfK-a8XUXKjKwyP56p13tKzgZQe4HBLxGwkeVEXnRavTAUiKgWArz7dY90tAMNwgBX9-2wYQ0dbwYVG72z-Ag3TfND9iYyEUSGfEHI6kCdwavvEbcPplyqTXQjzVTj8Ra0R9a5F6MLPQuhBMYH7oHxubMxfCQGMPD522VYR90xbgjlDhN3pza3_THwFJ"}] 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"53µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"133µ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"16µs
And "{ReceiverVpcId}" is not nil15µ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 false20µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"111ms
Then "{result.DryRunAllowed}" is false49µs
And "{result.AllowListDefined}" is true22µs
And "{result.RequesterInAllowList}" is false33µs
And "{result.GuardrailExpectation}" is "deny"22µs
And "{result.GuardrailMismatch}" is false29µs
And "{result.ExitCode}" should be greater than "0"26µs
And "{result.Reason}" contains "guardrail aligned"36µs
And "{result.ConflictType}" is ""19µs