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"48µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"126µs
And I refer to "{result}" as "vpcService"19µs
And I refer to "{UID}" as "ReceiverVpcId"15µs
And I refer to "{Cn03NonAllowlistedRequesterVpcId}" as "NonAllowlistedRequesterVpcId"12µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"15µs
And "{ReceiverVpcId}" is not nil21µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"263ms
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"107µs
Then "{result.ListDefined}" is true32µs
And "{result.TestedCount}" should be greater than "0"38µs
And "{result.AllCorrect}" is true28µs
And "{result.ViolationCount}" is "0"36µ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 (6465 bytes)
[{"AllowListDefined":true,"ConflictMessage":"","ConflictType":"","DryRunAllowed":false,"ErrorCode":"UnauthorizedOperation","ExitCode":1,"GuardrailExpectation":"deny","GuardrailMismatch":false,"Origin":"terraform-fixture","PeerOwnerId":"","PeerVpcId":"vpc-052e26ee900d736f5","Reason":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: 5fd5bbce-f68e-4f3d-b796-cc2424b2af60, 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: VlsLonD8JSbVnRQU8shfeeM8rQbU4fxRqmpjuNV9thq0K1vWvjR4RJTvWCe5pu8ytotR2omocc3hmuSMolJgVzv7XiAz-aJC7INH64MMfsEY-qOayW0VgIHllcbEbpm0uYaVYKEA7GqwDLh2mj-K4uuC_Aa1XKh-eBJrODPAJHe9cZ_q9SH-LA5dzgR75Q6DG85u8-Ken5ZqR-O5iF0rDHCrCiAr-7AbXIyoOPOcPRghHUGBVQ4d0ibXz_ftpe0vc5Pl-BxaertGRRp9j6flMZkq9ZnaKhMp7fZWuJlQK7IY6kUEd_Qp3OBVAuENVpFmdPKpfTOZchvxp6ossORCqJEn0aRRkoYmc0BL8_GOI_aoOr_ClHzRl2LzaixauUFeve3o_HY6p7FaEL8iGZDyUCDn1dqapEIWgrQnrlvTVcLuuf-x_ixj1I3-bHtsSn4LOvlB1FOfRfJNO7yetgFef2xZNc3lZo0jvPrGM8RNQWPaEyL5X0HP6SnthD0smH9Yjm_zBY22l4ME0vgkKxFvZO3f-UFlXWKKUPB3q9s789iFGAU0LqVJ8HUS_aBrb5aU4QwA27cMfNj-7PTbi0chI4479DCEQLpsBw08wkFh6KgmURGrqeapsK92MZFvO0AIHQVYMtuQhiTpA8vnfK_Xt5UcYLRqEd698bjgvIlRjrDDrr0fTXJHv24qMEK_QPuYEb9jw_xEBI720uNN2HCyBRFPpY3QdS3AmDkFEEGm4lkWJVc3xKGL0bOpE_UOih_62j-pnQJoo2jWLjAxM7k43UPJKftzkws; CN03 guardrail aligned: allow-list expects deny for requester vpc-02f7f1c9c21fbf4c8","ReceiverVpcId":"vpc-052e26ee900d736f5","RequesterInAllowList":false,"RequesterVpcId":"vpc-02f7f1c9c21fbf4c8","Stderr":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: 5fd5bbce-f68e-4f3d-b796-cc2424b2af60, 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: VlsLonD8JSbVnRQU8shfeeM8rQbU4fxRqmpjuNV9thq0K1vWvjR4RJTvWCe5pu8ytotR2omocc3hmuSMolJgVzv7XiAz-aJC7INH64MMfsEY-qOayW0VgIHllcbEbpm0uYaVYKEA7GqwDLh2mj-K4uuC_Aa1XKh-eBJrODPAJHe9cZ_q9SH-LA5dzgR75Q6DG85u8-Ken5ZqR-O5iF0rDHCrCiAr-7AbXIyoOPOcPRghHUGBVQ4d0ibXz_ftpe0vc5Pl-BxaertGRRp9j6flMZkq9ZnaKhMp7fZWuJlQK7IY6kUEd_Qp3OBVAuENVpFmdPKpfTOZchvxp6ossORCqJEn0aRRkoYmc0BL8_GOI_aoOr_ClHzRl2LzaixauUFeve3o_HY6p7FaEL8iGZDyUCDn1dqapEIWgrQnrlvTVcLuuf-x_ixj1I3-bHtsSn4LOvlB1FOfRfJNO7yetgFef2xZNc3lZo0jvPrGM8RNQWPaEyL5X0HP6SnthD0smH9Yjm_zBY22l4ME0vgkKxFvZO3f-UFlXWKKUPB3q9s789iFGAU0LqVJ8HUS_aBrb5aU4QwA27cMfNj-7PTbi0chI4479DCEQLpsBw08wkFh6KgmURGrqeapsK92MZFvO0AIHQVYMtuQhiTpA8vnfK_Xt5UcYLRqEd698bjgvIlRjrDDrr0fTXJHv24qMEK_QPuYEb9jw_xEBI720uNN2HCyBRFPpY3QdS3AmDkFEEGm4lkWJVc3xKGL0bOpE_UOih_62j-pnQJoo2jWLjAxM7k43UPJKftzkws"},{"AllowListDefined":true,"ConflictMessage":"","ConflictType":"","DryRunAllowed":false,"ErrorCode":"UnauthorizedOperation","ExitCode":1,"GuardrailExpectation":"deny","GuardrailMismatch":false,"Origin":"terraform-fixture","PeerOwnerId":"","PeerVpcId":"vpc-052e26ee900d736f5","Reason":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: 98955a7b-8952-4d29-9b45-9c2967910575, 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: g-GeuGtGwR6tRgNFHvCpUIxbO0qmUYhumSd4btLVKIiA0i-74izUR6pR3WwUa_Bxnv2dUOCT3fkSE6hKEiAHaYxdIbP7czofbLcqMhD9vgUAyuhRU99XBf3rImmjOzoaMPJ-euA-dWBwEijpKfO9cTSvySpBprdHw-aqTn6lFQPrn29qBs6hgJjap6qU4bGTl6ToBrCtk6F0k0CpC0yotnxdacxfOO3Klvv55KXNX8whPlTjn30NGuXWRkxkZUX-JF6HRuj-Z56XWcM0CL8f4MCDzd0hym40IoIyAXuKwjcBqn-0Kx36iseMXVTuYddSuxM84VwQVg-aAxyr0EtXJWpXb2bwaHTNheywuVcVcULvXzLzV0fvJkZ0IxnJ87jpp6IyGUKDL5nMPT6t742kkkx3LctlOqN2Kxefp476nGOhq1SpLac2MqAT5uQd7Ipk4xvBkSjMrsHsdsE6YVx8gwG44Z5nPzQzuP_yKTOC9-OCbcP8DoWBlv5jLBy9Mk73dxvx8wkjX5IGtSdg3rfyS17tBOX0Cq4j4yAkpl4MfXqrXVy0DeTXQyMiq8NWF9NBEJW3qO2FUZ_3Tl65MY8TC7ClINk6igvbQHfAfqx0v12Sj1gLcZ8_sG3dsiiiSeP9QcMMaFpnr1YgnEK3VGLbHzuvHtL4BNOpHZANHx8dfjy6uF5cyf6DY6iOoc8Vl4R3mBGVjtMRokAi8fRnremdvx5pG6YfjvksZNh3FGMNp7nBDKMEDO-afkTatscmcIwCxECS9BpeteSWFD6VnDVCZhlZ_H5l_A; CN03 guardrail aligned: allow-list expects deny for requester vpc-0cd15c2c6c3933bcc","ReceiverVpcId":"vpc-052e26ee900d736f5","RequesterInAllowList":false,"RequesterVpcId":"vpc-0cd15c2c6c3933bcc","Stderr":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: 98955a7b-8952-4d29-9b45-9c2967910575, 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: g-GeuGtGwR6tRgNFHvCpUIxbO0qmUYhumSd4btLVKIiA0i-74izUR6pR3WwUa_Bxnv2dUOCT3fkSE6hKEiAHaYxdIbP7czofbLcqMhD9vgUAyuhRU99XBf3rImmjOzoaMPJ-euA-dWBwEijpKfO9cTSvySpBprdHw-aqTn6lFQPrn29qBs6hgJjap6qU4bGTl6ToBrCtk6F0k0CpC0yotnxdacxfOO3Klvv55KXNX8whPlTjn30NGuXWRkxkZUX-JF6HRuj-Z56XWcM0CL8f4MCDzd0hym40IoIyAXuKwjcBqn-0Kx36iseMXVTuYddSuxM84VwQVg-aAxyr0EtXJWpXb2bwaHTNheywuVcVcULvXzLzV0fvJkZ0IxnJ87jpp6IyGUKDL5nMPT6t742kkkx3LctlOqN2Kxefp476nGOhq1SpLac2MqAT5uQd7Ipk4xvBkSjMrsHsdsE6YVx8gwG44Z5nPzQzuP_yKTOC9-OCbcP8DoWBlv5jLBy9Mk73dxvx8wkjX5IGtSdg3rfyS17tBOX0Cq4j4yAkpl4MfXqrXVy0DeTXQyMiq8NWF9NBEJW3qO2FUZ_3Tl65MY8TC7ClINk6igvbQHfAfqx0v12Sj1gLcZ8_sG3dsiiiSeP9QcMMaFpnr1YgnEK3VGLbHzuvHtL4BNOpHZANHx8dfjy6uF5cyf6DY6iOoc8Vl4R3mBGVjtMRokAi8fRnremdvx5pG6YfjvksZNh3FGMNp7nBDKMEDO-afkTatscmcIwCxECS9BpeteSWFD6VnDVCZhlZ_H5l_A"}] 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"41µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"123µs
And I refer to "{result}" as "vpcService"14µs
And I refer to "{UID}" as "ReceiverVpcId"16µs
And I refer to "{Cn03NonAllowlistedRequesterVpcId}" as "NonAllowlistedRequesterVpcId"14µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"17µs
And "{ReceiverVpcId}" is not nil14µs
Given "{NonAllowlistedRequesterVpcId}" is not nil18µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"81µs
Then "{result.AllowedListDefined}" is true21µs
And "{result.Allowed}" is false17µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"122ms
Then "{result.DryRunAllowed}" is false66µs
And "{result.AllowListDefined}" is true53µs
And "{result.RequesterInAllowList}" is false53µs
And "{result.GuardrailExpectation}" is "deny"278µs
And "{result.GuardrailMismatch}" is false38µs
And "{result.ExitCode}" should be greater than "0"38µs
And "{result.Reason}" contains "guardrail aligned"34µs
And "{result.ConflictType}" is ""20µs