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"49µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"147µs
And I refer to "{result}" as "vpcService"23µs
And I load environment variable "CN03_RECEIVER_VPC_ID" as "ReceiverVpcId"21µ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"15µs
And "{ReceiverVpcId}" is not nil14µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"171ms
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"95µs
Then "{result.ListDefined}" is true24µs
And "{result.TestedCount}" should be greater than "0"37µs
And "{result.AllCorrect}" is true19µ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 (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: 72994262-eb00-4bbb-b98f-9a480f286278, 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: powDgqcyDikHUqBNt6D1FbSLqhR0brbJV4DWH5wou6n8u0Z5euX7JyGSfTHtxtsTTUMg_FrPz2yTzDPY2-jfQivcUv62EeeM43HIp7aUTJNAjkMxSXOCqYrxhJWIWiQiuXYbUH9QLYyWFDcvGcUh7cdVQ9nn9eC9t6SMc5osN9arjGmX8q0x1dmbXF2_iWkr8xntuKClzziNej1P5LsY2Ae3XeledxYcjHqdEkMeC2_3crIu5OhezAPiteArunWK3auUANe57CBaePxsgC0lpsgDGvmxngVUeK7UNq6XC7Q67AKQ-mlF1zXXBowPDp1UDFFkqt9yNxKbq2H4vf9zYHrK-781dpE-t5DrEANv9zcaIaaQ4ea-E8tDrYP4A0cWJlhtdlBR4-br3Y7IK4G4rxf6ux_GOBGLBFxT1bdrr6XBfDhZATQYd935QVQk5fM_Lnf6b8n_PBOQOXqqoKhus5c3duEXLqH7hWfOKThkoN-o31oA2K00YnvamglQZ6xHwzr-izBd5GUUmBv5DKEzU8LouTzK8AkZVAnzql1EdD7UreQz1ZjL21azr-d4Y6jK7TocHf30_PA8TzcKB7dGrVKap8wfyK7JeoGilfA03dyjEViUKFXIFDWcuunesoUDnWVzmMXIPd4JncdzYDEjkHoKwbodybgkyBEeg_WJvOwnPdVdIipKlCUZTFixucYNPlYfpvJsq9f88MhmiO1DbITTKoTkkb1qkaGB_cxh-eU1dZwZCmEiA87ZfMQxmS7uj0zuJHnlUZbn8L_zvAvx9kDJ; 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: 72994262-eb00-4bbb-b98f-9a480f286278, 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: powDgqcyDikHUqBNt6D1FbSLqhR0brbJV4DWH5wou6n8u0Z5euX7JyGSfTHtxtsTTUMg_FrPz2yTzDPY2-jfQivcUv62EeeM43HIp7aUTJNAjkMxSXOCqYrxhJWIWiQiuXYbUH9QLYyWFDcvGcUh7cdVQ9nn9eC9t6SMc5osN9arjGmX8q0x1dmbXF2_iWkr8xntuKClzziNej1P5LsY2Ae3XeledxYcjHqdEkMeC2_3crIu5OhezAPiteArunWK3auUANe57CBaePxsgC0lpsgDGvmxngVUeK7UNq6XC7Q67AKQ-mlF1zXXBowPDp1UDFFkqt9yNxKbq2H4vf9zYHrK-781dpE-t5DrEANv9zcaIaaQ4ea-E8tDrYP4A0cWJlhtdlBR4-br3Y7IK4G4rxf6ux_GOBGLBFxT1bdrr6XBfDhZATQYd935QVQk5fM_Lnf6b8n_PBOQOXqqoKhus5c3duEXLqH7hWfOKThkoN-o31oA2K00YnvamglQZ6xHwzr-izBd5GUUmBv5DKEzU8LouTzK8AkZVAnzql1EdD7UreQz1ZjL21azr-d4Y6jK7TocHf30_PA8TzcKB7dGrVKap8wfyK7JeoGilfA03dyjEViUKFXIFDWcuunesoUDnWVzmMXIPd4JncdzYDEjkHoKwbodybgkyBEeg_WJvOwnPdVdIipKlCUZTFixucYNPlYfpvJsq9f88MhmiO1DbITTKoTkkb1qkaGB_cxh-eU1dZwZCmEiA87ZfMQxmS7uj0zuJHnlUZbn8L_zvAvx9kDJ"},{"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: 63dbc6c1-e1b0-4b06-987a-7f8ffb16f4a1, 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: lxMzeZXtOTslQz00lsnsnTqcAPTXBgsjmu7Aj8pr-mmK5U6t2Pd5IY4rVOpk_ybN4v2Jo7c3Ypj2hJpJkhGZrNMwFxREEviy7mOIhCO1SwtAh2s8oLhr1iAWnI3kis8Q6NRGEL5s2AAOCnh3Fwg1t0V6ljp7NGrTpiu67-lr8OD2-KDULN5YJDinGx2PWQU6_h_EjulfUMlG-AJOWvxaAxgxXzoh4MYJGwuTHxE_HXuONNJSjEwchx1HVje97w5TI8fDebtfPQkuZrcgfgdhMCaQdmZFIaDJ05HxZnDv9IHppjNtr4lcsl5hNBc78_niLqNSIU_kZQ5iqxBotukZzhJRSEvPZeBQFN5vIQOFGTUnJxE9TRz7KZnmal3nzzJOEmAGRpzSGWTkFawbS36yh4KnA_PgOuuaji_xIx8pVARr4wTDZX6TdcHPcZgc3nmINlGmd1YuzDA_Mogft3EVqUYOrdU54Th_6CWUaEAXTdMa5K452c9AqPq8GyWAxBeOAWLm9Aex3hMCq7js4uk7ab_EC_zpb16VNwB0DJUVvewClk8RTTj167azYzIF_z43mXP-J2U6vJOAVU2Xuk-TeSskggnzgocIurkbhfLHuamSMhuCeCm-uqwfEc02snicwznBgn6dUE9BVoHFF1u3urNiFbUZoiMon0xq_lWSzPOyqxYNXQbvbVhJl1KVDO8pFWbYW8CMW9TwpYejHgBvMokGLxVryZueYsIhiVklRTBasTgjxz40t3NTneGmXxsArQ4B5fbTj53gfoALDWTD8cR1; 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: 63dbc6c1-e1b0-4b06-987a-7f8ffb16f4a1, 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: lxMzeZXtOTslQz00lsnsnTqcAPTXBgsjmu7Aj8pr-mmK5U6t2Pd5IY4rVOpk_ybN4v2Jo7c3Ypj2hJpJkhGZrNMwFxREEviy7mOIhCO1SwtAh2s8oLhr1iAWnI3kis8Q6NRGEL5s2AAOCnh3Fwg1t0V6ljp7NGrTpiu67-lr8OD2-KDULN5YJDinGx2PWQU6_h_EjulfUMlG-AJOWvxaAxgxXzoh4MYJGwuTHxE_HXuONNJSjEwchx1HVje97w5TI8fDebtfPQkuZrcgfgdhMCaQdmZFIaDJ05HxZnDv9IHppjNtr4lcsl5hNBc78_niLqNSIU_kZQ5iqxBotukZzhJRSEvPZeBQFN5vIQOFGTUnJxE9TRz7KZnmal3nzzJOEmAGRpzSGWTkFawbS36yh4KnA_PgOuuaji_xIx8pVARr4wTDZX6TdcHPcZgc3nmINlGmd1YuzDA_Mogft3EVqUYOrdU54Th_6CWUaEAXTdMa5K452c9AqPq8GyWAxBeOAWLm9Aex3hMCq7js4uk7ab_EC_zpb16VNwB0DJUVvewClk8RTTj167azYzIF_z43mXP-J2U6vJOAVU2Xuk-TeSskggnzgocIurkbhfLHuamSMhuCeCm-uqwfEc02snicwznBgn6dUE9BVoHFF1u3urNiFbUZoiMon0xq_lWSzPOyqxYNXQbvbVhJl1KVDO8pFWbYW8CMW9TwpYejHgBvMokGLxVryZueYsIhiVklRTBasTgjxz40t3NTneGmXxsArQ4B5fbTj53gfoALDWTD8cR1"}] 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"43µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"129µs
And I refer to "{result}" as "vpcService"15µ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"31µ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 nil21µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"101µs
Then "{result.AllowedListDefined}" is true37µs
And "{result.Allowed}" is false21µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"84ms
Then "{result.DryRunAllowed}" is false59µs
And "{result.AllowListDefined}" is true23µs
And "{result.RequesterInAllowList}" is false21µs
And "{result.GuardrailExpectation}" is "deny"23µs
And "{result.GuardrailMismatch}" is false19µs
And "{result.ExitCode}" should be greater than "0"22µs
And "{result.Reason}" contains "guardrail aligned"24µs
And "{result.ConflictType}" is ""20µs