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"41µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"130µs
And I refer to "{result}" as "vpcService"16µs
And I load environment variable "CN03_RECEIVER_VPC_ID" as "ReceiverVpcId"18µs
And I load environment variable "CN03_NON_ALLOWLISTED_REQUESTER_VPC_ID" as "NonAllowlistedRequesterVpcId"32µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"18µs
And "{ReceiverVpcId}" is not nil16µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"559ms
And I attach "{result.Summary}" to the test output as "Disallow-list Enforcement Summary"56µs
And I attach "{result.Results}" to the test output as "Disallow-list Enforcement"103µs
Then "{result.ListDefined}" is true38µs
And "{result.TestedCount}" should be greater than "0"49µs
And "{result.AllCorrect}" is true38µs
And "{result.ViolationCount}" is "0"44µ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 (6443 bytes)
[{"AllowListDefined":true,"ConflictMessage":"","ConflictType":"","DryRunAllowed":false,"ErrorCode":"UnauthorizedOperation","ExitCode":1,"GuardrailExpectation":"deny","GuardrailMismatch":false,"Origin":"terraform-fixture","PeerOwnerId":"","PeerVpcId":"vpc-027ef85c88b9d68c2","Reason":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: 82765956-0013-475f-8f75-36316dd15878, 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: JC_PRrwYINGSmt4WQOE6U4wFA3LD0lzwQK_U6-QpQe6jCBziuuAQMmn59nzMIQZJ9qYX7jjKupY9Qp0XklW3QtRG2i0kEwttw2EHF04-T-BCSLC0lQtFyz8XnFinkCcRoDsUhRKxQBHGSNrK67twgWoppPY2yHYz6uZz4IpV759uZ5IdSSi-UN7Z4TYkCrtyjEyN-N8APZD6JhCrNDYLfyPRN7SwVCuoNbYqrlgcTNHmHfdwPQ2SbtTKe5iznOs72tzik9tPzapF8DOQ1KAVzIy2dJFM5VHNLiP6IORq2Wq9-ZYl8rofe_bUwHs3-wR2ipHopMNMiJpwN3PFBK1hJnhOielM3dm3pFm7BXUi03CUcJUafOlIH9T90YX2RffS_pNSjVFmx9eHUaJWkEAEdOWygGN0n1A4gNZzs9TKkeW815hTNeYH57cROypPYdofftQWAx4BifzmrSZYCE0qYublaxlSc_guHQ-VisisqZ30Gc2R6ECs2q0ozgnlY4ffREW_vFQFh6RyEPMhl-uFQ7z-Zae1AQR-7SOpnokLsZDqS_qRaUbzq94r1UfsqgELLia-mM1PkAxG9-Kj9CVfOggUEc7cdJR-aRcLAIfxbolAZa0x0jHHYDoimajUz_3lsKIQYj1wGMXFTZZJnWj-d5gZO4BF1m8AxiSM0jEhVx99CJO-qPGTqiNaSNAXHkpQavXNBE_RNRMw4pNvyR7Cu7jaHRo-cg0k3bl8VTXssfJwdvhD8YeVkfTatCwVCmKeyigy1qJW9OCyQTfnHP8C6uhUFQ; CN03 guardrail aligned: allow-list expects deny for requester vpc-00ceb92e81affe793","ReceiverVpcId":"vpc-027ef85c88b9d68c2","RequesterInAllowList":false,"RequesterVpcId":"vpc-00ceb92e81affe793","Stderr":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: 82765956-0013-475f-8f75-36316dd15878, 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: JC_PRrwYINGSmt4WQOE6U4wFA3LD0lzwQK_U6-QpQe6jCBziuuAQMmn59nzMIQZJ9qYX7jjKupY9Qp0XklW3QtRG2i0kEwttw2EHF04-T-BCSLC0lQtFyz8XnFinkCcRoDsUhRKxQBHGSNrK67twgWoppPY2yHYz6uZz4IpV759uZ5IdSSi-UN7Z4TYkCrtyjEyN-N8APZD6JhCrNDYLfyPRN7SwVCuoNbYqrlgcTNHmHfdwPQ2SbtTKe5iznOs72tzik9tPzapF8DOQ1KAVzIy2dJFM5VHNLiP6IORq2Wq9-ZYl8rofe_bUwHs3-wR2ipHopMNMiJpwN3PFBK1hJnhOielM3dm3pFm7BXUi03CUcJUafOlIH9T90YX2RffS_pNSjVFmx9eHUaJWkEAEdOWygGN0n1A4gNZzs9TKkeW815hTNeYH57cROypPYdofftQWAx4BifzmrSZYCE0qYublaxlSc_guHQ-VisisqZ30Gc2R6ECs2q0ozgnlY4ffREW_vFQFh6RyEPMhl-uFQ7z-Zae1AQR-7SOpnokLsZDqS_qRaUbzq94r1UfsqgELLia-mM1PkAxG9-Kj9CVfOggUEc7cdJR-aRcLAIfxbolAZa0x0jHHYDoimajUz_3lsKIQYj1wGMXFTZZJnWj-d5gZO4BF1m8AxiSM0jEhVx99CJO-qPGTqiNaSNAXHkpQavXNBE_RNRMw4pNvyR7Cu7jaHRo-cg0k3bl8VTXssfJwdvhD8YeVkfTatCwVCmKeyigy1qJW9OCyQTfnHP8C6uhUFQ"},{"AllowListDefined":true,"ConflictMessage":"","ConflictType":"","DryRunAllowed":false,"ErrorCode":"UnauthorizedOperation","ExitCode":1,"GuardrailExpectation":"deny","GuardrailMismatch":false,"Origin":"terraform-fixture","PeerOwnerId":"","PeerVpcId":"vpc-027ef85c88b9d68c2","Reason":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: b1e0efd6-93e8-4ddd-85d6-fb553923a10e, 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: 8PTx5-XOPeaXdt210ED3L-qdYUWCO0VVMZK0jvgv8nKUMJa4fctUR7AGrL6GUPRltGKek-lGEL9YpiRTT0InQVsmfGzd9YyPRaSu8bBPszw6GXMmp9EyBQGMRZ_TboUKcc16ME2ntMONuJ0alLqEPMu59Fge1qKCGrRRTicvroGVucffY6xjGp358Ee1FV-HpGyq-VKhOmhawZM1oxhU1C5V2HiA0_Afkho16FyC9NeEnMhuezLHE2gp4fTWSR2SrHS4a46FqbwKBIYFPyUOioeBT226U7uBgITBTN2k0sq63DyYiZRjmQxNusIy7ZE31z7zWjLFrtuirtqdhYg_OfW7Z9hhdpEu2H9PjMbMzvQS0upwddLMxhAHJoFB9FY_PYVj0jd2rQYI8hya9EI5HKESFXkFvUVUY7DH4PEihMqw_0C4lvt6GgcEzTHVnC3Lx2dVtc6rKGUuVeMY0yc0X8oQQHkeUzrVgE0_D55ePi62R6e7BYIX74L5uIq2uoKZqZygn7kOac-dh9fUGHRBW8c-izMZXuqj_8HK6SlSppsIPEi4j2ZWC-ri1LVZLMlQ9awUMP5RD8eDn-SlsPtA70ZPd1X6mCPACpNYETAI3V0SeT9mlvr9zyxNUf6VHgvEorScOVpCLoXO7RcP6GJ3E9mZbImzi0HkyJVHLU7BbTvb7p6mXsz-6apyU2K0A9SSHS8KzVxjYomVaJB3QwZ1QulA5k0innl4V8bUHAeMaVozREQNSY5o5gkw56STB2a_TQ6RTOqXOXWGSbY_6cJd3Az6; CN03 guardrail aligned: allow-list expects deny for requester vpc-03e0763d329ec1a53","ReceiverVpcId":"vpc-027ef85c88b9d68c2","RequesterInAllowList":false,"RequesterVpcId":"vpc-03e0763d329ec1a53","Stderr":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: b1e0efd6-93e8-4ddd-85d6-fb553923a10e, 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: 8PTx5-XOPeaXdt210ED3L-qdYUWCO0VVMZK0jvgv8nKUMJa4fctUR7AGrL6GUPRltGKek-lGEL9YpiRTT0InQVsmfGzd9YyPRaSu8bBPszw6GXMmp9EyBQGMRZ_TboUKcc16ME2ntMONuJ0alLqEPMu59Fge1qKCGrRRTicvroGVucffY6xjGp358Ee1FV-HpGyq-VKhOmhawZM1oxhU1C5V2HiA0_Afkho16FyC9NeEnMhuezLHE2gp4fTWSR2SrHS4a46FqbwKBIYFPyUOioeBT226U7uBgITBTN2k0sq63DyYiZRjmQxNusIy7ZE31z7zWjLFrtuirtqdhYg_OfW7Z9hhdpEu2H9PjMbMzvQS0upwddLMxhAHJoFB9FY_PYVj0jd2rQYI8hya9EI5HKESFXkFvUVUY7DH4PEihMqw_0C4lvt6GgcEzTHVnC3Lx2dVtc6rKGUuVeMY0yc0X8oQQHkeUzrVgE0_D55ePi62R6e7BYIX74L5uIq2uoKZqZygn7kOac-dh9fUGHRBW8c-izMZXuqj_8HK6SlSppsIPEi4j2ZWC-ri1LVZLMlQ9awUMP5RD8eDn-SlsPtA70ZPd1X6mCPACpNYETAI3V0SeT9mlvr9zyxNUf6VHgvEorScOVpCLoXO7RcP6GJ3E9mZbImzi0HkyJVHLU7BbTvb7p6mXsz-6apyU2K0A9SSHS8KzVxjYomVaJB3QwZ1QulA5k0innl4V8bUHAeMaVozREQNSY5o5gkw56STB2a_TQ6RTOqXOXWGSbY_6cJd3Az6"}] 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"29µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"132µs
And I refer to "{result}" as "vpcService"24µ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"21µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"17µ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 true22µs
And "{result.Allowed}" is false19µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"367ms
Then "{result.DryRunAllowed}" is false45µs
And "{result.AllowListDefined}" is true33µs
And "{result.RequesterInAllowList}" is false29µs
And "{result.GuardrailExpectation}" is "deny"31µs
And "{result.GuardrailMismatch}" is false28µs
And "{result.ExitCode}" should be greater than "0"32µs
And "{result.Reason}" contains "guardrail aligned"31µs
And "{result.ConflictType}" is ""28µs