Skip to content

allowing CIDRs, wildcards and Plural in IP and DNS#806

Open
entlein wants to merge 1 commit into
kubescape:mainfrom
k8sstormcenter:upstream-pr/sbob-network
Open

allowing CIDRs, wildcards and Plural in IP and DNS#806
entlein wants to merge 1 commit into
kubescape:mainfrom
k8sstormcenter:upstream-pr/sbob-network

Conversation

@entlein
Copy link
Copy Markdown

@entlein entlein commented May 15, 2026

Overview

network-wildcards: DNS leading/trailing/mid + CIDR + IPAddresses + "*" sentinel

Additional Information

CEL networkneighborhood helpers now query
projected fields with wildcard/CIDR/DNS-wildcard support and the v0.0.2
spec semantics (port/protocol checks degrade to address-only in v1
when only a CIDR is declared).

  • DNS leading-* (RFC 4592 single-label wildcard)
  • DNS trailing-* (subdomain-prefix wildcard)
  • DNS mid- (interior dynamic segment)
  • IPv4/IPv6 literals and CIDR ranges
  • * any-IP sentinel
  • IPAddresses list (deprecated single-IP field) preserved on the
    decode path

How to Test

20 declarative fixture YAMLs under tests/resources/network-wildcards/
pin the wildcard contract end-to-end:

  • Literal IPv4/IPv6
  • CIDR IPv4/IPv6
  • * any-IP and * as CIDR
  • Mixed IP list
  • Deprecated IPAddresses field path
  • DNS literal, leading wildcard, mid-, trailing-*
  • Trailing-dot normalisation
  • Recursive * rejection
  • Egress-and-ingress, egress-none
  • Realistic Stripe API scenario
  • Cluster DNS via mid-
  • Port+protocol with CIDR
  • Multi-container mixed wildcards

Has sister PR in storage

Signed-off-by: entlein <einentlein@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 15, 2026

Warning

Rate limit exceeded

@entlein has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 43 minutes and 26 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a16a939d-cb3d-4a84-9a08-c837900d4ac3

📥 Commits

Reviewing files that changed from the base of the PR and between cc59fa0 and b6ade83.

📒 Files selected for processing (24)
  • pkg/rulemanager/cel/libraries/networkneighborhood/fixtures_test.go
  • pkg/rulemanager/cel/libraries/networkneighborhood/network.go
  • pkg/rulemanager/cel/libraries/networkneighborhood/wildcard_test.go
  • tests/resources/network-wildcards/01-literal-ipv4.yaml
  • tests/resources/network-wildcards/02-literal-ipv6.yaml
  • tests/resources/network-wildcards/03-cidr-ipv4.yaml
  • tests/resources/network-wildcards/04-cidr-ipv6.yaml
  • tests/resources/network-wildcards/05-any-ip-sentinel.yaml
  • tests/resources/network-wildcards/06-any-as-cidr.yaml
  • tests/resources/network-wildcards/07-mixed-ip-list.yaml
  • tests/resources/network-wildcards/08-deprecated-ipaddress.yaml
  • tests/resources/network-wildcards/09-dns-literal.yaml
  • tests/resources/network-wildcards/10-dns-leading-wildcard.yaml
  • tests/resources/network-wildcards/11-dns-mid-ellipsis.yaml
  • tests/resources/network-wildcards/12-dns-trailing-star.yaml
  • tests/resources/network-wildcards/13-dns-trailing-dot-normalisation.yaml
  • tests/resources/network-wildcards/14-recursive-star-rejected.yaml
  • tests/resources/network-wildcards/15-egress-and-ingress.yaml
  • tests/resources/network-wildcards/16-egress-none.yaml
  • tests/resources/network-wildcards/17-realistic-stripe-api.yaml
  • tests/resources/network-wildcards/18-cluster-dns-via-mid-ellipsis.yaml
  • tests/resources/network-wildcards/19-port-protocol-with-cidr.yaml
  • tests/resources/network-wildcards/20-multi-container-mixed-wildcards.yaml
  • tests/resources/network-wildcards/README.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant