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"35µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"149µs
And I refer to "{result}" as "vpcService"27µs
And I refer to "{UID}" as "ReceiverVpcId"23µs
And I refer to "{Cn03NonAllowlistedRequesterVpcId}" as "NonAllowlistedRequesterVpcId"18µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"21µs
And "{ReceiverVpcId}" is not nil18µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"507ms
And I attach "{result.Summary}" to the test output as "Disallow-list Enforcement Summary"57µs
And I attach "{result.Results}" to the test output as "Disallow-list Enforcement"120µs
Then "{result.ListDefined}" is true46µs
And "{result.TestedCount}" should be greater than "0"42µs
And "{result.AllCorrect}" is true37µs
And "{result.ViolationCount}" is "0"34µ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-0538ea308fdf4f8c4","Reason":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: 3016f5fc-4636-4b68-9352-455d23d02fbc, 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: VgqkhcFF9BRvsAV14aZ3f8UoPLTa9Trzfz8gbuFTg4aPpUBsa-sNhbFr0hd0L9bupQwQWQlyjOdZ-2sQpi0YEcMF35Ks0OfzM9qdPK34II5bfBmzbC3m5tZZ2Gdf--CMqbroXwPufs9yLEHBhK9c0Fa9UXd7J7bFXKrGVTTO3cwLAxpYi9NvmPbMSNY2aC76mh8O7JIBNVtJgJUvo33GWaDlYfNkolxpIPu06f8im-VGiJYOQSW_sMHXZ5yOAaUg4kpfn0320yg9kYEjJLlH1UuQGkH5grOMtkDVv17YCvtwKbcbnaemfCt6bQypGWRGT9GscJwQM6-7XrfpZT-nKTKMF_4z1_cGddUfq5sg9n3t6Zj1G4_G2DjURXGEw1ypAnGxd64-m-T0mxaMX4iHnjEVrYi3bmuGNsWbsTGGoAbrGNrBCt_I2mps3RICMNVls8rgggUKO01UadO8gxg0vENIOOz2jxfnNbKfDpLcMIMtVMgUqGi562bjAqkZh5j4auSdewos_ytllIIZmdLcjWr48uFGpoB7_HNbC3CfJuzLORM1sHg2x-nDcClYQEj4k1ThO6a95AtcWY-wy8m275komGle4KTtUSx9cHRyCQll_5YWtui5xeN_Ip3Lg7X0SuZ5ZAdSyBIWeKKgWOD_MA8vqxbFBtR-lPmqPG2TZRFZ8_D8y9xhGx8LXu8hagOpjxGnAeIjwzKOd-z8nJ38hvCdy83LB0_5JZtXr7XATcNpLXWRK4kzRaQ4L3HGUUiq5sIH2Dd5N2ZBvf-kWwza5677qYBmjw; CN03 guardrail aligned: allow-list expects deny for requester vpc-05cd70ec8c2768550","ReceiverVpcId":"vpc-0538ea308fdf4f8c4","RequesterInAllowList":false,"RequesterVpcId":"vpc-05cd70ec8c2768550","Stderr":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: 3016f5fc-4636-4b68-9352-455d23d02fbc, 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: VgqkhcFF9BRvsAV14aZ3f8UoPLTa9Trzfz8gbuFTg4aPpUBsa-sNhbFr0hd0L9bupQwQWQlyjOdZ-2sQpi0YEcMF35Ks0OfzM9qdPK34II5bfBmzbC3m5tZZ2Gdf--CMqbroXwPufs9yLEHBhK9c0Fa9UXd7J7bFXKrGVTTO3cwLAxpYi9NvmPbMSNY2aC76mh8O7JIBNVtJgJUvo33GWaDlYfNkolxpIPu06f8im-VGiJYOQSW_sMHXZ5yOAaUg4kpfn0320yg9kYEjJLlH1UuQGkH5grOMtkDVv17YCvtwKbcbnaemfCt6bQypGWRGT9GscJwQM6-7XrfpZT-nKTKMF_4z1_cGddUfq5sg9n3t6Zj1G4_G2DjURXGEw1ypAnGxd64-m-T0mxaMX4iHnjEVrYi3bmuGNsWbsTGGoAbrGNrBCt_I2mps3RICMNVls8rgggUKO01UadO8gxg0vENIOOz2jxfnNbKfDpLcMIMtVMgUqGi562bjAqkZh5j4auSdewos_ytllIIZmdLcjWr48uFGpoB7_HNbC3CfJuzLORM1sHg2x-nDcClYQEj4k1ThO6a95AtcWY-wy8m275komGle4KTtUSx9cHRyCQll_5YWtui5xeN_Ip3Lg7X0SuZ5ZAdSyBIWeKKgWOD_MA8vqxbFBtR-lPmqPG2TZRFZ8_D8y9xhGx8LXu8hagOpjxGnAeIjwzKOd-z8nJ38hvCdy83LB0_5JZtXr7XATcNpLXWRK4kzRaQ4L3HGUUiq5sIH2Dd5N2ZBvf-kWwza5677qYBmjw"},{"AllowListDefined":true,"ConflictMessage":"","ConflictType":"","DryRunAllowed":false,"ErrorCode":"UnauthorizedOperation","ExitCode":1,"GuardrailExpectation":"deny","GuardrailMismatch":false,"Origin":"terraform-fixture","PeerOwnerId":"","PeerVpcId":"vpc-0538ea308fdf4f8c4","Reason":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: 2f1d59ed-bc6a-4ed1-8c8c-a0918bde5828, 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: dwLhbERA8e9C2qFUCgzwIMma5ENzeaRMptZvQ2AMiOsmPfy2UTbuoQ8Rv_R2A0D31lSsaKwwBZsNmGVTt6o0bzMh8UkuMsEMG600ljBw4zXYms47vy4kG_rEKoSsPozphJuW8ffbTgN1X5TfJGWHErDXxxS-_ouiDTCDHLWdTBzlAwhibWXx5eaqr4cQubeCcK9e3I8oib84nHDsr1FaWKl9m0yyJYGAXSsEEZtOwg7O8JzqZAAQ0jmL8tN7hYT0bE6aQkoTFdOkVd7BmQzd5YVFZAk4ZhMEoOZZz2Czobse6dm2ppKfjCOWcNREsmwjfF2Tpl07JTnCgv8OJDMLm_5tm-jAxWO8X83BNgFpjAXmKdZSCVMkPRswtLNtE6bpwlnTcsi0r4mBd5P4142D5rv4ljzh2N19L2mET-0AJaXoZDXrn4S6Ke5Ugc0nScrBXaBo_2xAABVZ5LcbVyCXYG0VGcPxSpBE1VYqCT0Ka149297q8JTFp5GIAtQV7FN5SLrVqIA4KgSd54nW7Wn5pwu4K_IHaqA1zRN7FDOlbnpIq7G7eOHJC_RCP3YaMFySexpNA1EOMpE5Yh01o1p66ZizqzSnr8S7_yT87fh6O8Zxjd3k9wrmjLk0FyxX3yz2lKPuMA0V-Nuix9Cf-JfYZqvXj44xRUGeBJY6o-qkGRzr7ouOtLt_oy6EGD-7-IBKsVIkG-KwsEiyXYFjAT6_2QYXiVDA67wDfCw1Poarn0t1tmUIV1yyw0XmKCEkDa_Wja5nCXFaihGigSfJSVoWgKc1J07han4; CN03 guardrail aligned: allow-list expects deny for requester vpc-0891a4a861e79a190","ReceiverVpcId":"vpc-0538ea308fdf4f8c4","RequesterInAllowList":false,"RequesterVpcId":"vpc-0891a4a861e79a190","Stderr":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: 2f1d59ed-bc6a-4ed1-8c8c-a0918bde5828, 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: dwLhbERA8e9C2qFUCgzwIMma5ENzeaRMptZvQ2AMiOsmPfy2UTbuoQ8Rv_R2A0D31lSsaKwwBZsNmGVTt6o0bzMh8UkuMsEMG600ljBw4zXYms47vy4kG_rEKoSsPozphJuW8ffbTgN1X5TfJGWHErDXxxS-_ouiDTCDHLWdTBzlAwhibWXx5eaqr4cQubeCcK9e3I8oib84nHDsr1FaWKl9m0yyJYGAXSsEEZtOwg7O8JzqZAAQ0jmL8tN7hYT0bE6aQkoTFdOkVd7BmQzd5YVFZAk4ZhMEoOZZz2Czobse6dm2ppKfjCOWcNREsmwjfF2Tpl07JTnCgv8OJDMLm_5tm-jAxWO8X83BNgFpjAXmKdZSCVMkPRswtLNtE6bpwlnTcsi0r4mBd5P4142D5rv4ljzh2N19L2mET-0AJaXoZDXrn4S6Ke5Ugc0nScrBXaBo_2xAABVZ5LcbVyCXYG0VGcPxSpBE1VYqCT0Ka149297q8JTFp5GIAtQV7FN5SLrVqIA4KgSd54nW7Wn5pwu4K_IHaqA1zRN7FDOlbnpIq7G7eOHJC_RCP3YaMFySexpNA1EOMpE5Yh01o1p66ZizqzSnr8S7_yT87fh6O8Zxjd3k9wrmjLk0FyxX3yz2lKPuMA0V-Nuix9Cf-JfYZqvXj44xRUGeBJY6o-qkGRzr7ouOtLt_oy6EGD-7-IBKsVIkG-KwsEiyXYFjAT6_2QYXiVDA67wDfCw1Poarn0t1tmUIV1yyw0XmKCEkDa_Wja5nCXFaihGigSfJSVoWgKc1J07han4"}] 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"62µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"208µs
And I refer to "{result}" as "vpcService"52µs
And I refer to "{UID}" as "ReceiverVpcId"36µs
And I refer to "{Cn03NonAllowlistedRequesterVpcId}" as "NonAllowlistedRequesterVpcId"63µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"29µs
And "{ReceiverVpcId}" is not nil22µs
Given "{NonAllowlistedRequesterVpcId}" is not nil38µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"142µs
Then "{result.AllowedListDefined}" is true51µs
And "{result.Allowed}" is false33µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"352ms
Then "{result.DryRunAllowed}" is false65µs
And "{result.AllowListDefined}" is true63µs
And "{result.RequesterInAllowList}" is false53µs
And "{result.GuardrailExpectation}" is "deny"38µs
And "{result.GuardrailMismatch}" is false45µs
And "{result.ExitCode}" should be greater than "0"39µs
And "{result.Reason}" contains "guardrail aligned"43µs
And "{result.ConflictType}" is ""32µs