Skip to content

[BUG] AdminNetworkPolicy Core can't express allow/deny all #248

@fasaxc

Description

@fasaxc

Various use cases of ANP require a "deny all" following a set of Pass/Allow rules but it looks like that's hard to express in the current structure. We require at least one ANPXXXPeer in a rule and then a peer can't be empty. I think "deny all" requires the Networks extension to be present so that you can write 0.0.0.0/0 and ::/0 into the list of CIDRs

	// From is the list of sources whose traffic this rule applies to.
	// If any AdminNetworkPolicyIngressPeer matches the source of incoming
	// traffic then the specified action is applied.
	// This field must be defined and contain at least one item.
	//
	// Support: Core
	//
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=100
	From []AdminNetworkPolicyIngressPeer `json:"from"`

I suppose this is a consequence of the requirement to fail closed if the policy is "empty" but it struck me as awkward to need to think of something to put in a Peer when I want to create a "blanket" rule. (It'd be easy to forget the IPv6 CIDR, for example, resulting in only blocking IPv4 traffic.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions