🥒 CCC.VPC Test: cfi-1776043305-vpc-cn03-allowed-requester-02

Test Parameters

ServiceTypevpc
ProviderServiceTypeec2:vpc
CatalogTypesCCC.VPC
TagFilter@MAIN, @CCC.VPC
UIDvpc-09f36d618737b4da7
ResourceNamecfi-1776043305-vpc-cn03-allowed-requester-02
Instance
{
  "ID": "main-aws",
  "Properties": {
    "Provider": "aws",
    "Region": "us-east-1",
    "AzureResourceGroup": "",
    "AzureSubscriptionID": "",
    "GcpProjectId": ""
  },
  "Services": [
    {
      "Type": "object-storage",
      "Properties": {
        "object-storage-retention-period-days": 2
      }
    },
    {
      "Type": "logging",
      "Properties": {
        "aws-cloud-trail-log-group-name": "cfi-test-log-group"
      }
    },
    {
      "Type": "vpc",
      "Properties": {
        "cn03-allowed-requester-vpc-ids": [
          "vpc-02b2cf8649cae372a,vpc-09f36d618737b4da7"
        ],
        "cn03-disallowed-requester-vpc-ids": [
          "vpc-0351e15653a529b6c,vpc-0fd941576fc1de4a0"
        ],
        "cn03-receiver-vpc-id": "vpc-05f4e0d1e4eccf07f"
      }
    }
  ],
  "Rules": {
    "permitted-account-ids": "",
    "permitted-regions": [
      "us-east-1"
    ]
  }
}
AwsCloudTrailLogGroupNamecfi-test-log-group
Cn03AllowedRequesterVpcIds
[
  "vpc-02b2cf8649cae372a,vpc-09f36d618737b4da7"
]
Cn03DisallowedRequesterVpcIds
[
  "vpc-0351e15653a529b6c,vpc-0fd941576fc1de4a0"
]
Cn03ReceiverVpcIdvpc-05f4e0d1e4eccf07f
ObjectStorageRetentionPeriodDays2
PermittedRegions
[
  "us-east-1"
]
Provideraws
Regionus-east-1

Summary

Generated: 2026-04-13 01:31:02

Total Run Time: 955ms

Features: 4

Scenarios: 7 (✅ 3 | ❌ 4)

Steps: 80 (✅ 73 | ❌ 4 | ⏭️ 3 | ❓ 0)

Feature: CCC.VPC.CN01.AR01 - Subscription must not contain default network resources
Scenario: Main check: no default VPC exists @vpc @tlp-amber @tlp-red @CCC.VPC.CN01 @CCC.VPC.CN01.AR01 @Policy @MAIN @CCC.VPC @DEFAULT
Given a cloud api for "{Instance}" in "api"55µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"128µs
And I refer to "{result}" as "vpcService"19µs
When I call "{vpcService}" with "CountDefaultVpcs"122ms
Then "{result}" is "0"22µs
Feature: CCC.VPC.CN02.AR01 - No external IP by default in public subnets
Scenario: Main check (config): public subnets do not auto-assign external IPs @vpc @tlp-red @CCC.VPC.CN02 @CCC.VPC.CN02.AR01 @Policy @MAIN @CCC.VPC @DEFAULT
Given a cloud api for "{Instance}" in "api"36µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"134µs
And I refer to "{result}" as "vpcService"21µs
Given I refer to "{UID}" as "TargetVpcId"24µs
When I call "{vpcService}" with "EvaluatePublicSubnetDefaultIPControl" using argument "{TargetVpcId}"129ms
Then "{result.ViolatingSubnetCount}" is "0"45µs
And "{result.Reason}" contains "disable default public IP"37µs
expected {result.Reason} to contain 'disable default public IP', but got 'no public subnets found for in-scope VPC'
Scenario: Behavioural check (active): resource launched in public subnet is not assigned an external IP @vpc @tlp-red @CCC.VPC.CN02 @CCC.VPC.CN02.AR01 @Behavioural @MAIN @CCC.VPC
Given a cloud api for "{Instance}" in "api"64µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"189µs
And I refer to "{result}" as "vpcService"36µs
Given I refer to "{UID}" as "TargetVpcId"37µs
When I call "{vpcService}" with "SelectPublicSubnetForTest" using argument "{TargetVpcId}"88ms
And I refer to "{result.SubnetId}" as "TestSubnetId"43µs
And I call "{vpcService}" with "CreateTestResourceInSubnet" using argument "{TestSubnetId}"31µs
And I refer to "{result.ResourceId}" as "TestResourceId"26µs
And I call "{vpcService}" with "GetResourceExternalIpAssignment" using argument "{TestResourceId}"22µs
And I refer to "{result.HasExternalIp}" as "HasExternalIp"16µs
Then "{HasExternalIp}" is false16µs
When I call "{vpcService}" with "DeleteTestResource" using argument "{TestResourceId}"18µs
Then "{result.Deleted}" is true23µs
expected {result.Deleted} to be truthy, got (type: )
Feature: CCC.VPC.CN03.AR01 - Restrict VPC peering requests from non-allowlisted requesters
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.VPC
Given a cloud api for "{Instance}" in "api"52µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"140µs
And I refer to "{result}" as "vpcService"16µs
And I load environment variable "CN03_RECEIVER_VPC_ID" as "ReceiverVpcId"15µs
And I load environment variable "CN03_NON_ALLOWLISTED_REQUESTER_VPC_ID" as "NonAllowlistedRequesterVpcId"17µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"14µs
And "{ReceiverVpcId}" is not nil16µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"221ms
And I attach "{result.Summary}" to the test output as "Disallow-list Enforcement Summary"55µs
And I attach "{result.Results}" to the test output as "Disallow-list Enforcement"94µs
Then "{result.ListDefined}" is true31µs
And "{result.TestedCount}" should be greater than "0"34µs
And "{result.AllCorrect}" is true19µs
And "{result.ViolationCount}" is "0"19µ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-05f4e0d1e4eccf07f","Reason":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: ba930b51-6574-4677-8f9b-c566317da315, 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: b1qElrl4JDucsQdvT3LpuCS8xLTEsj69_ke8hZciY_rWjaVqKDhOod4hCzLCjwiObqImJEZALV3d0sZY3XuunN9M5eg8cBpS1tPljQo2-YgbQNQINfSwSUoEOqkTXu2oc8KwaUVTMuHhCaEmGG_uwFmdxQbhoGlI5T4RcFDpR-0CB417nYpZ7Ts5fpiE3ZWMTl2JcRYx5tDTT2lvihoU3Jt6PbQZSik6vlnJ2n2ZrP5oWaaeKcNpKsaKUiHrDC0u3Ll3FI0gkVedeJ4-08S2olQXMhhpg98s9j6RNiIdgKt575nVRFDV8EleL33wdHhgdVuVQf04DcP3bFYEnSBpy9yJjrYp_Dk-XWglhP4Zuc6sdonbxlhwxGUFCttX8T14SMTRu2v_vNhCBdTp-n7tJy16spI3rXx7e0AP9UMRGnilpXOWPNF2T0wDPPutdtOKaMrPzXzEGxN1JV_v1JBvYHlsW4sn6CDr5Hc_0NKFci7M82M-Q0ZUN-bxkab1SuCEII0_k9muetA2hhVxHWl9ipr5MS6rYQf3mtllUiO3AQwTSoZ23yUj7Hc3_cXcTrC_mNEr2Umr2clA5O2HDiLYokFtprmUy2VUqWlxg3uRdvJCdoO9MmxxJo3mG2TSAmh-lyXfDqmZw3q2fASVxj5-wom2RKifMYmQu-Yu2T52Y4moBr3NXewO4BIJZi0FwHlCf_EdXvXrM9bqirnDCnTDnmkskdSAih8H-wHsatCF5zGTw2Wyz_cq9dmL00ymsgXjDwmNB-lfOj1MbJHvGh0FCGT5; CN03 guardrail aligned: allow-list expects deny for requester vpc-0351e15653a529b6c","ReceiverVpcId":"vpc-05f4e0d1e4eccf07f","RequesterInAllowList":false,"RequesterVpcId":"vpc-0351e15653a529b6c","Stderr":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: ba930b51-6574-4677-8f9b-c566317da315, 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: b1qElrl4JDucsQdvT3LpuCS8xLTEsj69_ke8hZciY_rWjaVqKDhOod4hCzLCjwiObqImJEZALV3d0sZY3XuunN9M5eg8cBpS1tPljQo2-YgbQNQINfSwSUoEOqkTXu2oc8KwaUVTMuHhCaEmGG_uwFmdxQbhoGlI5T4RcFDpR-0CB417nYpZ7Ts5fpiE3ZWMTl2JcRYx5tDTT2lvihoU3Jt6PbQZSik6vlnJ2n2ZrP5oWaaeKcNpKsaKUiHrDC0u3Ll3FI0gkVedeJ4-08S2olQXMhhpg98s9j6RNiIdgKt575nVRFDV8EleL33wdHhgdVuVQf04DcP3bFYEnSBpy9yJjrYp_Dk-XWglhP4Zuc6sdonbxlhwxGUFCttX8T14SMTRu2v_vNhCBdTp-n7tJy16spI3rXx7e0AP9UMRGnilpXOWPNF2T0wDPPutdtOKaMrPzXzEGxN1JV_v1JBvYHlsW4sn6CDr5Hc_0NKFci7M82M-Q0ZUN-bxkab1SuCEII0_k9muetA2hhVxHWl9ipr5MS6rYQf3mtllUiO3AQwTSoZ23yUj7Hc3_cXcTrC_mNEr2Umr2clA5O2HDiLYokFtprmUy2VUqWlxg3uRdvJCdoO9MmxxJo3mG2TSAmh-lyXfDqmZw3q2fASVxj5-wom2RKifMYmQu-Yu2T52Y4moBr3NXewO4BIJZi0FwHlCf_EdXvXrM9bqirnDCnTDnmkskdSAih8H-wHsatCF5zGTw2Wyz_cq9dmL00ymsgXjDwmNB-lfOj1MbJHvGh0FCGT5"},{"AllowListDefined":true,"ConflictMessage":"","ConflictType":"","DryRunAllowed":false,"ErrorCode":"UnauthorizedOperation","ExitCode":1,"GuardrailExpectation":"deny","GuardrailMismatch":false,"Origin":"terraform-fixture","PeerOwnerId":"","PeerVpcId":"vpc-05f4e0d1e4eccf07f","Reason":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: dd6c1705-0c47-4f43-b6a2-14f9db59fb0d, 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: rxTl5TVJPeMmf1pLCtLoMKsArK6_tLB3DBv_mJM8kzrC0kLaa3cxXdKzIyPk11a3JPBzlEFzgKA2PPJZyOa2PBpVAbzujY2v3QrMmkdFHSUbm69x_HVBCfzZZfm_a6vs-jGIopFEDvk4xR9Y_Q16to24_zQeaordrEK9y5oSGm2LyIfv_ZNa-kT9iBBDn6Fdkt6UV7uV5Ui874lCiQjenubYepSaQK4eK8t2jKliRikABxhLkncFWGgzXc7qeFvPLGZ3i5CLSSVooTFIkLehNemF2ZPRLc_j_WrPAdxZui-QMsT2FDLxYZQzpORHWnmanaKHcvKeTiYl7B6pr7_aHL2FdCE0NG3wBlWY2uavk-JWYTYaaKlLCQs1qgjM9taVeeQIrbrfn6AfDTd6gDOcebLX1kN9W0KXYlINr9yp_jxJD7rpglhWT-3kUHzbUeivJZCpySbe-B-1zSf4VenSSZgic_eHFAX1uBlVksC1CRmk1lGU9r8b5nGTanXMvtVJlcP_OefeZzNvPzRj947w-LheeUT_AA0B2IYqQUS04bBnEVzoHmaXir5HgifGThJSEGejRHlmfdZpLtlW6RDV2tBIHJH18IylQiAc8JSkSlJHNF9a03TDs5m5xpCYeHBt04PtZHs2cVzx9iLFnwLnenPOCpUip-R1TCjWDpdZea9CCah3gIDXKdillrbMigfPVfVHw6b3E6c7qp83rpFVx6RPcwZ3FpzF5nbMSA9C-OWOkiDeJmMewwYeY_jkddQc8J5OW9nGeVX97DFerZ3a4ITd; CN03 guardrail aligned: allow-list expects deny for requester vpc-0fd941576fc1de4a0","ReceiverVpcId":"vpc-05f4e0d1e4eccf07f","RequesterInAllowList":false,"RequesterVpcId":"vpc-0fd941576fc1de4a0","Stderr":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: dd6c1705-0c47-4f43-b6a2-14f9db59fb0d, 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: rxTl5TVJPeMmf1pLCtLoMKsArK6_tLB3DBv_mJM8kzrC0kLaa3cxXdKzIyPk11a3JPBzlEFzgKA2PPJZyOa2PBpVAbzujY2v3QrMmkdFHSUbm69x_HVBCfzZZfm_a6vs-jGIopFEDvk4xR9Y_Q16to24_zQeaordrEK9y5oSGm2LyIfv_ZNa-kT9iBBDn6Fdkt6UV7uV5Ui874lCiQjenubYepSaQK4eK8t2jKliRikABxhLkncFWGgzXc7qeFvPLGZ3i5CLSSVooTFIkLehNemF2ZPRLc_j_WrPAdxZui-QMsT2FDLxYZQzpORHWnmanaKHcvKeTiYl7B6pr7_aHL2FdCE0NG3wBlWY2uavk-JWYTYaaKlLCQs1qgjM9taVeeQIrbrfn6AfDTd6gDOcebLX1kN9W0KXYlINr9yp_jxJD7rpglhWT-3kUHzbUeivJZCpySbe-B-1zSf4VenSSZgic_eHFAX1uBlVksC1CRmk1lGU9r8b5nGTanXMvtVJlcP_OefeZzNvPzRj947w-LheeUT_AA0B2IYqQUS04bBnEVzoHmaXir5HgifGThJSEGejRHlmfdZpLtlW6RDV2tBIHJH18IylQiAc8JSkSlJHNF9a03TDs5m5xpCYeHBt04PtZHs2cVzx9iLFnwLnenPOCpUip-R1TCjWDpdZea9CCah3gIDXKdillrbMigfPVfVHw6b3E6c7qp83rpFVx6RPcwZ3FpzF5nbMSA9C-OWOkiDeJmMewwYeY_jkddQc8J5OW9nGeVX97DFerZ3a4ITd"}]
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.VPC
Given a cloud api for "{Instance}" in "api"232µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"118µs
And I refer to "{result}" as "vpcService"16µs
And I load environment variable "CN03_RECEIVER_VPC_ID" as "ReceiverVpcId"17µ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"14µs
And "{ReceiverVpcId}" is not nil16µs
Given "{NonAllowlistedRequesterVpcId}" is not nil17µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"88µs
Then "{result.AllowedListDefined}" is true22µs
And "{result.Allowed}" is false18µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"107ms
Then "{result.DryRunAllowed}" is false36µs
And "{result.AllowListDefined}" is true22µs
And "{result.RequesterInAllowList}" is false21µs
And "{result.GuardrailExpectation}" is "deny"22µs
And "{result.GuardrailMismatch}" is false19µs
And "{result.ExitCode}" should be greater than "0"22µs
And "{result.Reason}" contains "guardrail aligned"22µs
And "{result.ConflictType}" is ""20µs
Feature: CCC.VPC.CN04.AR01 - Flow logs must capture all VPC traffic
Scenario: Main check (config): flow logs are active and capture all traffic @vpc @tlp-amber @tlp-red @CCC.VPC.CN04 @CCC.VPC.CN04.AR01 @Policy @MAIN @DEFAULT @CCC.VPC
Given a cloud api for "{Instance}" in "api"28µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"110µs
And I refer to "{result}" as "vpcService"21µs
Given I refer to "{UID}" as "TargetVpcId"18µs
When I call "{vpcService}" with "EvaluateVpcFlowLogsControl" using argument "{TargetVpcId}"69ms
Then "{result.FlowLogCount}" should be greater than "0"58µs
expected {result.FlowLogCount} (0) to be greater than 0
And "{result.NonCompliantCount}" is "0"17µs
Scenario: Behavioral check (active): traffic produces flow log records @vpc @tlp-amber @tlp-red @CCC.VPC.CN04 @CCC.VPC.CN04.AR01 @Behavioural @MAIN @CCC.VPC
Given a cloud api for "{Instance}" in "api"42µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"118µs
And I refer to "{result}" as "vpcService"21µs
Given I refer to "{UID}" as "TargetVpcId"24µs
When I call "{vpcService}" with "PrepareFlowLogDeliveryObservation" using argument "{TargetVpcId}"89ms
And I call "{vpcService}" with "GenerateTestTraffic" using argument "{TargetVpcId}"62ms
And I refer to "{result.ResourceId}" as "TestResourceId"46µs
And I refer to "{result.CleanupDeleted}" as "TrafficCleanupDeleted"34µs
And I call "{vpcService}" with "ObserveRecentFlowLogDelivery" using argument "{TargetVpcId}"55ms
And I refer to "{result.RecordsObserved}" as "RecordsObserved"34µs
And I call "{vpcService}" with "DeleteTestResource" using argument "{TestResourceId}"28µs
Then "{result.Deleted}" is true26µs
expected {result.Deleted} to be truthy, got (type: )
And "{TrafficCleanupDeleted}" is true16µs
And "{RecordsObserved}" is true16µs