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

Test Parameters

ServiceTypevpc
ProviderServiceTypeec2:vpc
CatalogTypesCCC.VPC
TagFilter@MAIN, @CCC.VPC
UIDvpc-01f543721b8193a2c
ResourceNamecfi-1775706869-vpc-cn03-allowed-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:03:48

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"36µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"169µs
And I refer to "{result}" as "vpcService"13µs
When I call "{vpcService}" with "CountDefaultVpcs"334ms
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"50µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"139µs
And I refer to "{result}" as "vpcService"24µs
Given I refer to "{UID}" as "TargetVpcId"24µs
When I call "{vpcService}" with "EvaluatePublicSubnetDefaultIPControl" using argument "{TargetVpcId}"432ms
Then "{result.ViolatingSubnetCount}" is "0"43µs
And "{result.Reason}" contains "disable default public IP"31µ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"33µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"146µs
And I refer to "{result}" as "vpcService"25µs
Given I refer to "{UID}" as "TargetVpcId"23µs
When I call "{vpcService}" with "SelectPublicSubnetForTest" using argument "{TargetVpcId}"346ms
And I refer to "{result.SubnetId}" as "TestSubnetId"103µs
And I call "{vpcService}" with "CreateTestResourceInSubnet" using argument "{TestSubnetId}"57µs
And I refer to "{result.ResourceId}" as "TestResourceId"29µs
And I call "{vpcService}" with "GetResourceExternalIpAssignment" using argument "{TestResourceId}"27µs
And I refer to "{result.HasExternalIp}" as "HasExternalIp"46µs
Then "{HasExternalIp}" is false27µs
When I call "{vpcService}" with "DeleteTestResource" using argument "{TestResourceId}"26µs
Then "{result.Deleted}" is true43µ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"125µs
And I refer to "{result}" as "vpcService"25µ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"30µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"16µs
And "{ReceiverVpcId}" is not nil13µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"530ms
And I attach "{result.Summary}" to the test output as "Disallow-list Enforcement Summary"54µs
And I attach "{result.Results}" to the test output as "Disallow-list Enforcement"86µs
Then "{result.ListDefined}" is true43µs
And "{result.TestedCount}" should be greater than "0"53µs
And "{result.AllCorrect}" is true23µs
And "{result.ViolationCount}" is "0"28µ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: 64199e08-eebc-4b7d-b37d-613a8dd93e12, 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: qeaXKOsXT16MALj6BjCNtXfR92h2J6tsKtFwZtpYtvQ0jwPdn9Nbdzt9LQbOe9wmz1NQzFr8ZN3WsO6oZCCxRENaLXNIWcYglf6zom0qcxLPb6ri7VC-HdxTgi7_lPJByYWXhTLcUM_IouIF0Hl8nZQxe-Gh2it3xnzv1HwPDH84ncfAzrej67XzZLLKNdm99Xc9bVK9hN1iddfBTB5wTeL1F6W-4neLUMgFWqc-CHAFfD1hD_0SfJEiCiD_E-YBmcwmBRAG-0_EacLVv4ZNEwzyzaec4Q6veyBwf21TsnmDVQ6bdGV-aFtsD4vjzYrTTe0m-YSht4XvMJOQZmD9KVmrwYY3Nih0jS_yYocNVQtYjgFBJBSpPluGX-rRier_oqxqOu-Z5HWUXbq__PoShoFEUZbz6w69OpwhJVtSkPz5L3e4LwQ5s_L7fJq0enZmrLMvDhVpvBfYydwqI5qpGD6hNeKSspJPvHp6MCn9De9qNK1lSO7qVzgFYmEIuyyHZv7pIccZug2EBix6CuC5amKROeffpp3UZixiJuwoUoCIUNjyQd7ureym-y2Zd0HM-a64tt-9-JWezh8d_WHBmgqWoHlzJDJ-aOM6lzY6vR0mZY-Vptx4UvFYSl_7KiZxdKrGOIaddZfhzyAqZ9d65FAHTIOLGNaoQGsXq0ZXU36AoYEKHsQLWvxr2NcucgJ3r7xJ5wLTQ1liJvqjKKTPfdI3vjxVkFBF9ohuwkH3C8M3cQwAuBJT6a5N-dYAptmNujYBMHFWKl_xZ25XeiGqa7MZ_Q; 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: 64199e08-eebc-4b7d-b37d-613a8dd93e12, 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: qeaXKOsXT16MALj6BjCNtXfR92h2J6tsKtFwZtpYtvQ0jwPdn9Nbdzt9LQbOe9wmz1NQzFr8ZN3WsO6oZCCxRENaLXNIWcYglf6zom0qcxLPb6ri7VC-HdxTgi7_lPJByYWXhTLcUM_IouIF0Hl8nZQxe-Gh2it3xnzv1HwPDH84ncfAzrej67XzZLLKNdm99Xc9bVK9hN1iddfBTB5wTeL1F6W-4neLUMgFWqc-CHAFfD1hD_0SfJEiCiD_E-YBmcwmBRAG-0_EacLVv4ZNEwzyzaec4Q6veyBwf21TsnmDVQ6bdGV-aFtsD4vjzYrTTe0m-YSht4XvMJOQZmD9KVmrwYY3Nih0jS_yYocNVQtYjgFBJBSpPluGX-rRier_oqxqOu-Z5HWUXbq__PoShoFEUZbz6w69OpwhJVtSkPz5L3e4LwQ5s_L7fJq0enZmrLMvDhVpvBfYydwqI5qpGD6hNeKSspJPvHp6MCn9De9qNK1lSO7qVzgFYmEIuyyHZv7pIccZug2EBix6CuC5amKROeffpp3UZixiJuwoUoCIUNjyQd7ureym-y2Zd0HM-a64tt-9-JWezh8d_WHBmgqWoHlzJDJ-aOM6lzY6vR0mZY-Vptx4UvFYSl_7KiZxdKrGOIaddZfhzyAqZ9d65FAHTIOLGNaoQGsXq0ZXU36AoYEKHsQLWvxr2NcucgJ3r7xJ5wLTQ1liJvqjKKTPfdI3vjxVkFBF9ohuwkH3C8M3cQwAuBJT6a5N-dYAptmNujYBMHFWKl_xZ25XeiGqa7MZ_Q"},{"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: cd789670-09a9-4db2-a316-e01ab72a6da1, 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: O2bvTI9GnfEDDrMB8Ads3MoS8zHn1jlB_n2CTNrv8HyEd3WkK0nZf72hByt1txecmyTelqECyt3qq9aqmdfsHCqLFcu5Pah-IrNwgw1NMmFRsmdL99sQsdGwXVuan2R-F-uXNLASxakYSao5wstuk6V9UNyDtbewtObbF4frGJ5rJ0CYJ8ofsbpGgetVJRPUv7ZAw7fti0nbGOGRvFbWVZ4PMxhdienQhZAIrbVHuN4HULU7JZJjoWXqgV6GMXMitawEs0rWJ5rUGgF8Ymi57MIO0BSWLvNYPB0dO3wS9edcSl1bucZQck5w-95J1zF_LNPTAHyP3lYxkYPEDvIHpXH_nNAhKarJ6VofTQTnfRJsKBO3pxDV7skMRHT_q5zFF1w2SdAShDT5J1mdB0QU_4Zmz-nQbj6avW2SVPgh9KQLiI4ZAWqhPLqy1257Cz_INp3KCvVI9DTxZSXKwWTQn6t9X8JOozaPhJEh21KJGo8ijlGlvOqSln_JKacKa6mb0nRo6WgYCwJcCadqi9j4pJTFaHrLJDWBTZMaxy60NzC1LNEknsYCF3nizN4sg_i540aM1IeGePybv_vmpfUSosAAehvAF8Xz80xyOsXkldCO5zygIi97cDVnBt_BZXD1f2UurwOGjtz540PtqkH-CwinKn3M3lzuVaEe0pfv6LLYyKYuEL5avYqrYvftthmM80sW741-KD_CEJ6wX9f2MbXGMl0AXjNlysnXYVJ-FlktZtIC1MVI5hDMwoFgPtMNCIn14jINd3NJ80r79JhZ4W3tKTU; 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: cd789670-09a9-4db2-a316-e01ab72a6da1, 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: O2bvTI9GnfEDDrMB8Ads3MoS8zHn1jlB_n2CTNrv8HyEd3WkK0nZf72hByt1txecmyTelqECyt3qq9aqmdfsHCqLFcu5Pah-IrNwgw1NMmFRsmdL99sQsdGwXVuan2R-F-uXNLASxakYSao5wstuk6V9UNyDtbewtObbF4frGJ5rJ0CYJ8ofsbpGgetVJRPUv7ZAw7fti0nbGOGRvFbWVZ4PMxhdienQhZAIrbVHuN4HULU7JZJjoWXqgV6GMXMitawEs0rWJ5rUGgF8Ymi57MIO0BSWLvNYPB0dO3wS9edcSl1bucZQck5w-95J1zF_LNPTAHyP3lYxkYPEDvIHpXH_nNAhKarJ6VofTQTnfRJsKBO3pxDV7skMRHT_q5zFF1w2SdAShDT5J1mdB0QU_4Zmz-nQbj6avW2SVPgh9KQLiI4ZAWqhPLqy1257Cz_INp3KCvVI9DTxZSXKwWTQn6t9X8JOozaPhJEh21KJGo8ijlGlvOqSln_JKacKa6mb0nRo6WgYCwJcCadqi9j4pJTFaHrLJDWBTZMaxy60NzC1LNEknsYCF3nizN4sg_i540aM1IeGePybv_vmpfUSosAAehvAF8Xz80xyOsXkldCO5zygIi97cDVnBt_BZXD1f2UurwOGjtz540PtqkH-CwinKn3M3lzuVaEe0pfv6LLYyKYuEL5avYqrYvftthmM80sW741-KD_CEJ6wX9f2MbXGMl0AXjNlysnXYVJ-FlktZtIC1MVI5hDMwoFgPtMNCIn14jINd3NJ80r79JhZ4W3tKTU"}]
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"133µ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"20µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"17µs
And "{ReceiverVpcId}" is not nil16µs
Given "{NonAllowlistedRequesterVpcId}" is not nil18µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"92µs
Then "{result.AllowedListDefined}" is true23µs
And "{result.Allowed}" is false20µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"357ms
Then "{result.DryRunAllowed}" is false38µs
And "{result.AllowListDefined}" is true24µs
And "{result.RequesterInAllowList}" is false23µs
And "{result.GuardrailExpectation}" is "deny"26µs
And "{result.GuardrailMismatch}" is false22µs
And "{result.ExitCode}" should be greater than "0"26µs
And "{result.Reason}" contains "guardrail aligned"26µs
And "{result.ConflictType}" is ""23µ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"42µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"125µs
And I refer to "{result}" as "vpcService"17µs
Given I refer to "{UID}" as "TargetVpcId"13µs
When I call "{vpcService}" with "EvaluateVpcFlowLogsControl" using argument "{TargetVpcId}"330ms
Then "{result.FlowLogCount}" should be greater than "0"60µs
expected {result.FlowLogCount} (0) to be greater than 0
And "{result.NonCompliantCount}" is "0"17µ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"110µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"289µs
And I refer to "{result}" as "vpcService"28µs
Given I refer to "{UID}" as "TargetVpcId"15µs
When I call "{vpcService}" with "PrepareFlowLogDeliveryObservation" using argument "{TargetVpcId}"326ms
And I call "{vpcService}" with "GenerateTestTraffic" using argument "{TargetVpcId}"124ms
And I refer to "{result.ResourceId}" as "TestResourceId"47µs
And I refer to "{result.CleanupDeleted}" as "TrafficCleanupDeleted"22µs
And I call "{vpcService}" with "ObserveRecentFlowLogDelivery" using argument "{TargetVpcId}"100ms
And I refer to "{result.RecordsObserved}" as "RecordsObserved"50µs
And I call "{vpcService}" with "DeleteTestResource" using argument "{TestResourceId}"37µs
Then "{result.Deleted}" is true44µs
expected {result.Deleted} to be truthy, got (type: )
And "{TrafficCleanupDeleted}" is true24µs
And "{RecordsObserved}" is true30µs