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"33µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"130µs
And I refer to "{result}" as "vpcService"20µ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"29µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"25µs
And "{ReceiverVpcId}" is not nil23µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"499ms
And I attach "{result.Summary}" to the test output as "Disallow-list Enforcement Summary"43µs
And I attach "{result.Results}" to the test output as "Disallow-list Enforcement"96µs
Then "{result.ListDefined}" is true36µs
And "{result.TestedCount}" should be greater than "0"41µs
And "{result.AllCorrect}" is true19µ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-027ef85c88b9d68c2","Reason":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: 863901f2-d66a-4842-838c-993e95bed78c, 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: ghZCIMweZWnQ3Pdfm7NhjKzHilRNy79d0gd3n7E7nOYQW9u-AVf8_odE5mWIS0CqvFR2BOEB-r3nQO5tnPggJ2YCTLX073Je3-LRuVKYuB0mt5q0bwgkmmdJxLkPOCaW5UcmVXxmSs4hykUcIBh5EJBzHlmgeQp10mgJUc51qJCDuHydyFmwsiCBWOFzVZISrBAs0-J_Vtx5vchCrvwCpKP5bZVB6buVZDqDnFfox57-PoLapR5PLA5n2XoH13KWmYX4j1oZ34D1pvqZK48DYNln6ziCZ8GXKGoEf_FzktpA1BV8CBct8-3ABDlbA03bhTv4y0IscrY5feQGHm0RxRR_AxjbXHqlT2jdbheFoUY9EfDWZsoBxkk9en-eRZMEr_qDhBiwtnamZZToUaUHa3BkeEQG1JZ7ArXNejokQr0WHCG1mKzkSH0GuqIxG4402yB5lCe3rL_d94IBbp0ATN-8BGScDSiLOWQltAUrbFyIbb4LezkEU3unxk0fmlAA8n76XQgGh0bx8XHh7sZ_bM2k-Eu9CxQjGflGT5on2x4mM99gwHA6nHugyrRyLS9arVl_bJnPmJepsoyBn4xr4K8fzcHjLlYVpEvXhjp1OYATZY4OzYxO_V1CC7hoK1MDtP8ppY1ylgxEo-nvLOfDhs1MZbpjWLOtsbXdzrXps-18tNK6E-w11W1Yb8qsA2v28WaXF8_4Fj_666TEvhtQc9aykOHno5-m9IJMS5nHnaDJMYzMJ6nfiDMqtHyr1wPXmDWaDxJvX2auPyBI2eR0YmQG; 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: 863901f2-d66a-4842-838c-993e95bed78c, 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: ghZCIMweZWnQ3Pdfm7NhjKzHilRNy79d0gd3n7E7nOYQW9u-AVf8_odE5mWIS0CqvFR2BOEB-r3nQO5tnPggJ2YCTLX073Je3-LRuVKYuB0mt5q0bwgkmmdJxLkPOCaW5UcmVXxmSs4hykUcIBh5EJBzHlmgeQp10mgJUc51qJCDuHydyFmwsiCBWOFzVZISrBAs0-J_Vtx5vchCrvwCpKP5bZVB6buVZDqDnFfox57-PoLapR5PLA5n2XoH13KWmYX4j1oZ34D1pvqZK48DYNln6ziCZ8GXKGoEf_FzktpA1BV8CBct8-3ABDlbA03bhTv4y0IscrY5feQGHm0RxRR_AxjbXHqlT2jdbheFoUY9EfDWZsoBxkk9en-eRZMEr_qDhBiwtnamZZToUaUHa3BkeEQG1JZ7ArXNejokQr0WHCG1mKzkSH0GuqIxG4402yB5lCe3rL_d94IBbp0ATN-8BGScDSiLOWQltAUrbFyIbb4LezkEU3unxk0fmlAA8n76XQgGh0bx8XHh7sZ_bM2k-Eu9CxQjGflGT5on2x4mM99gwHA6nHugyrRyLS9arVl_bJnPmJepsoyBn4xr4K8fzcHjLlYVpEvXhjp1OYATZY4OzYxO_V1CC7hoK1MDtP8ppY1ylgxEo-nvLOfDhs1MZbpjWLOtsbXdzrXps-18tNK6E-w11W1Yb8qsA2v28WaXF8_4Fj_666TEvhtQc9aykOHno5-m9IJMS5nHnaDJMYzMJ6nfiDMqtHyr1wPXmDWaDxJvX2auPyBI2eR0YmQG"},{"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: 4b22a979-cb3e-412a-8824-d692d0d2f07e, 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: PRe5rInFwJJw8I1II70mF4MJL1AV8JB8X8awh0V88eLa7ZHykxiUbsVyYzyxYoy6HLR5DSd5Ifg3YkZIw0l6Zej1GvOt2nsOSDdwYi3HeLDX6IXnRWa_eqIvYB30-9W9cHnqdTHCeAyhL2dr-w6GvzCPU2l0_4P6RBdqbShDz0cMZ8qgPBzsp4DZopW1LkXM0tedskyKz4qUc0NzpPotIZqxfaK07mcPHdhjhMjS46rHcwwUoWS--MAoal7d5rZSFSMC1Yqy7IZgc67GkS_yWW1ekC1ijJ9Q-I-fgak2-gYg3PjGa2l5Ost_qK1CsGPbCewkVpI1FRHUCzkloOB8kze0ZCsRxQDc5mW2Zc0sc2YE8X_hBBQ0rmsK1sf430Ygxc0PplAsj8u1l42x4PYB_aoDTI0oHVzd5ORoKxHwYK0006m_3G_6afsMP6H7SoqDXrVk5BKqTUflQoygHA9k-_jM10rNjU1QTZj0m5N5QDIynuAuYXu_zkVWdKMcFpNoAzYlP-UNCS7g7ITQCV6yqW2lHtc9FxcN1ryCoef7Mci-ri0M_bfo7NJTsbTAUCGUtwIsUH0D1lhFHaC3CTS1Om4ZKLHlej2s0aCVrFsQFvtbxntCE1kHn2Q5YLtCNoN-egtoF9FzXg0X-grIcHEjyTr0bM9DPLzyUZ0XtXB3leVIybV-wReiaQZTA_tfpEUfZVjFoi2tHDVb45XPyTVKFsg60qTf3DayL8ECePOJSIj_vra9n-QA-0Qlro_3PukVx-QMNkITUvCj-zxf2uZ4bsBD; 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: 4b22a979-cb3e-412a-8824-d692d0d2f07e, 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: PRe5rInFwJJw8I1II70mF4MJL1AV8JB8X8awh0V88eLa7ZHykxiUbsVyYzyxYoy6HLR5DSd5Ifg3YkZIw0l6Zej1GvOt2nsOSDdwYi3HeLDX6IXnRWa_eqIvYB30-9W9cHnqdTHCeAyhL2dr-w6GvzCPU2l0_4P6RBdqbShDz0cMZ8qgPBzsp4DZopW1LkXM0tedskyKz4qUc0NzpPotIZqxfaK07mcPHdhjhMjS46rHcwwUoWS--MAoal7d5rZSFSMC1Yqy7IZgc67GkS_yWW1ekC1ijJ9Q-I-fgak2-gYg3PjGa2l5Ost_qK1CsGPbCewkVpI1FRHUCzkloOB8kze0ZCsRxQDc5mW2Zc0sc2YE8X_hBBQ0rmsK1sf430Ygxc0PplAsj8u1l42x4PYB_aoDTI0oHVzd5ORoKxHwYK0006m_3G_6afsMP6H7SoqDXrVk5BKqTUflQoygHA9k-_jM10rNjU1QTZj0m5N5QDIynuAuYXu_zkVWdKMcFpNoAzYlP-UNCS7g7ITQCV6yqW2lHtc9FxcN1ryCoef7Mci-ri0M_bfo7NJTsbTAUCGUtwIsUH0D1lhFHaC3CTS1Om4ZKLHlej2s0aCVrFsQFvtbxntCE1kHn2Q5YLtCNoN-egtoF9FzXg0X-grIcHEjyTr0bM9DPLzyUZ0XtXB3leVIybV-wReiaQZTA_tfpEUfZVjFoi2tHDVb45XPyTVKFsg60qTf3DayL8ECePOJSIj_vra9n-QA-0Qlro_3PukVx-QMNkITUvCj-zxf2uZ4bsBD"}] 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"27µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"125µs
And I refer to "{result}" as "vpcService"17µ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"19µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"15µs
And "{ReceiverVpcId}" is not nil15µs
Given "{NonAllowlistedRequesterVpcId}" is not nil20µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"85µs
Then "{result.AllowedListDefined}" is true21µs
And "{result.Allowed}" is false17µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"388ms
Then "{result.DryRunAllowed}" is false347µs
And "{result.AllowListDefined}" is true61µs
And "{result.RequesterInAllowList}" is false84µs
And "{result.GuardrailExpectation}" is "deny"58µs
And "{result.GuardrailMismatch}" is false56µs
And "{result.ExitCode}" should be greater than "0"66µs
And "{result.Reason}" contains "guardrail aligned"65µs
And "{result.ConflictType}" is ""58µs