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"42µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"161µs
And I refer to "{result}" as "vpcService"18µs
And I refer to "{UID}" as "ReceiverVpcId"17µs
And I refer to "{Cn03NonAllowlistedRequesterVpcId}" as "NonAllowlistedRequesterVpcId"22µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"27µs
And "{ReceiverVpcId}" is not nil19µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"211ms
And I attach "{result.Summary}" to the test output as "Disallow-list Enforcement Summary"74µs
And I attach "{result.Results}" to the test output as "Disallow-list Enforcement"97µs
Then "{result.ListDefined}" is true36µs
And "{result.TestedCount}" should be greater than "0"38µs
And "{result.AllCorrect}" is true
28µsexpected {result.AllCorrect} to be truthy, got false (type: bool)
And "{result.ViolationCount}" is "0"31µs
📎 Attachments:Disallow-list Enforcement Summary
View Content (50 bytes)
2 of 2 disallow-list VPC(s) had guardrail mismatch
Disallow-list Enforcement
View JSON (1649 bytes)
[{"AllowListDefined":true,"ConflictMessage":"non-allowlisted requester permitted by guardrail policy","ConflictType":"DENYLIST_CONFLICT","DryRunAllowed":true,"ErrorCode":"DryRunOperation","ExitCode":0,"GuardrailExpectation":"deny","GuardrailMismatch":true,"Origin":"terraform-fixture","PeerOwnerId":"","PeerVpcId":"vpc-0f3af4b6986f1e0ab","Reason":"DryRunOperation indicates request would be allowed; CN03 guardrail mismatch: allow-list expects deny for requester vpc-0a7d07499ce3992e8","ReceiverVpcId":"vpc-0f3af4b6986f1e0ab","RequesterInAllowList":false,"RequesterVpcId":"vpc-0a7d07499ce3992e8","Stderr":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 412, RequestID: 6a564564-5498-437f-b9df-67da83055e88, api error DryRunOperation: Request would have succeeded, but DryRun flag is set."},{"AllowListDefined":true,"ConflictMessage":"non-allowlisted requester permitted by guardrail policy","ConflictType":"DENYLIST_CONFLICT","DryRunAllowed":true,"ErrorCode":"DryRunOperation","ExitCode":0,"GuardrailExpectation":"deny","GuardrailMismatch":true,"Origin":"terraform-fixture","PeerOwnerId":"","PeerVpcId":"vpc-0f3af4b6986f1e0ab","Reason":"DryRunOperation indicates request would be allowed; CN03 guardrail mismatch: allow-list expects deny for requester vpc-0eadc3a916f373b88","ReceiverVpcId":"vpc-0f3af4b6986f1e0ab","RequesterInAllowList":false,"RequesterVpcId":"vpc-0eadc3a916f373b88","Stderr":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 412, RequestID: 58f55d2c-d9f8-459b-a25e-51fa07b2e33d, api error DryRunOperation: Request would have succeeded, but DryRun flag is set."}] 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"44µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"108µs
And I refer to "{result}" as "vpcService"27µs
And I refer to "{UID}" as "ReceiverVpcId"16µs
And I refer to "{Cn03NonAllowlistedRequesterVpcId}" as "NonAllowlistedRequesterVpcId"17µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"34µs
And "{ReceiverVpcId}" is not nil15µs
Given "{NonAllowlistedRequesterVpcId}" is not nil17µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"125µs
Then "{result.AllowedListDefined}" is true26µs
And "{result.Allowed}" is false27µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"120ms
Then "{result.DryRunAllowed}" is false
44µsexpected {result.DryRunAllowed} to be falsy, got true (type: bool)
And "{result.AllowListDefined}" is true24µs
And "{result.RequesterInAllowList}" is false28µs
And "{result.GuardrailExpectation}" is "deny"30µs
And "{result.GuardrailMismatch}" is false24µs
And "{result.ExitCode}" should be greater than "0"28µs
And "{result.Reason}" contains "guardrail aligned"28µs
And "{result.ConflictType}" is ""24µs