Skip to content

Support CIDR-dependent L4 ingress policies #4129

@joestringer

Description

@joestringer

We don't currently support specifying policies that have both "FromCIDR" and "ToPorts" on ingress. This should allow only traffic that matches both of these conditions, and would only apply to traffic that does not originate from another Cilium-managed endpoint.

This is the equivalent issue to #1684, but for ingress.

The interesting thing about ingress is that in many cases (most commonly nodeport with k8s), we lose the source IP address before traffic reaches Cilium, so the CIDR policy would only apply to the source address of the host which the traffic is masqueraded to. Note that CIDR policy does not apply to traffic received from another pod managed by Cilium, so this functionality would not be particularly useful in this scenario.

UPDATE 2019/06/03: With v1.6 providing BPF-based nodeport which does not require obscuring the original IP address, this feature may become more interesting.

That said, even for this case, it could potentially shift some complexity for CIDR handling from the bpf_lxc program to the bpf_netdev program, which would free up some BPF instruction count for use by other features.

In cases of direct routing it may be useful to be able to perform CIDR-dependent ingress L4 policies, as in this case we should still have access to the original source.

Tasks:

Follow-up

  • Consider whether there's a better way to structure visibility into CIDR policy in the endpoint API

Metadata

Metadata

Assignees

Labels

area/datapathImpacts bpf/ or low-level forwarding details, including map management and monitor messages.kind/enhancementThis would improve or streamline existing functionality.pinnedThese issues are not marked stale by our issue bot.roadmapThis functionality is planned for a future release of Cilium.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions