🥒 CCC.VPC Test: cfi-1775706869-vpc-cn03-disallowed-requester-02

Test Parameters

ServiceTypevpc
ProviderServiceTypeec2:vpc
CatalogTypesCCC.VPC
TagFilter@MAIN, @CCC.VPC
UIDvpc-0d617b955f0a44661
ResourceNamecfi-1775706869-vpc-cn03-disallowed-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-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:20

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"35µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"156µs
And I refer to "{result}" as "vpcService"21µs
When I call "{vpcService}" with "CountDefaultVpcs"369ms
Then "{result}" is "0"31µ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"44µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"150µs
And I refer to "{result}" as "vpcService"23µs
Given I refer to "{UID}" as "TargetVpcId"15µs
When I call "{vpcService}" with "EvaluatePublicSubnetDefaultIPControl" using argument "{TargetVpcId}"397ms
Then "{result.ViolatingSubnetCount}" is "0"43µ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"47µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"455µs
And I refer to "{result}" as "vpcService"52µs
Given I refer to "{UID}" as "TargetVpcId"47µs
When I call "{vpcService}" with "SelectPublicSubnetForTest" using argument "{TargetVpcId}"328ms
And I refer to "{result.SubnetId}" as "TestSubnetId"48µs
And I call "{vpcService}" with "CreateTestResourceInSubnet" using argument "{TestSubnetId}"34µs
And I refer to "{result.ResourceId}" as "TestResourceId"23µs
And I call "{vpcService}" with "GetResourceExternalIpAssignment" using argument "{TestResourceId}"22µs
And I refer to "{result.HasExternalIp}" as "HasExternalIp"18µs
Then "{HasExternalIp}" is false16µs
When I call "{vpcService}" with "DeleteTestResource" using argument "{TestResourceId}"26µs
Then "{result.Deleted}" is true20µ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"43µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"138µs
And I refer to "{result}" as "vpcService"25µ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"18µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"17µs
And "{ReceiverVpcId}" is not nil15µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"506ms
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"111µs
Then "{result.ListDefined}" is true41µs
And "{result.TestedCount}" should be greater than "0"37µs
And "{result.AllCorrect}" is true25µ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 (6449 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: 9e02abec-e1d1-4a55-88a2-011e20e2b133, 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: LMNbyrCUIsKsQ_kcQ5NjiopiNWgmPpGxBk8TBq6XZCai8OHBUG3WUkxySUk6Sq58exyBqAodkybumLICl5vXZHXdno-d5U91H-xwdEnfBDT5N9AZiEfi4EoryQOxvFEMjpMRYNZSnUGHSPvb4aC9qlMvso2dEzBSh8QL4jF_bu10bXF6rF5uMbtZf4ZuKOWdZcZraKpqN7s3FGHOm0QzYak2THbJIuebbtcRcaB-L819J4DFMxFJCPfISVrpKJhd_t-OfK8g5AMlXP9o0oX2BHRihPLkdnVJ5B25cW2_M4WKJSi33Eo5Uk90m9t0kxKXjqlgcxyEu0s0TT2xB4JGyBFZ5ppqrxp4jjNcMkJmTMXSoPlHnQvaw407nL45mZw51hQQ1rzRktwDh61KnCUKiQfIo4v6qJpqp94CYNxLnHEQT4cI5udqTJ-8uK51f9m8g1dotTMvki0qR3sxc260zJfdx4zbrDsp5hODsnpYK1m4xvW0s8AFGl_fHlZI7jVVcaPuBZFPKvyZvPOgfFTw_cOpXCyWzth6RrLmLL5e6sgI6CcQzt0_Xksew45TEdccNuwqKecCZpj0DFwjXpYXqWbSSlPtX4gnJKfAzVRI2V3Z813CdBHqVInEe3Sf80UuFXn_N4NENtpJoYlfXXhn9JgX-NpzsqI8DNslScKE1MbtQBmFqa8V9D-RgeIRzDy-6fxSbhP6bbmdUL8rP6Ya_E6eZublvqIo1gF0M6MmuBoTow4rWB9--gAqGSlVuIkloxHaP210qMKD1IMs2zWtGTkp-g; 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: 9e02abec-e1d1-4a55-88a2-011e20e2b133, 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: LMNbyrCUIsKsQ_kcQ5NjiopiNWgmPpGxBk8TBq6XZCai8OHBUG3WUkxySUk6Sq58exyBqAodkybumLICl5vXZHXdno-d5U91H-xwdEnfBDT5N9AZiEfi4EoryQOxvFEMjpMRYNZSnUGHSPvb4aC9qlMvso2dEzBSh8QL4jF_bu10bXF6rF5uMbtZf4ZuKOWdZcZraKpqN7s3FGHOm0QzYak2THbJIuebbtcRcaB-L819J4DFMxFJCPfISVrpKJhd_t-OfK8g5AMlXP9o0oX2BHRihPLkdnVJ5B25cW2_M4WKJSi33Eo5Uk90m9t0kxKXjqlgcxyEu0s0TT2xB4JGyBFZ5ppqrxp4jjNcMkJmTMXSoPlHnQvaw407nL45mZw51hQQ1rzRktwDh61KnCUKiQfIo4v6qJpqp94CYNxLnHEQT4cI5udqTJ-8uK51f9m8g1dotTMvki0qR3sxc260zJfdx4zbrDsp5hODsnpYK1m4xvW0s8AFGl_fHlZI7jVVcaPuBZFPKvyZvPOgfFTw_cOpXCyWzth6RrLmLL5e6sgI6CcQzt0_Xksew45TEdccNuwqKecCZpj0DFwjXpYXqWbSSlPtX4gnJKfAzVRI2V3Z813CdBHqVInEe3Sf80UuFXn_N4NENtpJoYlfXXhn9JgX-NpzsqI8DNslScKE1MbtQBmFqa8V9D-RgeIRzDy-6fxSbhP6bbmdUL8rP6Ya_E6eZublvqIo1gF0M6MmuBoTow4rWB9--gAqGSlVuIkloxHaP210qMKD1IMs2zWtGTkp-g"},{"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: e25d9c3a-2c84-4acc-b7eb-77cc1ea60fb4, 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: HJ7_abETt3ClVFjS7op6da6kyHWKMIrmtikx06-4X0RI8zjmL6j4GdNLZlEHp_zcE-rEiEQmbloK16HifHffD6dB5kfv9CB5trL9DaVYj2uX34vhvCbr20PBmddeEAY4GiQKm4UWSVYXAul4dwQY8z0HiY52n2BSAbIoz32boRdfkx3cVYNZrCd_8wQPz7g-X03pv5gau0As2pbnjK5sZaCrKcGo_vAYxaANi8owIednNTdOeVB0wk0wpLnDBGYF2MUUhRjrZ0mW_PrFpPakZGVge6b5O7ekQlzaL_cDon8a9INH8z7WM-lLeYKR8WiFBsQd7nWLq6B8a5JDRKiBLRiIzLrx-B1Oo6XN2IRvLqTZ8uMsyYJ3KEvWKog_enmI3_8h1A6JPfZOZhGjInlgjUC6hKlDymqeMtxrdIPv0i5XXxQ2V7hVvBHOLhXcD-vecNaMOmCRAHmTvMd-r1gzO3p9MfIr2H01a51xG2Uwc21DhHqss426N1nqeE_x-Y7kclRLuMuLRApGx9cysDP_h04_OC2_xrxTpuWQgw-oetc16A4JYfgUZyhgYAWRzNGBb54sBG4hvg9ZRa_fGqZYFmJ_rtfLUdIKJyqAIw1CgyP4oPTbbYpkqarTMoeXjJoTmGCl8M1KGc1_mYy5yQSXzAIJBfg0g_cxUcoKnkH8POjGbL3HEDFNrBX3QokRdWhrELg-uoz7mkjZWCEb_MikOh0ijjHxXvO1fiIf_FYN9RDZ49ual1hY8KldqO8bJVAXrmIEBfpDB3WRUF4EN8TPabDVTKc; 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: e25d9c3a-2c84-4acc-b7eb-77cc1ea60fb4, 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: HJ7_abETt3ClVFjS7op6da6kyHWKMIrmtikx06-4X0RI8zjmL6j4GdNLZlEHp_zcE-rEiEQmbloK16HifHffD6dB5kfv9CB5trL9DaVYj2uX34vhvCbr20PBmddeEAY4GiQKm4UWSVYXAul4dwQY8z0HiY52n2BSAbIoz32boRdfkx3cVYNZrCd_8wQPz7g-X03pv5gau0As2pbnjK5sZaCrKcGo_vAYxaANi8owIednNTdOeVB0wk0wpLnDBGYF2MUUhRjrZ0mW_PrFpPakZGVge6b5O7ekQlzaL_cDon8a9INH8z7WM-lLeYKR8WiFBsQd7nWLq6B8a5JDRKiBLRiIzLrx-B1Oo6XN2IRvLqTZ8uMsyYJ3KEvWKog_enmI3_8h1A6JPfZOZhGjInlgjUC6hKlDymqeMtxrdIPv0i5XXxQ2V7hVvBHOLhXcD-vecNaMOmCRAHmTvMd-r1gzO3p9MfIr2H01a51xG2Uwc21DhHqss426N1nqeE_x-Y7kclRLuMuLRApGx9cysDP_h04_OC2_xrxTpuWQgw-oetc16A4JYfgUZyhgYAWRzNGBb54sBG4hvg9ZRa_fGqZYFmJ_rtfLUdIKJyqAIw1CgyP4oPTbbYpkqarTMoeXjJoTmGCl8M1KGc1_mYy5yQSXzAIJBfg0g_cxUcoKnkH8POjGbL3HEDFNrBX3QokRdWhrELg-uoz7mkjZWCEb_MikOh0ijjHxXvO1fiIf_FYN9RDZ49ual1hY8KldqO8bJVAXrmIEBfpDB3WRUF4EN8TPabDVTKc"}]
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"45µ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"16µ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"16µs
And "{ReceiverVpcId}" is not nil17µs
Given "{NonAllowlistedRequesterVpcId}" is not nil17µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"87µs
Then "{result.AllowedListDefined}" is true21µs
And "{result.Allowed}" is false17µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"441ms
Then "{result.DryRunAllowed}" is false33µs
And "{result.AllowListDefined}" is true40µs
And "{result.RequesterInAllowList}" is false22µs
And "{result.GuardrailExpectation}" is "deny"22µs
And "{result.GuardrailMismatch}" is false30µs
And "{result.ExitCode}" should be greater than "0"26µs
And "{result.Reason}" contains "guardrail aligned"24µs
And "{result.ConflictType}" is ""34µ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"46µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"131µs
And I refer to "{result}" as "vpcService"24µs
Given I refer to "{UID}" as "TargetVpcId"14µs
When I call "{vpcService}" with "EvaluateVpcFlowLogsControl" using argument "{TargetVpcId}"338ms
Then "{result.FlowLogCount}" should be greater than "0"79µs
expected {result.FlowLogCount} (0) to be greater than 0
And "{result.NonCompliantCount}" is "0"56µ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"49µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"159µs
And I refer to "{result}" as "vpcService"18µs
Given I refer to "{UID}" as "TargetVpcId"14µs
When I call "{vpcService}" with "PrepareFlowLogDeliveryObservation" using argument "{TargetVpcId}"316ms
And I call "{vpcService}" with "GenerateTestTraffic" using argument "{TargetVpcId}"117ms
And I refer to "{result.ResourceId}" as "TestResourceId"50µs
And I refer to "{result.CleanupDeleted}" as "TrafficCleanupDeleted"24µs
And I call "{vpcService}" with "ObserveRecentFlowLogDelivery" using argument "{TargetVpcId}"104ms
And I refer to "{result.RecordsObserved}" as "RecordsObserved"39µs
And I call "{vpcService}" with "DeleteTestResource" using argument "{TestResourceId}"38µs
Then "{result.Deleted}" is true25µs
expected {result.Deleted} to be truthy, got (type: )
And "{TrafficCleanupDeleted}" is true16µs
And "{RecordsObserved}" is true16µs