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

Test Parameters

ServiceTypevpc
ProviderServiceTypeec2:vpc
CatalogTypesCCC.VPC
TagFilter@MAIN, @CCC.VPC
UIDvpc-076ba48bcbf648628
ResourceNamecfi-1776043305-vpc-cn03-non-allowlisted-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:04

Total Run Time: 762ms

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"36µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"108µs
And I refer to "{result}" as "vpcService"11µs
When I call "{vpcService}" with "CountDefaultVpcs"91ms
Then "{result}" is "0"23µ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"37µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"125µs
And I refer to "{result}" as "vpcService"15µs
Given I refer to "{UID}" as "TargetVpcId"19µs
When I call "{vpcService}" with "EvaluatePublicSubnetDefaultIPControl" using argument "{TargetVpcId}"121ms
Then "{result.ViolatingSubnetCount}" is "0"43µs
And "{result.Reason}" contains "disable default public IP"27µ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"30µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"147µs
And I refer to "{result}" as "vpcService"21µs
Given I refer to "{UID}" as "TargetVpcId"22µs
When I call "{vpcService}" with "SelectPublicSubnetForTest" using argument "{TargetVpcId}"85ms
And I refer to "{result.SubnetId}" as "TestSubnetId"44µs
And I call "{vpcService}" with "CreateTestResourceInSubnet" using argument "{TestSubnetId}"29µs
And I refer to "{result.ResourceId}" as "TestResourceId"194µs
And I call "{vpcService}" with "GetResourceExternalIpAssignment" using argument "{TestResourceId}"872µs
And I refer to "{result.HasExternalIp}" as "HasExternalIp"126µs
Then "{HasExternalIp}" is false29µs
When I call "{vpcService}" with "DeleteTestResource" using argument "{TestResourceId}"21µs
Then "{result.Deleted}" is true26µ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"31µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"121µs
And I refer to "{result}" as "vpcService"20µs
And I load environment variable "CN03_RECEIVER_VPC_ID" as "ReceiverVpcId"25µs
And I load environment variable "CN03_NON_ALLOWLISTED_REQUESTER_VPC_ID" as "NonAllowlistedRequesterVpcId"28µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"26µs
And "{ReceiverVpcId}" is not nil23µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"172ms
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"84µs
Then "{result.ListDefined}" is true28µs
And "{result.TestedCount}" should be greater than "0"37µs
And "{result.AllCorrect}" is true27µs
And "{result.ViolationCount}" is "0"32µ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: e6fba93a-9529-4641-b0d2-fe321e2b5322, 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: 7MYKlHO5uUieyUXsklJ7bUIL9ZApGbEUnwlUSq5Cc4aUAIjWxs696Mr1hg2XV9q3VQsr8QUVhGKsxOxouq3ZupcBActoX6Z9P_6cWA7CJ1it1pE9v-76YyNBJ4D0hp794zcQBS7hP73PZIcqX9N5mjS12KVOtDgZkC7LJS3fC4xPd2-pTKHG0s6wPYvW6fxPBj7PvNzlrGuZrUGTIayWM0lKbGIsa836ZN364UXsV2ncTfZBFkaBPobaqrBOithNFrnf-Z1w2SEfXLqjmObHOnnwInrvxbgXCK5iKyrih9Jp9TU3X_stn2DGNw6s9WLfNKXypgq_yfVITiRRXmM1iGMolBEyj6AAMJz3MT_NmC4MWwz-2GSK88_CI5Uha0g_bkjcd_49QttpB3nVGIDLjNXHybVq1UpBCk1YxP-L4hjZigpenykFgyQNoqw3BuatLVwlwLm_R4gmaiscuWlm8jRyun0o_eYs62-E9oy3euO58iybbkeYkmdhgKF9XK3wwbalApXwhhrz2u6lXmVCFXwrN0i5ubscJ7zvtSc_O0V2W6_-uUiJYqXywi1jLtaKW0rHsjgmOsZ09KjyMOOZAR9K-AZp4aRMIJVT48iSUNG9MowmAOrzFSglI4b3AiRYGHAzhQE_cOS81LPoMamH2EIjbCaJ2MPiNPaXofJErIcuGP8sF6DHJFuWUckbdYKbljY8fSpklqiYNwoJhx0P88m5YL3riXVoBybvvJQkUvNOw46ZTGzrAm5nKPIL5I0hxtTmTaVAeoAgjmULSSLV2q17; 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: e6fba93a-9529-4641-b0d2-fe321e2b5322, 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: 7MYKlHO5uUieyUXsklJ7bUIL9ZApGbEUnwlUSq5Cc4aUAIjWxs696Mr1hg2XV9q3VQsr8QUVhGKsxOxouq3ZupcBActoX6Z9P_6cWA7CJ1it1pE9v-76YyNBJ4D0hp794zcQBS7hP73PZIcqX9N5mjS12KVOtDgZkC7LJS3fC4xPd2-pTKHG0s6wPYvW6fxPBj7PvNzlrGuZrUGTIayWM0lKbGIsa836ZN364UXsV2ncTfZBFkaBPobaqrBOithNFrnf-Z1w2SEfXLqjmObHOnnwInrvxbgXCK5iKyrih9Jp9TU3X_stn2DGNw6s9WLfNKXypgq_yfVITiRRXmM1iGMolBEyj6AAMJz3MT_NmC4MWwz-2GSK88_CI5Uha0g_bkjcd_49QttpB3nVGIDLjNXHybVq1UpBCk1YxP-L4hjZigpenykFgyQNoqw3BuatLVwlwLm_R4gmaiscuWlm8jRyun0o_eYs62-E9oy3euO58iybbkeYkmdhgKF9XK3wwbalApXwhhrz2u6lXmVCFXwrN0i5ubscJ7zvtSc_O0V2W6_-uUiJYqXywi1jLtaKW0rHsjgmOsZ09KjyMOOZAR9K-AZp4aRMIJVT48iSUNG9MowmAOrzFSglI4b3AiRYGHAzhQE_cOS81LPoMamH2EIjbCaJ2MPiNPaXofJErIcuGP8sF6DHJFuWUckbdYKbljY8fSpklqiYNwoJhx0P88m5YL3riXVoBybvvJQkUvNOw46ZTGzrAm5nKPIL5I0hxtTmTaVAeoAgjmULSSLV2q17"},{"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: 413c0a87-1954-460a-a85f-9a2da2ddf805, 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: 8-ZOc6-Vj0RFheMNTHMS7lZ3BRLP_64khtdmEeP9FSbwgYi9_x2qcIIVLdMHJl_aBG4vemxVnSVrhxoCkBVJTt6PN1yzugCxumNi1Erc3aBPlZvtDpNJ32o8Q3z5yb4Cn6e_LjDoopYpMh3VMwImPIcogv2CaDtryY3k6sYtHLap5pLazO_97pC3DdOvOpCMhzr1DDyPMybdm5NEwkKQ3ir1neQHla7KvK2H6nOYKpVdTFb2Z84RQGhUfN-LVTwjHRLR7K6yZ74AlfNvH9Ul1PVbW7_fxrgQK0JYwZH-9VOzj5CzH4Kuk0SC3h8A2txqk1-jsYlPOn8KE8FJGxrNNC0YGf0Arhfh4-uQTMcYMfypOMKf2ByyHsVe7PyUtEWnoyCH78pDXFtSkNv-3YfstIa9jRE7_jPn5TxumOzU0HmHB4UzXc2o5-lGae0PLi-HXzdDGelIJFQGUQd-sFROm-0g6QfWo3ftC6_g7RWkxXIKiIPidFUOrU1y5YXuFz-3srDk7cLUKgKZqTPSGb-YHLcOjLxazhXeEBvsobc-txrfRaTyCt8Gm5FFF2qU0D4k3OGxPiy6aUAzVvJTVccA6qzeJFdMeJcovPXdj7YzNVijn1jqZg6CV0jTlT-DBaSoGhlds3KjlrsuE1UasiC8gBFs9pJ-UrUMpNY85Xj2W9ZbBvvjdkJSvN6XvVaCHYZ1V0GOr1ANjewXYlDNm4myzuicjPO8Bonq8wzxk5mH7KJPIY5JYHlc7Xy3kORgptw892lUjWk3shCevxZR7SdJ9k93; 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: 413c0a87-1954-460a-a85f-9a2da2ddf805, 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: 8-ZOc6-Vj0RFheMNTHMS7lZ3BRLP_64khtdmEeP9FSbwgYi9_x2qcIIVLdMHJl_aBG4vemxVnSVrhxoCkBVJTt6PN1yzugCxumNi1Erc3aBPlZvtDpNJ32o8Q3z5yb4Cn6e_LjDoopYpMh3VMwImPIcogv2CaDtryY3k6sYtHLap5pLazO_97pC3DdOvOpCMhzr1DDyPMybdm5NEwkKQ3ir1neQHla7KvK2H6nOYKpVdTFb2Z84RQGhUfN-LVTwjHRLR7K6yZ74AlfNvH9Ul1PVbW7_fxrgQK0JYwZH-9VOzj5CzH4Kuk0SC3h8A2txqk1-jsYlPOn8KE8FJGxrNNC0YGf0Arhfh4-uQTMcYMfypOMKf2ByyHsVe7PyUtEWnoyCH78pDXFtSkNv-3YfstIa9jRE7_jPn5TxumOzU0HmHB4UzXc2o5-lGae0PLi-HXzdDGelIJFQGUQd-sFROm-0g6QfWo3ftC6_g7RWkxXIKiIPidFUOrU1y5YXuFz-3srDk7cLUKgKZqTPSGb-YHLcOjLxazhXeEBvsobc-txrfRaTyCt8Gm5FFF2qU0D4k3OGxPiy6aUAzVvJTVccA6qzeJFdMeJcovPXdj7YzNVijn1jqZg6CV0jTlT-DBaSoGhlds3KjlrsuE1UasiC8gBFs9pJ-UrUMpNY85Xj2W9ZbBvvjdkJSvN6XvVaCHYZ1V0GOr1ANjewXYlDNm4myzuicjPO8Bonq8wzxk5mH7KJPIY5JYHlc7Xy3kORgptw892lUjWk3shCevxZR7SdJ9k93"}]
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"40µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"143µs
And I refer to "{result}" as "vpcService"21µs
And I load environment variable "CN03_RECEIVER_VPC_ID" as "ReceiverVpcId"20µs
And I load environment variable "CN03_NON_ALLOWLISTED_REQUESTER_VPC_ID" as "NonAllowlistedRequesterVpcId"20µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"17µs
And "{ReceiverVpcId}" is not nil18µs
Given "{NonAllowlistedRequesterVpcId}" is not nil18µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"90µs
Then "{result.AllowedListDefined}" is true21µs
And "{result.Allowed}" is false37µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"72ms
Then "{result.DryRunAllowed}" is false34µs
And "{result.AllowListDefined}" is true21µs
And "{result.RequesterInAllowList}" is false19µs
And "{result.GuardrailExpectation}" is "deny"21µs
And "{result.GuardrailMismatch}" is false19µs
And "{result.ExitCode}" should be greater than "0"24µs
And "{result.Reason}" contains "guardrail aligned"22µs
And "{result.ConflictType}" is ""19µ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"37µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"129µs
And I refer to "{result}" as "vpcService"14µs
Given I refer to "{UID}" as "TargetVpcId"14µs
When I call "{vpcService}" with "EvaluateVpcFlowLogsControl" using argument "{TargetVpcId}"62ms
Then "{result.FlowLogCount}" should be greater than "0"52µ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"31µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"144µs
And I refer to "{result}" as "vpcService"20µs
Given I refer to "{UID}" as "TargetVpcId"15µs
When I call "{vpcService}" with "PrepareFlowLogDeliveryObservation" using argument "{TargetVpcId}"62ms
And I call "{vpcService}" with "GenerateTestTraffic" using argument "{TargetVpcId}"45ms
And I refer to "{result.ResourceId}" as "TestResourceId"42µs
And I refer to "{result.CleanupDeleted}" as "TrafficCleanupDeleted"21µs
And I call "{vpcService}" with "ObserveRecentFlowLogDelivery" using argument "{TargetVpcId}"38ms
And I refer to "{result.RecordsObserved}" as "RecordsObserved"43µs
And I call "{vpcService}" with "DeleteTestResource" using argument "{TestResourceId}"42µs
Then "{result.Deleted}" is true244µs
expected {result.Deleted} to be truthy, got (type: )
And "{TrafficCleanupDeleted}" is true192µs
And "{RecordsObserved}" is true16µs