🥒 CCC.VPC Test: cfi-1775557775-vpc-cn03-disallowed-requester-01

Test Parameters

ServiceTypevpc
ProviderServiceTypeec2:vpc
CatalogTypesCCC.VPC
TagFilter@MAIN, @CCC.VPC
UIDvpc-03e0763d329ec1a53
ResourceNamecfi-1775557775-vpc-cn03-disallowed-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-0b622dcd5eee1a986,vpc-0c697ba86026b9c59"
        ],
        "cn03-disallowed-requester-vpc-ids": [
          "vpc-00ceb92e81affe793,vpc-03e0763d329ec1a53"
        ],
        "cn03-receiver-vpc-id": "vpc-027ef85c88b9d68c2"
      }
    }
  ],
  "Rules": {
    "permitted-account-ids": "",
    "permitted-regions": [
      "us-east-1"
    ]
  }
}
AwsCloudTrailLogGroupNamecfi-test-log-group
Cn03AllowedRequesterVpcIds
[
  "vpc-0b622dcd5eee1a986,vpc-0c697ba86026b9c59"
]
Cn03DisallowedRequesterVpcIds
[
  "vpc-00ceb92e81affe793,vpc-03e0763d329ec1a53"
]
Cn03ReceiverVpcIdvpc-027ef85c88b9d68c2
ObjectStorageRetentionPeriodDays2
PermittedRegions
[
  "us-east-1"
]
Provideraws
Regionus-east-1

Summary

Generated: 2026-04-07 10:40:05

Total Run Time: 3s

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"30µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"115µs
And I refer to "{result}" as "vpcService"20µs
When I call "{vpcService}" with "CountDefaultVpcs"398ms
Then "{result}" is "0"26µ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"86µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"169µs
And I refer to "{result}" as "vpcService"66µs
Given I refer to "{UID}" as "TargetVpcId"29µs
When I call "{vpcService}" with "EvaluatePublicSubnetDefaultIPControl" using argument "{TargetVpcId}"401ms
Then "{result.ViolatingSubnetCount}" is "0"50µs
And "{result.Reason}" contains "disable default public IP"55µ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"141µs
And I refer to "{result}" as "vpcService"27µs
Given I refer to "{UID}" as "TargetVpcId"24µs
When I call "{vpcService}" with "SelectPublicSubnetForTest" using argument "{TargetVpcId}"359ms
And I refer to "{result.SubnetId}" as "TestSubnetId"48µs
And I call "{vpcService}" with "CreateTestResourceInSubnet" using argument "{TestSubnetId}"36µs
And I refer to "{result.ResourceId}" as "TestResourceId"25µs
And I call "{vpcService}" with "GetResourceExternalIpAssignment" using argument "{TestResourceId}"27µs
And I refer to "{result.HasExternalIp}" as "HasExternalIp"22µs
Then "{HasExternalIp}" is false25µs
When I call "{vpcService}" with "DeleteTestResource" using argument "{TestResourceId}"25µs
Then "{result.Deleted}" is true27µ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"41µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"130µs
And I refer to "{result}" as "vpcService"16µs
And I load environment variable "CN03_RECEIVER_VPC_ID" as "ReceiverVpcId"18µs
And I load environment variable "CN03_NON_ALLOWLISTED_REQUESTER_VPC_ID" as "NonAllowlistedRequesterVpcId"32µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"18µs
And "{ReceiverVpcId}" is not nil16µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"559ms
And I attach "{result.Summary}" to the test output as "Disallow-list Enforcement Summary"56µs
And I attach "{result.Results}" to the test output as "Disallow-list Enforcement"103µs
Then "{result.ListDefined}" is true38µs
And "{result.TestedCount}" should be greater than "0"49µs
And "{result.AllCorrect}" is true38µs
And "{result.ViolationCount}" is "0"44µ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 (6443 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: 82765956-0013-475f-8f75-36316dd15878, 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: JC_PRrwYINGSmt4WQOE6U4wFA3LD0lzwQK_U6-QpQe6jCBziuuAQMmn59nzMIQZJ9qYX7jjKupY9Qp0XklW3QtRG2i0kEwttw2EHF04-T-BCSLC0lQtFyz8XnFinkCcRoDsUhRKxQBHGSNrK67twgWoppPY2yHYz6uZz4IpV759uZ5IdSSi-UN7Z4TYkCrtyjEyN-N8APZD6JhCrNDYLfyPRN7SwVCuoNbYqrlgcTNHmHfdwPQ2SbtTKe5iznOs72tzik9tPzapF8DOQ1KAVzIy2dJFM5VHNLiP6IORq2Wq9-ZYl8rofe_bUwHs3-wR2ipHopMNMiJpwN3PFBK1hJnhOielM3dm3pFm7BXUi03CUcJUafOlIH9T90YX2RffS_pNSjVFmx9eHUaJWkEAEdOWygGN0n1A4gNZzs9TKkeW815hTNeYH57cROypPYdofftQWAx4BifzmrSZYCE0qYublaxlSc_guHQ-VisisqZ30Gc2R6ECs2q0ozgnlY4ffREW_vFQFh6RyEPMhl-uFQ7z-Zae1AQR-7SOpnokLsZDqS_qRaUbzq94r1UfsqgELLia-mM1PkAxG9-Kj9CVfOggUEc7cdJR-aRcLAIfxbolAZa0x0jHHYDoimajUz_3lsKIQYj1wGMXFTZZJnWj-d5gZO4BF1m8AxiSM0jEhVx99CJO-qPGTqiNaSNAXHkpQavXNBE_RNRMw4pNvyR7Cu7jaHRo-cg0k3bl8VTXssfJwdvhD8YeVkfTatCwVCmKeyigy1qJW9OCyQTfnHP8C6uhUFQ; 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: 82765956-0013-475f-8f75-36316dd15878, 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: JC_PRrwYINGSmt4WQOE6U4wFA3LD0lzwQK_U6-QpQe6jCBziuuAQMmn59nzMIQZJ9qYX7jjKupY9Qp0XklW3QtRG2i0kEwttw2EHF04-T-BCSLC0lQtFyz8XnFinkCcRoDsUhRKxQBHGSNrK67twgWoppPY2yHYz6uZz4IpV759uZ5IdSSi-UN7Z4TYkCrtyjEyN-N8APZD6JhCrNDYLfyPRN7SwVCuoNbYqrlgcTNHmHfdwPQ2SbtTKe5iznOs72tzik9tPzapF8DOQ1KAVzIy2dJFM5VHNLiP6IORq2Wq9-ZYl8rofe_bUwHs3-wR2ipHopMNMiJpwN3PFBK1hJnhOielM3dm3pFm7BXUi03CUcJUafOlIH9T90YX2RffS_pNSjVFmx9eHUaJWkEAEdOWygGN0n1A4gNZzs9TKkeW815hTNeYH57cROypPYdofftQWAx4BifzmrSZYCE0qYublaxlSc_guHQ-VisisqZ30Gc2R6ECs2q0ozgnlY4ffREW_vFQFh6RyEPMhl-uFQ7z-Zae1AQR-7SOpnokLsZDqS_qRaUbzq94r1UfsqgELLia-mM1PkAxG9-Kj9CVfOggUEc7cdJR-aRcLAIfxbolAZa0x0jHHYDoimajUz_3lsKIQYj1wGMXFTZZJnWj-d5gZO4BF1m8AxiSM0jEhVx99CJO-qPGTqiNaSNAXHkpQavXNBE_RNRMw4pNvyR7Cu7jaHRo-cg0k3bl8VTXssfJwdvhD8YeVkfTatCwVCmKeyigy1qJW9OCyQTfnHP8C6uhUFQ"},{"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: b1e0efd6-93e8-4ddd-85d6-fb553923a10e, 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: 8PTx5-XOPeaXdt210ED3L-qdYUWCO0VVMZK0jvgv8nKUMJa4fctUR7AGrL6GUPRltGKek-lGEL9YpiRTT0InQVsmfGzd9YyPRaSu8bBPszw6GXMmp9EyBQGMRZ_TboUKcc16ME2ntMONuJ0alLqEPMu59Fge1qKCGrRRTicvroGVucffY6xjGp358Ee1FV-HpGyq-VKhOmhawZM1oxhU1C5V2HiA0_Afkho16FyC9NeEnMhuezLHE2gp4fTWSR2SrHS4a46FqbwKBIYFPyUOioeBT226U7uBgITBTN2k0sq63DyYiZRjmQxNusIy7ZE31z7zWjLFrtuirtqdhYg_OfW7Z9hhdpEu2H9PjMbMzvQS0upwddLMxhAHJoFB9FY_PYVj0jd2rQYI8hya9EI5HKESFXkFvUVUY7DH4PEihMqw_0C4lvt6GgcEzTHVnC3Lx2dVtc6rKGUuVeMY0yc0X8oQQHkeUzrVgE0_D55ePi62R6e7BYIX74L5uIq2uoKZqZygn7kOac-dh9fUGHRBW8c-izMZXuqj_8HK6SlSppsIPEi4j2ZWC-ri1LVZLMlQ9awUMP5RD8eDn-SlsPtA70ZPd1X6mCPACpNYETAI3V0SeT9mlvr9zyxNUf6VHgvEorScOVpCLoXO7RcP6GJ3E9mZbImzi0HkyJVHLU7BbTvb7p6mXsz-6apyU2K0A9SSHS8KzVxjYomVaJB3QwZ1QulA5k0innl4V8bUHAeMaVozREQNSY5o5gkw56STB2a_TQ6RTOqXOXWGSbY_6cJd3Az6; 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: b1e0efd6-93e8-4ddd-85d6-fb553923a10e, 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: 8PTx5-XOPeaXdt210ED3L-qdYUWCO0VVMZK0jvgv8nKUMJa4fctUR7AGrL6GUPRltGKek-lGEL9YpiRTT0InQVsmfGzd9YyPRaSu8bBPszw6GXMmp9EyBQGMRZ_TboUKcc16ME2ntMONuJ0alLqEPMu59Fge1qKCGrRRTicvroGVucffY6xjGp358Ee1FV-HpGyq-VKhOmhawZM1oxhU1C5V2HiA0_Afkho16FyC9NeEnMhuezLHE2gp4fTWSR2SrHS4a46FqbwKBIYFPyUOioeBT226U7uBgITBTN2k0sq63DyYiZRjmQxNusIy7ZE31z7zWjLFrtuirtqdhYg_OfW7Z9hhdpEu2H9PjMbMzvQS0upwddLMxhAHJoFB9FY_PYVj0jd2rQYI8hya9EI5HKESFXkFvUVUY7DH4PEihMqw_0C4lvt6GgcEzTHVnC3Lx2dVtc6rKGUuVeMY0yc0X8oQQHkeUzrVgE0_D55ePi62R6e7BYIX74L5uIq2uoKZqZygn7kOac-dh9fUGHRBW8c-izMZXuqj_8HK6SlSppsIPEi4j2ZWC-ri1LVZLMlQ9awUMP5RD8eDn-SlsPtA70ZPd1X6mCPACpNYETAI3V0SeT9mlvr9zyxNUf6VHgvEorScOVpCLoXO7RcP6GJ3E9mZbImzi0HkyJVHLU7BbTvb7p6mXsz-6apyU2K0A9SSHS8KzVxjYomVaJB3QwZ1QulA5k0innl4V8bUHAeMaVozREQNSY5o5gkw56STB2a_TQ6RTOqXOXWGSbY_6cJd3Az6"}]
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"29µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"132µs
And I refer to "{result}" as "vpcService"24µ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"21µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"17µs
And "{ReceiverVpcId}" is not nil15µs
Given "{NonAllowlistedRequesterVpcId}" is not nil17µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"87µs
Then "{result.AllowedListDefined}" is true22µs
And "{result.Allowed}" is false19µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"367ms
Then "{result.DryRunAllowed}" is false45µs
And "{result.AllowListDefined}" is true33µs
And "{result.RequesterInAllowList}" is false29µs
And "{result.GuardrailExpectation}" is "deny"31µs
And "{result.GuardrailMismatch}" is false28µs
And "{result.ExitCode}" should be greater than "0"32µs
And "{result.Reason}" contains "guardrail aligned"31µs
And "{result.ConflictType}" is ""28µ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 @CCC.VPC @DEFAULT @CCC.VPC
Given a cloud api for "{Instance}" in "api"43µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"328µs
And I refer to "{result}" as "vpcService"40µs
Given I refer to "{UID}" as "TargetVpcId"1ms
When I call "{vpcService}" with "EvaluateVpcFlowLogsControl" using argument "{TargetVpcId}"317ms
Then "{result.FlowLogCount}" should be greater than "0"57µs
expected {result.FlowLogCount} (0) to be greater than 0
And "{result.NonCompliantCount}" is "0"24µ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"44µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"153µs
And I refer to "{result}" as "vpcService"18µs
Given I refer to "{UID}" as "TargetVpcId"17µs
When I call "{vpcService}" with "PrepareFlowLogDeliveryObservation" using argument "{TargetVpcId}"320ms
And I call "{vpcService}" with "GenerateTestTraffic" using argument "{TargetVpcId}"130ms
And I refer to "{result.ResourceId}" as "TestResourceId"46µs
And I refer to "{result.CleanupDeleted}" as "TrafficCleanupDeleted"26µs
And I call "{vpcService}" with "ObserveRecentFlowLogDelivery" using argument "{TargetVpcId}"104ms
And I refer to "{result.RecordsObserved}" as "RecordsObserved"74µs
And I call "{vpcService}" with "DeleteTestResource" using argument "{TestResourceId}"56µs
Then "{result.Deleted}" is true33µs
expected {result.Deleted} to be truthy, got (type: )
And "{TrafficCleanupDeleted}" is true23µs
And "{RecordsObserved}" is true35µs