Skip to content

Update NPEP-133 with Admin-tier restriction, DNS security guidance, and v1alpha2 API#366

Open
tssurya wants to merge 1 commit into
kubernetes-sigs:mainfrom
tssurya:fqdn-field-description-update
Open

Update NPEP-133 with Admin-tier restriction, DNS security guidance, and v1alpha2 API#366
tssurya wants to merge 1 commit into
kubernetes-sigs:mainfrom
tssurya:fqdn-field-description-update

Conversation

@tssurya
Copy link
Copy Markdown
Contributor

@tssurya tssurya commented Apr 5, 2026

The PR updates the details around domainNames
as discussed in KubeCon Atlanta:
https://docs.google.com/document/d/1AtWQy2fNa4qXRag9cCp5_HsefD7bxKe3ea2RPn8jnSs/edit?tab=t.k47ujuef4zxk#bookmark=id.hl0pbdvwfotd

  • Restrict domainNames to Admin tier only with CEL validation (Baseline tier breaks the NetworkPolicy override model)
  • Add CEL validation for Accept-only action restriction
  • Update API examples to v1alpha2 ClusterNetworkPolicy format
  • Add Expected Behavior points for DNS reachability and resolv.conf
  • Add Recommended Behavior section covering DNS security concerns, grace period, and DNSSEC best practice
  • Add Connection Lifecycle section for policy add/remove semantics

NOTE to reviewers:

  • I didn't update the field description because I wasn't sure what all is worth capturing in the field v/s not, so happy to change that aspect during reviews
  • * can mean one or more labels and that's what is present in current OKEP as well

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 5, 2026

Deploy Preview for kubernetes-sigs-network-policy-api ready!

Name Link
🔨 Latest commit 2af60be
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-network-policy-api/deploys/69f99ca2a517be00083ae821
😎 Deploy Preview https://deploy-preview-366--kubernetes-sigs-network-policy-api.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tssurya

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested review from aojea and danwinship April 5, 2026 17:05
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 5, 2026
if BANP allows traffic to `example.io`, but the namespace admin installs a
Kubernetes Network Policy, the namespace admin has no way to replicate the
`example.io` selector using just Kubernetes Network Policies.
* DomainNames is restricted to the Admin tier of ClusterNetworkPolicy only.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The notes from Atlanta say that we didn't really discuss this, which matches my memory. I think we had agreed though, when talking about Pass and priority, that in the new one-object-with-tiers world, there would be a default assumption that Admin and Baseline would have identical functionality.

The fact that some uses of DomainNames in Baseline would cause problems seems more like a "don't do that then" situation than something we actually need to restrict.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed this again in the network-policy-api sub area meeting on April 7th 2026 and decided let's start with restricting it to only Admin Tier and then later upon use case and request , we can make it available for Baseline Tier

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wait or maybe I am confusing this with Pass..
Did we decide to keep DomainNames with Baseline as well, but just restrict it to not be used with Pass?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the "Maybe we start with restricting things and then open things up?" comment there was about whether we should allow Pass rules with DomainNames. I think we all agreed that we should allow DomainNames in Baseline CNPs.

Comment thread npeps/npep-133-fqdn-egress-selector.md Outdated
// +kubebuilder:validation:XValidation:rule="self.tier == 'Baseline' ? !self.egress.exists(rule, rule.to.exists(peer, has(peer.domainNames))) : true",message="domainNames cannot be used in Baseline tier as NetworkPolicy cannot override FQDN rules"
type ClusterNetworkPolicySpec struct { ... }

// +kubebuilder:validation:XValidation:rule="self.to.exists(peer, has(peer.domainNames)) ? self.action == 'Accept' : true",message="domainNames may only be used with Accept action"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe flip the rule the other way around like the tier check above, to put the simple check first and only do the exists check if it fails?

Also, is "only with Accept" correct, or should it be "not with Deny"? That is, should we allow "Pass" with DomainNames? I'm not sure we really thought about that, and given how we kept getting confused and thinking of admins using "Allow" when we really meant "Pass", maybe we need to revisit this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meeting notes from 7th April 2026:

[surya] https://github.com/kubernetes-sigs/network-policy-api/pull/366 - update to FQDN NPEP
If any API changes are we ok to backport this to ANP - noone opposed in meeting
[dan] Do we need to also have FQDN in the PASS case? And not just ACCEPT?
Meeting notes:
supporting PASS is OK? 
Does Calico allow PASS for domainNames match? - NO.
Right now Cilium is also only doing domainNames and ACCEPT
Maybe we start with restricting things and then open things up?

so for now we keep it only with accept and then open it up later for pass?

Comment thread npeps/npep-133-fqdn-egress-selector.md
Comment thread npeps/npep-133-fqdn-egress-selector.md
tier of ClusterNetworkPolicy.

These restrictions are enforced via CEL validation on
`ClusterNetworkPolicySpec` (Baseline tier) and
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't do a CEL for this
allow FQDN also in baseline tier

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 9, 2026
…nd CEL

The PR updates the details around domainNames
as discussed in KubeCon Atlanta:
https://docs.google.com/document/d/1AtWQy2fNa4qXRag9cCp5_HsefD7bxKe3ea2RPn8jnSs/edit?tab=t.k47ujuef4zxk#bookmark=id.hl0pbdvwfotd

- Restrict domainNames to Admin tier only with CEL validation
  (Baseline tier breaks the NetworkPolicy override model)
- Add CEL validation for Accept-only action restriction
- Update API examples to v1alpha2 ClusterNetworkPolicy format
- Add Expected Behavior points for DNS reachability and resolv.conf
- Add Recommended Behavior section covering DNS security concerns,
  grace period, and DNSSEC best practice
- Add Connection Lifecycle section for policy add/remove semantics
@tssurya tssurya force-pushed the fqdn-field-description-update branch from b8a2a6c to 2af60be Compare May 5, 2026 07:30
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants