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

Test Parameters

ServiceTypevpc
ProviderServiceTypeec2:vpc
CatalogTypesCCC.VPC
TagFilter@MAIN, @CCC.VPC
UIDvpc-0bbce9271c5d23986
ResourceNamecfi-1775706869-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-01f543721b8193a2c,vpc-0bbce9271c5d23986"
        ],
        "cn03-disallowed-requester-vpc-ids": [
          "vpc-02ff4e20289c915b9,vpc-0d617b955f0a44661"
        ],
        "cn03-receiver-vpc-id": "vpc-071bf2e1e2416f266"
      }
    }
  ],
  "Rules": {
    "permitted-account-ids": "",
    "permitted-regions": [
      "us-east-1"
    ]
  }
}
AwsCloudTrailLogGroupNamecfi-test-log-group
Cn03AllowedRequesterVpcIds
[
  "vpc-01f543721b8193a2c,vpc-0bbce9271c5d23986"
]
Cn03DisallowedRequesterVpcIds
[
  "vpc-02ff4e20289c915b9,vpc-0d617b955f0a44661"
]
Cn03ReceiverVpcIdvpc-071bf2e1e2416f266
ObjectStorageRetentionPeriodDays2
PermittedRegions
[
  "us-east-1"
]
Provideraws
Regionus-east-1

Summary

Generated: 2026-04-09 04:04:17

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"86µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"169µs
And I refer to "{result}" as "vpcService"42µs
When I call "{vpcService}" with "CountDefaultVpcs"396ms
Then "{result}" is "0"27µ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"43µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"138µs
And I refer to "{result}" as "vpcService"15µs
Given I refer to "{UID}" as "TargetVpcId"14µs
When I call "{vpcService}" with "EvaluatePublicSubnetDefaultIPControl" using argument "{TargetVpcId}"378ms
Then "{result.ViolatingSubnetCount}" is "0"62µs
And "{result.Reason}" contains "disable default public IP"47µ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"49µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"185µs
And I refer to "{result}" as "vpcService"18µs
Given I refer to "{UID}" as "TargetVpcId"15µs
When I call "{vpcService}" with "SelectPublicSubnetForTest" using argument "{TargetVpcId}"330ms
And I refer to "{result.SubnetId}" as "TestSubnetId"47µs
And I call "{vpcService}" with "CreateTestResourceInSubnet" using argument "{TestSubnetId}"37µs
And I refer to "{result.ResourceId}" as "TestResourceId"23µs
And I call "{vpcService}" with "GetResourceExternalIpAssignment" using argument "{TestResourceId}"30µs
And I refer to "{result.HasExternalIp}" as "HasExternalIp"21µs
Then "{HasExternalIp}" is false21µs
When I call "{vpcService}" with "DeleteTestResource" using argument "{TestResourceId}"24µs
Then "{result.Deleted}" is true22µ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"128µs
And I refer to "{result}" as "vpcService"15µ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"29µs
And "{ReceiverVpcId}" is not nil20µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"502ms
And I attach "{result.Summary}" to the test output as "Disallow-list Enforcement Summary"64µs
And I attach "{result.Results}" to the test output as "Disallow-list Enforcement"111µs
Then "{result.ListDefined}" is true43µs
And "{result.TestedCount}" should be greater than "0"30µs
And "{result.AllCorrect}" is true20µs
And "{result.ViolationCount}" is "0"38µ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 (6451 bytes)
[{"AllowListDefined":true,"ConflictMessage":"","ConflictType":"","DryRunAllowed":false,"ErrorCode":"UnauthorizedOperation","ExitCode":1,"GuardrailExpectation":"deny","GuardrailMismatch":false,"Origin":"terraform-fixture","PeerOwnerId":"","PeerVpcId":"vpc-071bf2e1e2416f266","Reason":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: ef71c437-4f55-4ad4-a4ef-7d935ae601de, 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: OihlRvadaLmOG5MhV9tSEqYRxNRPo1GPB_w1nuIXu7CfJPVXysR15_19Hf9cs6Apn3yzAEoVNywzlFQVQiomUoBMcKYRLipQDxLl0tMvrOVxQqEWSPnWf1j9EbAgNYw-8LWgDUtEg2dxHdR559Y_hJX20C-ul3ZQcIFDG266KW1vMjmIRQYki4FA1sIsNprPrspDEhojEy3xIDjMIOBmqIy5tGOKaa-x61tvANJvzdJxzUfUlbjX33K0BPyETK_ybKdhCBZZV6PqLWkhyOXXYsiEJkqyhsftqFepUuD3WeY4rKfu504-rjiqHDaFegmRM9nS_bnsNdD55bcySeEbZwtPP9B0pUyPeuJ9ddetIgHbG7zhnrGBTeOn6qBEZDl9WrmerzK7GwPeBWwM5DTaQ7qtTN9Sf6L2kC0rIejfb4MzcJtHZNoH2XRXiIuqgo8iLpK_bI4xQRSIuZdHd6ZgOZ8ikV_Ud70MMJjjrtUOeJyaVwzk2vN015BTSRpJBXcRlzvPFWf7quH7qjiVLYx8zAzDtKoNTs9yvkxgEFwdloVU3Q2jyg4HXP72Yfjnm1DbqxBFc-uvAn6XByLX8xkNwD7UWWHLEfEknkOeBXfJp74RvvaPngarYwZVf99KQIqXMGqqH-1pgykOfJEeozMB4UqFfzg_LjofFDVyb6hfWJVytMteyxEuhBAoNYGunJJTOqlGvtxWQVnNxBleTipnABGdcCHIiAKSQyUZqQbBcQD-R9GE7M8XDrJj8fTYTsj7YlTKZ6OY2DmYi1HOm4u1Qv3E2Q; CN03 guardrail aligned: allow-list expects deny for requester vpc-02ff4e20289c915b9","ReceiverVpcId":"vpc-071bf2e1e2416f266","RequesterInAllowList":false,"RequesterVpcId":"vpc-02ff4e20289c915b9","Stderr":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: ef71c437-4f55-4ad4-a4ef-7d935ae601de, 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: OihlRvadaLmOG5MhV9tSEqYRxNRPo1GPB_w1nuIXu7CfJPVXysR15_19Hf9cs6Apn3yzAEoVNywzlFQVQiomUoBMcKYRLipQDxLl0tMvrOVxQqEWSPnWf1j9EbAgNYw-8LWgDUtEg2dxHdR559Y_hJX20C-ul3ZQcIFDG266KW1vMjmIRQYki4FA1sIsNprPrspDEhojEy3xIDjMIOBmqIy5tGOKaa-x61tvANJvzdJxzUfUlbjX33K0BPyETK_ybKdhCBZZV6PqLWkhyOXXYsiEJkqyhsftqFepUuD3WeY4rKfu504-rjiqHDaFegmRM9nS_bnsNdD55bcySeEbZwtPP9B0pUyPeuJ9ddetIgHbG7zhnrGBTeOn6qBEZDl9WrmerzK7GwPeBWwM5DTaQ7qtTN9Sf6L2kC0rIejfb4MzcJtHZNoH2XRXiIuqgo8iLpK_bI4xQRSIuZdHd6ZgOZ8ikV_Ud70MMJjjrtUOeJyaVwzk2vN015BTSRpJBXcRlzvPFWf7quH7qjiVLYx8zAzDtKoNTs9yvkxgEFwdloVU3Q2jyg4HXP72Yfjnm1DbqxBFc-uvAn6XByLX8xkNwD7UWWHLEfEknkOeBXfJp74RvvaPngarYwZVf99KQIqXMGqqH-1pgykOfJEeozMB4UqFfzg_LjofFDVyb6hfWJVytMteyxEuhBAoNYGunJJTOqlGvtxWQVnNxBleTipnABGdcCHIiAKSQyUZqQbBcQD-R9GE7M8XDrJj8fTYTsj7YlTKZ6OY2DmYi1HOm4u1Qv3E2Q"},{"AllowListDefined":true,"ConflictMessage":"","ConflictType":"","DryRunAllowed":false,"ErrorCode":"UnauthorizedOperation","ExitCode":1,"GuardrailExpectation":"deny","GuardrailMismatch":false,"Origin":"terraform-fixture","PeerOwnerId":"","PeerVpcId":"vpc-071bf2e1e2416f266","Reason":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: d937e892-ce9e-4d37-9816-31f56e62b463, 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: taUGtbm8UFrWHLIH8mavd87aft5puqcZN51P5O0LJSYPct24BvbtW9PyiksjXpCztZok84po3YAQUYQ3tcC1sQPldrI1fYScPHv6iUvyZs417GeFWsuGL7ws77DA6AHrOvo_zsma5NqMahqh5IF1VupTo8WfYcUh8aHb396LcZzqTsr7S0J7Bvl8SovLuuL3FR9EckO6uVtlJjDbSpSdCV_KxppxeXrKa5JfB18_zKzGWYFZZ96pbH20sdcKbuGxyvpRrEYxrjozIPVfYVPv6Ec2YWIUkZSddqU1vi0ug-CRJ_jXb-TTEcZpDBZsYiDO2TWlbv4PRDLW31NYNzuLezQhl_Uj1ilI4hRXU9JF3Kans0FQhLLzteQX_f3HhjHowusGJWRktNXJZGGnXV4-8cLuwOx7DS7ziO09A-x05nn6hPfueBHloQjrCUdNRRBLX4eX9nTJbgNICH0X1dpipfWcMLZJerbE-V3tQ10xK8boOJazvXdv50-iHQsexRVwkc6mPFQDFP9lXnFrmKgznMzN34tH9WRSKse-c2r_fZkav_p0pwg-JUiNzMJ05lIqZw644z6WPTLPbc8PBiIyPb-MwTwDl5NenI5Z_e50OWZ6ZOxKwhgNXpEg_15nYlgjdFqyVCrtNmzbZMUdbA7t1ZeRI1fcNfHE9oKZMkuoo2Lp6YaBbfpIPn0X4BPSLYUkUQLiISX8JA3H88_fgz25uEMlStBsp1NgQhH3lxviefUP014buvsunr1dO4ugFeJjfwUN2xW6_yQiJkNe1E9m7kb-2Dtq; CN03 guardrail aligned: allow-list expects deny for requester vpc-0d617b955f0a44661","ReceiverVpcId":"vpc-071bf2e1e2416f266","RequesterInAllowList":false,"RequesterVpcId":"vpc-0d617b955f0a44661","Stderr":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: d937e892-ce9e-4d37-9816-31f56e62b463, 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: taUGtbm8UFrWHLIH8mavd87aft5puqcZN51P5O0LJSYPct24BvbtW9PyiksjXpCztZok84po3YAQUYQ3tcC1sQPldrI1fYScPHv6iUvyZs417GeFWsuGL7ws77DA6AHrOvo_zsma5NqMahqh5IF1VupTo8WfYcUh8aHb396LcZzqTsr7S0J7Bvl8SovLuuL3FR9EckO6uVtlJjDbSpSdCV_KxppxeXrKa5JfB18_zKzGWYFZZ96pbH20sdcKbuGxyvpRrEYxrjozIPVfYVPv6Ec2YWIUkZSddqU1vi0ug-CRJ_jXb-TTEcZpDBZsYiDO2TWlbv4PRDLW31NYNzuLezQhl_Uj1ilI4hRXU9JF3Kans0FQhLLzteQX_f3HhjHowusGJWRktNXJZGGnXV4-8cLuwOx7DS7ziO09A-x05nn6hPfueBHloQjrCUdNRRBLX4eX9nTJbgNICH0X1dpipfWcMLZJerbE-V3tQ10xK8boOJazvXdv50-iHQsexRVwkc6mPFQDFP9lXnFrmKgznMzN34tH9WRSKse-c2r_fZkav_p0pwg-JUiNzMJ05lIqZw644z6WPTLPbc8PBiIyPb-MwTwDl5NenI5Z_e50OWZ6ZOxKwhgNXpEg_15nYlgjdFqyVCrtNmzbZMUdbA7t1ZeRI1fcNfHE9oKZMkuoo2Lp6YaBbfpIPn0X4BPSLYUkUQLiISX8JA3H88_fgz25uEMlStBsp1NgQhH3lxviefUP014buvsunr1dO4ugFeJjfwUN2xW6_yQiJkNe1E9m7kb-2Dtq"}]
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"48µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"124µs
And I refer to "{result}" as "vpcService"16µ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"20µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"29µs
And "{ReceiverVpcId}" is not nil16µs
Given "{NonAllowlistedRequesterVpcId}" is not nil18µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"121µs
Then "{result.AllowedListDefined}" is true41µs
And "{result.Allowed}" is false22µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"364ms
Then "{result.DryRunAllowed}" is false48µs
And "{result.AllowListDefined}" is true34µs
And "{result.RequesterInAllowList}" is false28µs
And "{result.GuardrailExpectation}" is "deny"47µs
And "{result.GuardrailMismatch}" is false33µs
And "{result.ExitCode}" should be greater than "0"51µs
And "{result.Reason}" contains "guardrail aligned"28µs
And "{result.ConflictType}" is ""21µ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"73µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"159µs
And I refer to "{result}" as "vpcService"42µs
Given I refer to "{UID}" as "TargetVpcId"38µs
When I call "{vpcService}" with "EvaluateVpcFlowLogsControl" using argument "{TargetVpcId}"322ms
Then "{result.FlowLogCount}" should be greater than "0"70µs
expected {result.FlowLogCount} (0) to be greater than 0
And "{result.NonCompliantCount}" is "0"43µ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"46µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"139µs
And I refer to "{result}" as "vpcService"26µs
Given I refer to "{UID}" as "TargetVpcId"24µs
When I call "{vpcService}" with "PrepareFlowLogDeliveryObservation" using argument "{TargetVpcId}"327ms
And I call "{vpcService}" with "GenerateTestTraffic" using argument "{TargetVpcId}"124ms
And I refer to "{result.ResourceId}" as "TestResourceId"50µs
And I refer to "{result.CleanupDeleted}" as "TrafficCleanupDeleted"41µs
And I call "{vpcService}" with "ObserveRecentFlowLogDelivery" using argument "{TargetVpcId}"108ms
And I refer to "{result.RecordsObserved}" as "RecordsObserved"36µs
And I call "{vpcService}" with "DeleteTestResource" using argument "{TestResourceId}"34µs
Then "{result.Deleted}" is true26µs
expected {result.Deleted} to be truthy, got (type: )
And "{TrafficCleanupDeleted}" is true17µs
And "{RecordsObserved}" is true18µs