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

Test Parameters

ServiceTypevpc
ProviderServiceTypeec2:vpc
CatalogTypesCCC.VPC
TagFilter@MAIN, @CCC.VPC
UIDvpc-0b622dcd5eee1a986
ResourceNamecfi-1775557775-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-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:02

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"116µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"248µs
And I refer to "{result}" as "vpcService"61µs
When I call "{vpcService}" with "CountDefaultVpcs"363ms
Then "{result}" is "0"30µ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"33µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"127µs
And I refer to "{result}" as "vpcService"24µs
Given I refer to "{UID}" as "TargetVpcId"13µs
When I call "{vpcService}" with "EvaluatePublicSubnetDefaultIPControl" using argument "{TargetVpcId}"400ms
Then "{result.ViolatingSubnetCount}" is "0"52µs
And "{result.Reason}" contains "disable default public IP"36µ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"171µs
And I refer to "{result}" as "vpcService"26µ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"51µs
And I call "{vpcService}" with "CreateTestResourceInSubnet" using argument "{TestSubnetId}"35µs
And I refer to "{result.ResourceId}" as "TestResourceId"24µs
And I call "{vpcService}" with "GetResourceExternalIpAssignment" using argument "{TestResourceId}"30µs
And I refer to "{result.HasExternalIp}" as "HasExternalIp"22µs
Then "{HasExternalIp}" is false21µs
When I call "{vpcService}" with "DeleteTestResource" using argument "{TestResourceId}"25µ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"21µs
And I load environment variable "CN03_RECEIVER_VPC_ID" as "ReceiverVpcId"29µ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"27µs
And "{ReceiverVpcId}" is not nil18µs
When I call "{vpcService}" with "ValidateDisallowListEnforcement" using argument "{ReceiverVpcId}"480ms
And I attach "{result.Summary}" to the test output as "Disallow-list Enforcement Summary"59µs
And I attach "{result.Results}" to the test output as "Disallow-list Enforcement"94µs
Then "{result.ListDefined}" is true41µs
And "{result.TestedCount}" should be greater than "0"64µs
And "{result.AllCorrect}" is true21µs
And "{result.ViolationCount}" is "0"33µ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-027ef85c88b9d68c2","Reason":"operation error EC2: CreateVpcPeeringConnection, https response error StatusCode: 403, RequestID: f6dd6b90-9c38-4c52-b40d-a04075dacddc, 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: 60PAcZ7LfEphX2qR2_ZHcHynadWG7FEuzn7PfRlmmfTVl2Img3u6jZSoyFurR5xp480R2Og9pyDpUXzt1LwxbZeNBVvLkLoqkj1CR7ja7r6-2HgQrr5kKmEFjE1WoM0PZXIuSfSf6GlXUMI0KdziFyNRJxtfrXWfIlXjEDNPN4VRq_V2JqB0sTUF9KOIQ3-jyGycX9x2Oxvfl5A5dW4j0AuPN6rFyjI-b6aKbcKBeUg-PVVK-FqA0OUaWFkhEKo3B1nE_9llfJPDbDlkMfbnzwu_6onWzeHaILFG3i2ew9t1vCPiMcBhKC7A8GUzDsrbKMfFptxPJz9wDXpxhHv7tW70mX_VuzEoBDHZgQKEiKZ1VAODXqx_PBM-ov5xZ2nRHqh27o3yyaZYjzn_d8gm2Wj1fXLDSKIOWzCD3XOOLDud3J5xfx_xlXDA7gVk_koa02O3eQpFdum6ZmNctz97EZ11nE27YLepmD7qaqdpSDjkoVbagCk_G_nn2KDJy4fb5iFa1BXTrkoWiCxCnTeahC3XMFvjMCa7w_8rIx1mtvbzWGwODJe3oGoCgjX4bwgsHmNSgRwa5tiOZWvERFesjKknLsnYowdfUjwuJBtsJMEDLoAo151CTqTjoTe180qH-_KVqFqqIlGHq_o9RGXsNbqY0b8ETVoFN6YjxwKEfBfBDcEvbrHf05hgCIHKNDkxu7GGR4usUFBfulWDauzWLWE7a2JYx9vf6sbpooYPYDwO8Rw-1HQeMPouMaa3l91BA0HTJc0c6iGarR1FwvxY_rnd; 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: f6dd6b90-9c38-4c52-b40d-a04075dacddc, 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: 60PAcZ7LfEphX2qR2_ZHcHynadWG7FEuzn7PfRlmmfTVl2Img3u6jZSoyFurR5xp480R2Og9pyDpUXzt1LwxbZeNBVvLkLoqkj1CR7ja7r6-2HgQrr5kKmEFjE1WoM0PZXIuSfSf6GlXUMI0KdziFyNRJxtfrXWfIlXjEDNPN4VRq_V2JqB0sTUF9KOIQ3-jyGycX9x2Oxvfl5A5dW4j0AuPN6rFyjI-b6aKbcKBeUg-PVVK-FqA0OUaWFkhEKo3B1nE_9llfJPDbDlkMfbnzwu_6onWzeHaILFG3i2ew9t1vCPiMcBhKC7A8GUzDsrbKMfFptxPJz9wDXpxhHv7tW70mX_VuzEoBDHZgQKEiKZ1VAODXqx_PBM-ov5xZ2nRHqh27o3yyaZYjzn_d8gm2Wj1fXLDSKIOWzCD3XOOLDud3J5xfx_xlXDA7gVk_koa02O3eQpFdum6ZmNctz97EZ11nE27YLepmD7qaqdpSDjkoVbagCk_G_nn2KDJy4fb5iFa1BXTrkoWiCxCnTeahC3XMFvjMCa7w_8rIx1mtvbzWGwODJe3oGoCgjX4bwgsHmNSgRwa5tiOZWvERFesjKknLsnYowdfUjwuJBtsJMEDLoAo151CTqTjoTe180qH-_KVqFqqIlGHq_o9RGXsNbqY0b8ETVoFN6YjxwKEfBfBDcEvbrHf05hgCIHKNDkxu7GGR4usUFBfulWDauzWLWE7a2JYx9vf6sbpooYPYDwO8Rw-1HQeMPouMaa3l91BA0HTJc0c6iGarR1FwvxY_rnd"},{"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: 136752e7-dd92-4012-badb-319ace10d036, 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: R5cX6f2JKqkGMXWJaZRh497Im78s1lSjaJLYKk7z1p_RgT4n0TzPCSdLMvl7QXjb-dKuhkpiga97kHRtGD_gORAzHP7O7KOfC7e9q2SxRtyNUmucJ_Cey_44Q8D2VpqBbOdECUsylDhRu3zmPqFcqyahkzfDvkpEJwg-_WfZMRAuWPHG8zK2fEvzvvdmvdxG8oPInFYRGNULLaZQJdjU6DqlB1cb6qn71SInIIGzv8NB7P8R1TzI9gHJiehKS7sH_84A1uEI-VGUOiPS-MEO6AzpFKX41KRalSYro3yEK6aqR2P9K2sltHNlEOS_uAwWjSH6zWD313Kw5NPaFtXIFiV3TKVvfcZTvOnlmNkh-G1bXKYdoQdhLWklFIfOHQPUaQyEJnVRJhtFEg79gUL9hd2trTGTjNnOZfQWRkebvFccPFvMCieexvfxIR__poJUR-T4BpxMssmyobRZQ1NlfnMo7p2M1PRzbegQ6G4_1A7NIp_DzQEZ5mSx_aTM3V07SoQ2gKi0gOhbzMZasFBHhEgdRZEE6ONdOiQUgRprsHv06MmzxEbJCWh3fA1Lz81Ghr8Pa9l15yI4N3IXVFkuQcSKMOw1bFAbE91ARgGGwaDJCpqyg9SAi20WwknZcXi56I3MmUIt68UK2VZcKIAbL15YvYxphfQ4Qw8fLIrVqMdOD_0eGspLqqYEAwlt7wd-QHS2Nyq4Tr2rVscHio9XuSlxGYYf0bZeGpvhOnTqYTWBwA4qy9dz8JnuX46vzBQ1BIuPM3H-ca37VYAI22v5GV6V; 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: 136752e7-dd92-4012-badb-319ace10d036, 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: R5cX6f2JKqkGMXWJaZRh497Im78s1lSjaJLYKk7z1p_RgT4n0TzPCSdLMvl7QXjb-dKuhkpiga97kHRtGD_gORAzHP7O7KOfC7e9q2SxRtyNUmucJ_Cey_44Q8D2VpqBbOdECUsylDhRu3zmPqFcqyahkzfDvkpEJwg-_WfZMRAuWPHG8zK2fEvzvvdmvdxG8oPInFYRGNULLaZQJdjU6DqlB1cb6qn71SInIIGzv8NB7P8R1TzI9gHJiehKS7sH_84A1uEI-VGUOiPS-MEO6AzpFKX41KRalSYro3yEK6aqR2P9K2sltHNlEOS_uAwWjSH6zWD313Kw5NPaFtXIFiV3TKVvfcZTvOnlmNkh-G1bXKYdoQdhLWklFIfOHQPUaQyEJnVRJhtFEg79gUL9hd2trTGTjNnOZfQWRkebvFccPFvMCieexvfxIR__poJUR-T4BpxMssmyobRZQ1NlfnMo7p2M1PRzbegQ6G4_1A7NIp_DzQEZ5mSx_aTM3V07SoQ2gKi0gOhbzMZasFBHhEgdRZEE6ONdOiQUgRprsHv06MmzxEbJCWh3fA1Lz81Ghr8Pa9l15yI4N3IXVFkuQcSKMOw1bFAbE91ARgGGwaDJCpqyg9SAi20WwknZcXi56I3MmUIt68UK2VZcKIAbL15YvYxphfQ4Qw8fLIrVqMdOD_0eGspLqqYEAwlt7wd-QHS2Nyq4Tr2rVscHio9XuSlxGYYf0bZeGpvhOnTqYTWBwA4qy9dz8JnuX46vzBQ1BIuPM3H-ca37VYAI22v5GV6V"}]
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"43µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"124µs
And I refer to "{result}" as "vpcService"15µ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"19µs
And I load environment variable "CN03_PEER_TRIAL_MATRIX_FILE" as "PeerTrialMatrixFile"31µs
And "{ReceiverVpcId}" is not nil17µs
Given "{NonAllowlistedRequesterVpcId}" is not nil16µs
When I call "{vpcService}" with "EvaluatePeerAgainstAllowList" using argument "{NonAllowlistedRequesterVpcId}"107µs
Then "{result.AllowedListDefined}" is true23µs
And "{result.Allowed}" is false36µs
When I call "{vpcService}" with "AttemptVpcPeeringDryRun" using arguments "{NonAllowlistedRequesterVpcId}" and "{ReceiverVpcId}"334ms
Then "{result.DryRunAllowed}" is false53µs
And "{result.AllowListDefined}" is true28µs
And "{result.RequesterInAllowList}" is false46µs
And "{result.GuardrailExpectation}" is "deny"32µs
And "{result.GuardrailMismatch}" is false38µs
And "{result.ExitCode}" should be greater than "0"71µs
And "{result.Reason}" contains "guardrail aligned"46µ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"40µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"128µs
And I refer to "{result}" as "vpcService"19µs
Given I refer to "{UID}" as "TargetVpcId"13µs
When I call "{vpcService}" with "EvaluateVpcFlowLogsControl" using argument "{TargetVpcId}"320ms
Then "{result.FlowLogCount}" should be greater than "0"52µs
expected {result.FlowLogCount} (0) to be greater than 0
And "{result.NonCompliantCount}" is "0"21µ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"33µs
And I call "{api}" with "GetServiceAPI" using argument "vpc"170µs
And I refer to "{result}" as "vpcService"28µs
Given I refer to "{UID}" as "TargetVpcId"23µs
When I call "{vpcService}" with "PrepareFlowLogDeliveryObservation" using argument "{TargetVpcId}"336ms
And I call "{vpcService}" with "GenerateTestTraffic" using argument "{TargetVpcId}"130ms
And I refer to "{result.ResourceId}" as "TestResourceId"55µs
And I refer to "{result.CleanupDeleted}" as "TrafficCleanupDeleted"25µs
And I call "{vpcService}" with "ObserveRecentFlowLogDelivery" using argument "{TargetVpcId}"109ms
And I refer to "{result.RecordsObserved}" as "RecordsObserved"43µs
And I call "{vpcService}" with "DeleteTestResource" using argument "{TestResourceId}"40µs
Then "{result.Deleted}" is true203µs
expected {result.Deleted} to be truthy, got (type: )
And "{TrafficCleanupDeleted}" is true65µs
And "{RecordsObserved}" is true57µs