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

Test Parameters

ServiceTypevpc
ProviderServiceTypeec2:vpc
CatalogTypesCCC.VPC
TagFilter@MAIN, @CCC.VPC
UIDvpc-02b2cf8649cae372a
ResourceNamecfi-1776043305-vpc-cn03-allowed-requester-01
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:03

Total Run Time: 790ms

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"53µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"142µs
And I refer to "{result}" as "vpcService"20µs
When I call "{vpcService}" with "CountDefaultVpcs"83ms
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"29µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"146µs
And I refer to "{result}" as "vpcService"20µs
Given I refer to "{UID}" as "TargetVpcId"19µs
When I call "{vpcService}" with "EvaluatePublicSubnetDefaultIPControl" using argument "{TargetVpcId}"108ms
Then "{result.ViolatingSubnetCount}" is "0"48µ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"31µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"155µs
And I refer to "{result}" as "vpcService"21µs
Given I refer to "{UID}" as "TargetVpcId"20µs
When I call "{vpcService}" with "SelectPublicSubnetForTest" using argument "{TargetVpcId}"73ms
And I refer to "{result.SubnetId}" as "TestSubnetId"46µs
And I call "{vpcService}" with "CreateTestResourceInSubnet" using argument "{TestSubnetId}"35µs
And I refer to "{result.ResourceId}" as "TestResourceId"19µs
And I call "{vpcService}" with "GetResourceExternalIpAssignment" using argument "{TestResourceId}"27µs
And I refer to "{result.HasExternalIp}" as "HasExternalIp"18µs
Then "{HasExternalIp}" is false30µs
When I call "{vpcService}" with "DeleteTestResource" using argument "{TestResourceId}"20µs
Then "{result.Deleted}" is true55µ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"49µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"147µs
And I refer to "{result}" as "vpcService"23µs
And I load environment variable "CN03_RECEIVER_VPC_ID" as "ReceiverVpcId"21µs
And I load environment variable "CN03_NON_ALLOWLISTED_REQUESTER_VPC_ID" as "NonAllowlistedRequesterVpcId"18µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"15µs
And "{ReceiverVpcId}" is not nil14µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"171ms
And I attach "{result.Summary}" to the test output as "Disallow-list Enforcement Summary"67µs
And I attach "{result.Results}" to the test output as "Disallow-list Enforcement"95µs
Then "{result.ListDefined}" is true24µs
And "{result.TestedCount}" should be greater than "0"37µs
And "{result.AllCorrect}" is true19µs
And "{result.ViolationCount}" is "0"25µ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: 72994262-eb00-4bbb-b98f-9a480f286278, 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: powDgqcyDikHUqBNt6D1FbSLqhR0brbJV4DWH5wou6n8u0Z5euX7JyGSfTHtxtsTTUMg_FrPz2yTzDPY2-jfQivcUv62EeeM43HIp7aUTJNAjkMxSXOCqYrxhJWIWiQiuXYbUH9QLYyWFDcvGcUh7cdVQ9nn9eC9t6SMc5osN9arjGmX8q0x1dmbXF2_iWkr8xntuKClzziNej1P5LsY2Ae3XeledxYcjHqdEkMeC2_3crIu5OhezAPiteArunWK3auUANe57CBaePxsgC0lpsgDGvmxngVUeK7UNq6XC7Q67AKQ-mlF1zXXBowPDp1UDFFkqt9yNxKbq2H4vf9zYHrK-781dpE-t5DrEANv9zcaIaaQ4ea-E8tDrYP4A0cWJlhtdlBR4-br3Y7IK4G4rxf6ux_GOBGLBFxT1bdrr6XBfDhZATQYd935QVQk5fM_Lnf6b8n_PBOQOXqqoKhus5c3duEXLqH7hWfOKThkoN-o31oA2K00YnvamglQZ6xHwzr-izBd5GUUmBv5DKEzU8LouTzK8AkZVAnzql1EdD7UreQz1ZjL21azr-d4Y6jK7TocHf30_PA8TzcKB7dGrVKap8wfyK7JeoGilfA03dyjEViUKFXIFDWcuunesoUDnWVzmMXIPd4JncdzYDEjkHoKwbodybgkyBEeg_WJvOwnPdVdIipKlCUZTFixucYNPlYfpvJsq9f88MhmiO1DbITTKoTkkb1qkaGB_cxh-eU1dZwZCmEiA87ZfMQxmS7uj0zuJHnlUZbn8L_zvAvx9kDJ; 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: 72994262-eb00-4bbb-b98f-9a480f286278, 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: powDgqcyDikHUqBNt6D1FbSLqhR0brbJV4DWH5wou6n8u0Z5euX7JyGSfTHtxtsTTUMg_FrPz2yTzDPY2-jfQivcUv62EeeM43HIp7aUTJNAjkMxSXOCqYrxhJWIWiQiuXYbUH9QLYyWFDcvGcUh7cdVQ9nn9eC9t6SMc5osN9arjGmX8q0x1dmbXF2_iWkr8xntuKClzziNej1P5LsY2Ae3XeledxYcjHqdEkMeC2_3crIu5OhezAPiteArunWK3auUANe57CBaePxsgC0lpsgDGvmxngVUeK7UNq6XC7Q67AKQ-mlF1zXXBowPDp1UDFFkqt9yNxKbq2H4vf9zYHrK-781dpE-t5DrEANv9zcaIaaQ4ea-E8tDrYP4A0cWJlhtdlBR4-br3Y7IK4G4rxf6ux_GOBGLBFxT1bdrr6XBfDhZATQYd935QVQk5fM_Lnf6b8n_PBOQOXqqoKhus5c3duEXLqH7hWfOKThkoN-o31oA2K00YnvamglQZ6xHwzr-izBd5GUUmBv5DKEzU8LouTzK8AkZVAnzql1EdD7UreQz1ZjL21azr-d4Y6jK7TocHf30_PA8TzcKB7dGrVKap8wfyK7JeoGilfA03dyjEViUKFXIFDWcuunesoUDnWVzmMXIPd4JncdzYDEjkHoKwbodybgkyBEeg_WJvOwnPdVdIipKlCUZTFixucYNPlYfpvJsq9f88MhmiO1DbITTKoTkkb1qkaGB_cxh-eU1dZwZCmEiA87ZfMQxmS7uj0zuJHnlUZbn8L_zvAvx9kDJ"},{"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: 63dbc6c1-e1b0-4b06-987a-7f8ffb16f4a1, 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: lxMzeZXtOTslQz00lsnsnTqcAPTXBgsjmu7Aj8pr-mmK5U6t2Pd5IY4rVOpk_ybN4v2Jo7c3Ypj2hJpJkhGZrNMwFxREEviy7mOIhCO1SwtAh2s8oLhr1iAWnI3kis8Q6NRGEL5s2AAOCnh3Fwg1t0V6ljp7NGrTpiu67-lr8OD2-KDULN5YJDinGx2PWQU6_h_EjulfUMlG-AJOWvxaAxgxXzoh4MYJGwuTHxE_HXuONNJSjEwchx1HVje97w5TI8fDebtfPQkuZrcgfgdhMCaQdmZFIaDJ05HxZnDv9IHppjNtr4lcsl5hNBc78_niLqNSIU_kZQ5iqxBotukZzhJRSEvPZeBQFN5vIQOFGTUnJxE9TRz7KZnmal3nzzJOEmAGRpzSGWTkFawbS36yh4KnA_PgOuuaji_xIx8pVARr4wTDZX6TdcHPcZgc3nmINlGmd1YuzDA_Mogft3EVqUYOrdU54Th_6CWUaEAXTdMa5K452c9AqPq8GyWAxBeOAWLm9Aex3hMCq7js4uk7ab_EC_zpb16VNwB0DJUVvewClk8RTTj167azYzIF_z43mXP-J2U6vJOAVU2Xuk-TeSskggnzgocIurkbhfLHuamSMhuCeCm-uqwfEc02snicwznBgn6dUE9BVoHFF1u3urNiFbUZoiMon0xq_lWSzPOyqxYNXQbvbVhJl1KVDO8pFWbYW8CMW9TwpYejHgBvMokGLxVryZueYsIhiVklRTBasTgjxz40t3NTneGmXxsArQ4B5fbTj53gfoALDWTD8cR1; 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: 63dbc6c1-e1b0-4b06-987a-7f8ffb16f4a1, 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: lxMzeZXtOTslQz00lsnsnTqcAPTXBgsjmu7Aj8pr-mmK5U6t2Pd5IY4rVOpk_ybN4v2Jo7c3Ypj2hJpJkhGZrNMwFxREEviy7mOIhCO1SwtAh2s8oLhr1iAWnI3kis8Q6NRGEL5s2AAOCnh3Fwg1t0V6ljp7NGrTpiu67-lr8OD2-KDULN5YJDinGx2PWQU6_h_EjulfUMlG-AJOWvxaAxgxXzoh4MYJGwuTHxE_HXuONNJSjEwchx1HVje97w5TI8fDebtfPQkuZrcgfgdhMCaQdmZFIaDJ05HxZnDv9IHppjNtr4lcsl5hNBc78_niLqNSIU_kZQ5iqxBotukZzhJRSEvPZeBQFN5vIQOFGTUnJxE9TRz7KZnmal3nzzJOEmAGRpzSGWTkFawbS36yh4KnA_PgOuuaji_xIx8pVARr4wTDZX6TdcHPcZgc3nmINlGmd1YuzDA_Mogft3EVqUYOrdU54Th_6CWUaEAXTdMa5K452c9AqPq8GyWAxBeOAWLm9Aex3hMCq7js4uk7ab_EC_zpb16VNwB0DJUVvewClk8RTTj167azYzIF_z43mXP-J2U6vJOAVU2Xuk-TeSskggnzgocIurkbhfLHuamSMhuCeCm-uqwfEc02snicwznBgn6dUE9BVoHFF1u3urNiFbUZoiMon0xq_lWSzPOyqxYNXQbvbVhJl1KVDO8pFWbYW8CMW9TwpYejHgBvMokGLxVryZueYsIhiVklRTBasTgjxz40t3NTneGmXxsArQ4B5fbTj53gfoALDWTD8cR1"}]
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"43µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"129µs
And I refer to "{result}" as "vpcService"15µ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"31µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"16µs
And "{ReceiverVpcId}" is not nil16µs
Given "{NonAllowlistedRequesterVpcId}" is not nil21µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"101µs
Then "{result.AllowedListDefined}" is true37µs
And "{result.Allowed}" is false21µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"84ms
Then "{result.DryRunAllowed}" is false59µs
And "{result.AllowListDefined}" is true23µs
And "{result.RequesterInAllowList}" is false21µs
And "{result.GuardrailExpectation}" is "deny"23µs
And "{result.GuardrailMismatch}" is false19µs
And "{result.ExitCode}" should be greater than "0"22µs
And "{result.Reason}" contains "guardrail aligned"24µ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"136µs
And I refer to "{result}" as "vpcService"20µs
Given I refer to "{UID}" as "TargetVpcId"21µs
When I call "{vpcService}" with "EvaluateVpcFlowLogsControl" using argument "{TargetVpcId}"95ms
Then "{result.FlowLogCount}" should be greater than "0"61µs
expected {result.FlowLogCount} (0) to be greater than 0
And "{result.NonCompliantCount}" is "0"18µ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"41µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"143µs
And I refer to "{result}" as "vpcService"16µs
Given I refer to "{UID}" as "TargetVpcId"15µs
When I call "{vpcService}" with "PrepareFlowLogDeliveryObservation" using argument "{TargetVpcId}"70ms
And I call "{vpcService}" with "GenerateTestTraffic" using argument "{TargetVpcId}"54ms
And I refer to "{result.ResourceId}" as "TestResourceId"50µs
And I refer to "{result.CleanupDeleted}" as "TrafficCleanupDeleted"22µs
And I call "{vpcService}" with "ObserveRecentFlowLogDelivery" using argument "{TargetVpcId}"40ms
And I refer to "{result.RecordsObserved}" as "RecordsObserved"33µs
And I call "{vpcService}" with "DeleteTestResource" using argument "{TestResourceId}"29µs
Then "{result.Deleted}" is true26µs
expected {result.Deleted} to be truthy, got (type: )
And "{TrafficCleanupDeleted}" is true17µs
And "{RecordsObserved}" is true17µs