Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ACNS] FQDN Filtering Policies #4205

Open
chasewilson opened this issue Apr 10, 2024 · 14 comments
Open

[ACNS] FQDN Filtering Policies #4205

chasewilson opened this issue Apr 10, 2024 · 14 comments
Assignees
Labels
advanced-container-networking-services Features and issues concerning Advanced Container Networking Services Cilium enhancement feature-request Requested Features networking

Comments

@chasewilson
Copy link
Contributor

chasewilson commented Apr 10, 2024

GA ETA November 2024*

*ETA's are estimations and subject to change.

Advanced Container Networking Services supports FQDN Filtering

@EppO
Copy link

EppO commented Apr 25, 2024

Hi @chasewilson,
is it related to #3797 by any chance?

@TheKangaroo
Copy link

@EppO I dont think so. I think it is FQDN filtering based on the new observability tool https://retina.sh .
It was mentioned on the roadmap for retina on the Azure Day at Kubecon Europe:
https://youtu.be/hb__fHnx11s?feature=shared&t=2013

But I would love to hear from @chasewilson if this assumption is correct.

@EppO
Copy link

EppO commented May 6, 2024

Retina focuses on observability, while FQDN filtering goes beyond this scope. One might expect FQDN filtering policies to be enforced at the CNI level, but this is not currently supported by the NetworkPolicy resource.
Although Cilium has incorporated this feature via their CiliumNetworkPolicy resource, Azure CNI powered by Cilium does not support it yet.
It's unclear whether creating an additional CRD for this feature at the Azure CNI level is more advantageous than using Cilium directly. While it would cover all non-Cilium clusters, advanced users tend to select their CNI based on specific needs and requirements.

@TheKangaroo
Copy link

Right, I just saw "FQDN filtering" on the retina roadmap and think it has something to do with ACNS FQDN policies.
I hope @chasewilson can shed some light on this.

@illrill
Copy link

illrill commented May 23, 2024

Google opted to create its own FQDNNetworkPolicy CRD for this (probably just a wrapper around CiliumNetworkPolicy) in GKE's "Dataplane V2" network mode (which is just their branding of managed Cilium).

Meanwhile, there is also an upcoming FQDN selector in the official Network Policy API: kubernetes-sigs/network-policy-api#200.

It'll be interesting to see how AKS implements this.

@chasewilson
Copy link
Contributor Author

@TheKangaroo @illrill Keep an eye out for some announcements coming in the next couple months for FQDN filtering. :)

@tamilmani1989
Copy link
Member

tamilmani1989 commented Aug 27, 2024

update: This feature is getting released for public preview this week as part of ACNS offering ACNS. We will share official docs page once it's out.

@EppO
Copy link

EppO commented Aug 27, 2024

You can enable FQDN filtering policies on AKS now! (you need aks-preview extension for az):
az aks update --enable-acns -n myAKS -g myRGP and now you can use CiliumNetworkPolicy with DNS-based rules

apiVersion: "cilium.io/v2"
kind: CiliumNetworkPolicy
metadata:
  name: "fqdn"
spec:
  endpointSelector:
    matchLabels:
      org: empire
      class: mediabot
  egress:
  - toFQDNs:
    - matchPattern: "*.github.com"
  - toEndpoints:
    - matchLabels:
        "k8s:io.kubernetes.pod.namespace": kube-system
        "k8s:k8s-app": kube-dns
    toPorts:
    - ports:
      - port: "53"
        protocol: ANY
      rules:
        dns:
        - matchPattern: "*"

When you add an egress policy, don't forget to allow traffic to CoreDNS in kube-system, otherwise you won't be able to resolve anything.
Please note that L7 rules such as HTTP path filtering are not implemented yet.

@tamilmani1989
Copy link
Member

Its released: https://learn.microsoft.com/en-us/azure/aks/advanced-network-container-services-security-cli

@chasewilson chasewilson moved this from In Progress (Development) to Public Preview (Shipped & Improving) in Azure Kubernetes Service Roadmap (Public) Sep 4, 2024
@illrill
Copy link

illrill commented Sep 10, 2024

Thanks for this @chasewilson @tamilmani1989 & CO! Good work splitting out DNS proxy to its own component for HA 👍


We've enabled ACNS in our clusters and have CiliumNetworkPolicy objects successfully using these L3 rule types for egress:

  • toFQDNs: ✅ Works
  • toEndpoints: ✅ Works
  • toEntities: ✅ Works
  • toCIDRSet: ✅ Works
  • toServices:❔Not tested

Just beware of #4525 (currently, a regular NetworkPolicy with egress rules to port 53 causes the Cilium agent to crash).

@tamilmani1989
Copy link
Member

@illrill yes we are aware of that issue. we found the cause and will be rolling out fix soon.

@EppO
Copy link

EppO commented Sep 10, 2024

Is there any plans to make the FQDN filtering policy feature support other networking setup? I'm talking about Azure CNI Powered by Cilium without overlay

@chasewilson
Copy link
Contributor Author

@EppO thanks for the question here.

Great news is this is available for all Cilium compatible CNIs including Azure CNI Overlay, Azure CNI Dynamic IP Allocation, and Azure CNI Static Block Allocation.

@EppO
Copy link

EppO commented Sep 11, 2024

@chasewilson: That's good news! I swear I saw this limitation in the AKS docs when it got released but it's indeed now gone. Can't wait for this to go GA!

EDIT: scratch that, the limitation I was mentioning (Overlay mode required) was for Node autoprovisioning

@vakalapa vakalapa moved this from Public Preview (Shipped & Improving) to Generally Available (Done) in Azure Kubernetes Service Roadmap (Public) Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advanced-container-networking-services Features and issues concerning Advanced Container Networking Services Cilium enhancement feature-request Requested Features networking
Projects
Status: Generally Available (Done)
Development

No branches or pull requests

8 participants