cilium.io / v2 / CiliumNetworkPolicy
- string
.apiVersion
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
- string
.kind
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
- object required
.metadata
-
.spec
Spec is the desired Cilium specific rule specification.
- string
.spec .description
Description is a free form string, it can be used by the creator of the rule to store human readable explanation of the purpose of this rule. Rules cannot be identified by comment.
- array
.spec .egress
Egress is a list of EgressRule which are enforced at egress. If omitted or empty, this rule does not apply at egress.
- object
.spec .egress[] .authentication
Authentication is the required authentication type for the allowed traffic, if any.
- string required
.spec .egress[] .authentication .mode
Mode is the required authentication mode for the allowed traffic, if any.
- array
.spec .egress[] .icmps
ICMPs is a list of ICMP rule identified by type number which the endpoint subject to the rule is allowed to connect to.
Example: Any endpoint with the label “app=httpd” is allowed to initiate type 8 ICMP connections.
- array
.spec .egress[] .icmps[] .fields
Fields is a list of ICMP fields.
- string
.spec .egress[] .icmps[] .fields[] .family
Family is a IP address version. Currently, we support
IPv4
andIPv6
.IPv4
is set as default. - integer | string required
.spec .egress[] .icmps[] .fields[] .type
Type is a ICMP-type. It should be an 8bit code (0-255), or it’s CamelCase name (for example, “EchoReply”). Allowed ICMP types are: Ipv4: EchoReply | DestinationUnreachable | Redirect | Echo | EchoRequest | RouterAdvertisement | RouterSelection | TimeExceeded | ParameterProblem | Timestamp | TimestampReply | Photuris | ExtendedEcho Request | ExtendedEcho Reply Ipv6: DestinationUnreachable | PacketTooBig | TimeExceeded | ParameterProblem | EchoRequest | EchoReply | MulticastListenerQuery| MulticastListenerReport | MulticastListenerDone | RouterSolicitation | RouterAdvertisement | NeighborSolicitation | NeighborAdvertisement | RedirectMessage | RouterRenumbering | ICMPNodeInformationQuery | ICMPNodeInformationResponse | InverseNeighborDiscoverySolicitation | InverseNeighborDiscoveryAdvertisement | HomeAgentAddressDiscoveryRequest | HomeAgentAddressDiscoveryReply | MobilePrefixSolicitation | MobilePrefixAdvertisement | DuplicateAddressRequestCodeSuffix | DuplicateAddressConfirmationCodeSuffix | ExtendedEchoRequest | ExtendedEchoReply
- array
.spec .egress[] .toCIDR
ToCIDR is a list of IP blocks which the endpoint subject to the rule is allowed to initiate connections. Only connections destined for outside of the cluster and not targeting the host will be subject to CIDR rules. This will match on the destination IP address of outgoing connections. Adding a prefix into ToCIDR or into ToCIDRSet with no ExcludeCIDRs is equivalent. Overlaps are allowed between ToCIDR and ToCIDRSet.
Example: Any endpoint with the label “app=database-proxy” is allowed to initiate connections to 10.2.3.0/24
- array
.spec .egress[] .toCIDRSet
ToCIDRSet is a list of IP blocks which the endpoint subject to the rule is allowed to initiate connections to in addition to connections which are allowed via ToEndpoints, along with a list of subnets contained within their corresponding IP block to which traffic should not be allowed. This will match on the destination IP address of outgoing connections. Adding a prefix into ToCIDR or into ToCIDRSet with no ExcludeCIDRs is equivalent. Overlaps are allowed between ToCIDR and ToCIDRSet.
Example: Any endpoint with the label “app=database-proxy” is allowed to initiate connections to 10.2.3.0/24 except from IPs in subnet 10.2.3.0/28.
- string
.spec .egress[] .toCIDRSet[] .cidr
CIDR is a CIDR prefix / IP Block.
- string
.spec .egress[] .toCIDRSet[] .cidrGroupRef
CIDRGroupRef is a reference to a CiliumCIDRGroup object. A CiliumCIDRGroup contains a list of CIDRs that the endpoint, subject to the rule, can (Ingress/Egress) or cannot (IngressDeny/EgressDeny) receive connections from.
- object
.spec .egress[] .toCIDRSet[] .cidrGroupSelector
CIDRGroupSelector selects CiliumCIDRGroups by their labels, rather than by name.
- array
.spec .egress[] .toCIDRSet[] .cidrGroupSelector .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .egress[] .toCIDRSet[] .cidrGroupSelector .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .egress[] .toCIDRSet[] .cidrGroupSelector .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .egress[] .toCIDRSet[] .cidrGroupSelector .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .egress[] .toCIDRSet[] .cidrGroupSelector .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.spec .egress[] .toCIDRSet[] .except
ExceptCIDRs is a list of IP blocks which the endpoint subject to the rule is not allowed to initiate connections to. These CIDR prefixes should be contained within Cidr, using ExceptCIDRs together with CIDRGroupRef is not supported yet. These exceptions are only applied to the Cidr in this CIDRRule, and do not apply to any other CIDR prefixes in any other CIDRRules.
- array
.spec .egress[] .toEndpoints
ToEndpoints is a list of endpoints identified by an EndpointSelector to which the endpoints subject to the rule are allowed to communicate.
Example: Any endpoint with the label “role=frontend” can communicate with any endpoint carrying the label “role=backend”.
- array
.spec .egress[] .toEndpoints[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .egress[] .toEndpoints[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .egress[] .toEndpoints[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .egress[] .toEndpoints[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .egress[] .toEndpoints[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.spec .egress[] .toEntities
ToEntities is a list of special entities to which the endpoint subject to the rule is allowed to initiate connections. Supported entities are
world
,cluster
,host
,remote-node
,kube-apiserver
,init
,health
,unmanaged
andall
. - array
.spec .egress[] .toFQDNs
ToFQDN allows whitelisting DNS names in place of IPs. The IPs that result from DNS resolution of
ToFQDN.MatchName
s are added to the same EgressRule object as ToCIDRSet entries, and behave accordingly. Any L4 and L7 rules within this EgressRule will also apply to these IPs. The DNS -> IP mapping is re-resolved periodically from within the cilium-agent, and the IPs in the DNS response are effected in the policy for selected pods as-is (i.e. the list of IPs is not modified in any way). Note: An explicit rule to allow for DNS traffic is needed for the pods, as ToFQDN counts as an egress rule and will enforce egress policy when PolicyEnforcment=default. Note: If the resolved IPs are IPs within the kubernetes cluster, the ToFQDN rule will not apply to that IP. Note: ToFQDN cannot occur in the same policy as other To* rules. - string
.spec .egress[] .toFQDNs[] .matchName
MatchName matches literal DNS names. A trailing “.” is automatically added when missing.
- string
.spec .egress[] .toFQDNs[] .matchPattern
MatchPattern allows using wildcards to match DNS names. All wildcards are case insensitive. The wildcards are:
- “” matches 0 or more DNS valid characters, and may occur anywhere in the pattern. As a special case a “” as the leftmost character, without a following “.” matches all subdomains as well as the name to the right. A trailing “.” is automatically added when missing.
Examples:
*.cilium.io
matches subdomains of cilium at that level www.cilium.io and blog.cilium.io match, cilium.io and google.com do not*cilium.io
matches cilium.io and all subdomains ends with “cilium.io” except those containing “.” separator, subcilium.io and sub-cilium.io match, www.cilium.io and blog.cilium.io does not sub*.cilium.io matches subdomains of cilium where the subdomain component begins with “sub” sub.cilium.io and subdomain.cilium.io match, www.cilium.io, blog.cilium.io, cilium.io and google.com do not - array
.spec .egress[] .toGroups
ToGroups is a directive that allows the integration with multiple outside providers. Currently, only AWS is supported, and the rule can select by multiple sub directives:
Example: toGroups:
- aws:
securityGroupsIds:
- ‘sg-XXXXXXXXXXXXX’
- aws:
securityGroupsIds:
- object
.spec .egress[] .toGroups[] .aws
AWSGroup is an structure that can be used to whitelisting information from AWS integration
- object
.spec .egress[] .toGroups[] .aws .labels
- string
.spec .egress[] .toGroups[] .aws .region
- array
.spec .egress[] .toGroups[] .aws .securityGroupsIds
- array
.spec .egress[] .toGroups[] .aws .securityGroupsNames
- array
.spec .egress[] .toNodes
ToNodes is a list of nodes identified by an EndpointSelector to which endpoints subject to the rule is allowed to communicate.
- array
.spec .egress[] .toNodes[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .egress[] .toNodes[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .egress[] .toNodes[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .egress[] .toNodes[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .egress[] .toNodes[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.spec .egress[] .toPorts
ToPorts is a list of destination ports identified by port number and protocol which the endpoint subject to the rule is allowed to connect to.
Example: Any endpoint with the label “role=frontend” is allowed to initiate connections to destination port 8080/tcp
- object
.spec .egress[] .toPorts[] .listener
listener specifies the name of a custom Envoy listener to which this traffic should be redirected to.
- object required
.spec .egress[] .toPorts[] .listener .envoyConfig
EnvoyConfig is a reference to the CEC or CCEC resource in which the listener is defined.
- string
.spec .egress[] .toPorts[] .listener .envoyConfig .kind
Kind is the resource type being referred to. Defaults to CiliumEnvoyConfig or CiliumClusterwideEnvoyConfig for CiliumNetworkPolicy and CiliumClusterwideNetworkPolicy, respectively. The only case this is currently explicitly needed is when referring to a CiliumClusterwideEnvoyConfig from CiliumNetworkPolicy, as using a namespaced listener from a cluster scoped policy is not allowed.
- string required
.spec .egress[] .toPorts[] .listener .envoyConfig .name
Name is the resource name of the CiliumEnvoyConfig or CiliumClusterwideEnvoyConfig where the listener is defined in.
- string required
.spec .egress[] .toPorts[] .listener .name
Name is the name of the listener.
- integer
.spec .egress[] .toPorts[] .listener .priority
Priority for this Listener that is used when multiple rules would apply different listeners to a policy map entry. Behavior of this is implementation dependent.
- object
.spec .egress[] .toPorts[] .originatingTLS
OriginatingTLS is the TLS context for the connections originated by the L7 proxy. For egress policy this specifies the client-side TLS parameters for the upstream connection originating from the L7 proxy to the remote destination. For ingress policy this specifies the client-side TLS parameters for the connection from the L7 proxy to the local endpoint.
- string
.spec .egress[] .toPorts[] .originatingTLS .certificate
Certificate is the file name or k8s secret item name for the certificate chain. If omitted, ‘tls.crt’ is assumed, if it exists. If given, the item must exist.
- string
.spec .egress[] .toPorts[] .originatingTLS .privateKey
PrivateKey is the file name or k8s secret item name for the private key matching the certificate chain. If omitted, ‘tls.key’ is assumed, if it exists. If given, the item must exist.
- object required
.spec .egress[] .toPorts[] .originatingTLS .secret
Secret is the secret that contains the certificates and private key for the TLS context. By default, Cilium will search in this secret for the following items:
- ‘ca.crt’ - Which represents the trusted CA to verify remote source.
- ‘tls.crt’ - Which represents the public key certificate.
- ‘tls.key’ - Which represents the private key matching the public key certificate.
- string required
.spec .egress[] .toPorts[] .originatingTLS .secret .name
Name is the name of the secret.
- string
.spec .egress[] .toPorts[] .originatingTLS .secret .namespace
Namespace is the namespace in which the secret exists. Context of use determines the default value if left out (e.g., “default”).
- string
.spec .egress[] .toPorts[] .originatingTLS .trustedCA
TrustedCA is the file name or k8s secret item name for the trusted CA. If omitted, ‘ca.crt’ is assumed, if it exists. If given, the item must exist.
- array
.spec .egress[] .toPorts[] .ports
Ports is a list of L4 port/protocol
- integer
.spec .egress[] .toPorts[] .ports[] .endPort
EndPort can only be an L4 port number.
- string required
.spec .egress[] .toPorts[] .ports[] .port
Port can be an L4 port number, or a name in the form of “http” or “http-8080”.
- string
.spec .egress[] .toPorts[] .ports[] .protocol
Protocol is the L4 protocol. If omitted or empty, any protocol matches. Accepted values: “TCP”, “UDP”, “SCTP”, “ANY”
Matching on ICMP is not supported.
Named port specified for a container may narrow this down, but may not contradict this.
- object
.spec .egress[] .toPorts[] .rules
Rules is a list of additional port level rules which must be met in order for the PortRule to allow the traffic. If omitted or empty, no layer 7 rules are enforced.
- array
.spec .egress[] .toPorts[] .rules .dns
DNS-specific rules.
- string
.spec .egress[] .toPorts[] .rules .dns[] .matchName
MatchName matches literal DNS names. A trailing “.” is automatically added when missing.
- string
.spec .egress[] .toPorts[] .rules .dns[] .matchPattern
MatchPattern allows using wildcards to match DNS names. All wildcards are case insensitive. The wildcards are:
- “” matches 0 or more DNS valid characters, and may occur anywhere in the pattern. As a special case a “” as the leftmost character, without a following “.” matches all subdomains as well as the name to the right. A trailing “.” is automatically added when missing.
Examples:
*.cilium.io
matches subdomains of cilium at that level www.cilium.io and blog.cilium.io match, cilium.io and google.com do not*cilium.io
matches cilium.io and all subdomains ends with “cilium.io” except those containing “.” separator, subcilium.io and sub-cilium.io match, www.cilium.io and blog.cilium.io does not sub*.cilium.io matches subdomains of cilium where the subdomain component begins with “sub” sub.cilium.io and subdomain.cilium.io match, www.cilium.io, blog.cilium.io, cilium.io and google.com do not - array
.spec .egress[] .toPorts[] .rules .http
HTTP specific rules.
- array
.spec .egress[] .toPorts[] .rules .http[] .headerMatches
HeaderMatches is a list of HTTP headers which must be present and match against the given values. Mismatch field can be used to specify what to do when there is no match.
- string
.spec .egress[] .toPorts[] .rules .http[] .headerMatches[] .mismatch
Mismatch identifies what to do in case there is no match. The default is to drop the request. Otherwise the overall rule is still considered as matching, but the mismatches are logged in the access log.
- string required
.spec .egress[] .toPorts[] .rules .http[] .headerMatches[] .name
Name identifies the header.
- object
.spec .egress[] .toPorts[] .rules .http[] .headerMatches[] .secret
Secret refers to a secret that contains the value to be matched against. The secret must only contain one entry. If the referred secret does not exist, and there is no “Value” specified, the match will fail.
- string required
.spec .egress[] .toPorts[] .rules .http[] .headerMatches[] .secret .name
Name is the name of the secret.
- string
.spec .egress[] .toPorts[] .rules .http[] .headerMatches[] .secret .namespace
Namespace is the namespace in which the secret exists. Context of use determines the default value if left out (e.g., “default”).
- string
.spec .egress[] .toPorts[] .rules .http[] .headerMatches[] .value
Value matches the exact value of the header. Can be specified either alone or together with “Secret”; will be used as the header value if the secret can not be found in the latter case.
- array
.spec .egress[] .toPorts[] .rules .http[] .headers
Headers is a list of HTTP headers which must be present in the request. If omitted or empty, requests are allowed regardless of headers present.
- string
.spec .egress[] .toPorts[] .rules .http[] .host
Host is an extended POSIX regex matched against the host header of a request. Examples:
- foo.bar.com will match the host fooXbar.com or foo-bar.com
- foo.bar.com will only match the host foo.bar.com
If omitted or empty, the value of the host header is ignored.
- string
.spec .egress[] .toPorts[] .rules .http[] .method
Method is an extended POSIX regex matched against the method of a request, e.g. “GET”, “POST”, “PUT”, “PATCH”, “DELETE”, …
If omitted or empty, all methods are allowed.
- string
.spec .egress[] .toPorts[] .rules .http[] .path
Path is an extended POSIX regex matched against the path of a request. Currently it can contain characters disallowed from the conventional “path” part of a URL as defined by RFC 3986.
If omitted or empty, all paths are all allowed.
- array
.spec .egress[] .toPorts[] .rules .kafka
Kafka-specific rules.
- string
.spec .egress[] .toPorts[] .rules .kafka[] .apiKey
APIKey is a case-insensitive string matched against the key of a request, e.g. “produce”, “fetch”, “createtopic”, “deletetopic”, et al Reference: https://kafka.apache.org/protocol#protocol_api_keys
If omitted or empty, and if Role is not specified, then all keys are allowed.
- string
.spec .egress[] .toPorts[] .rules .kafka[] .apiVersion
APIVersion is the version matched against the api version of the Kafka message. If set, it has to be a string representing a positive integer.
If omitted or empty, all versions are allowed.
- string
.spec .egress[] .toPorts[] .rules .kafka[] .clientID
ClientID is the client identifier as provided in the request.
From Kafka protocol documentation: This is a user supplied identifier for the client application. The user can use any identifier they like and it will be used when logging errors, monitoring aggregates, etc. For example, one might want to monitor not just the requests per second overall, but the number coming from each client application (each of which could reside on multiple servers). This id acts as a logical grouping across all requests from a particular client.
If omitted or empty, all client identifiers are allowed.
- string
.spec .egress[] .toPorts[] .rules .kafka[] .role
Role is a case-insensitive string and describes a group of API keys necessary to perform certain higher-level Kafka operations such as “produce” or “consume”. A Role automatically expands into all APIKeys required to perform the specified higher-level operation.
The following values are supported:
- “produce”: Allow producing to the topics specified in the rule
- “consume”: Allow consuming from the topics specified in the rule
This field is incompatible with the APIKey field, i.e APIKey and Role cannot both be specified in the same rule.
If omitted or empty, and if APIKey is not specified, then all keys are allowed.
- string
.spec .egress[] .toPorts[] .rules .kafka[] .topic
Topic is the topic name contained in the message. If a Kafka request contains multiple topics, then all topics must be allowed or the message will be rejected.
This constraint is ignored if the matched request message type doesn’t contain any topic. Maximum size of Topic can be 249 characters as per recent Kafka spec and allowed characters are a-z, A-Z, 0-9, -, . and _.
Older Kafka versions had longer topic lengths of 255, but in Kafka 0.10 version the length was changed from 255 to 249. For compatibility reasons we are using 255.
If omitted or empty, all topics are allowed.
- array
.spec .egress[] .toPorts[] .rules .l7
Key-value pair rules.
- string
.spec .egress[] .toPorts[] .rules .l7proto
Name of the L7 protocol for which the Key-value pair rules apply.
- array
.spec .egress[] .toPorts[] .serverNames
ServerNames is a list of allowed TLS SNI values. If not empty, then TLS must be present and one of the provided SNIs must be indicated in the TLS handshake.
- object
.spec .egress[] .toPorts[] .terminatingTLS
TerminatingTLS is the TLS context for the connection terminated by the L7 proxy. For egress policy this specifies the server-side TLS parameters to be applied on the connections originated from the local endpoint and terminated by the L7 proxy. For ingress policy this specifies the server-side TLS parameters to be applied on the connections originated from a remote source and terminated by the L7 proxy.
- string
.spec .egress[] .toPorts[] .terminatingTLS .certificate
Certificate is the file name or k8s secret item name for the certificate chain. If omitted, ‘tls.crt’ is assumed, if it exists. If given, the item must exist.
- string
.spec .egress[] .toPorts[] .terminatingTLS .privateKey
PrivateKey is the file name or k8s secret item name for the private key matching the certificate chain. If omitted, ‘tls.key’ is assumed, if it exists. If given, the item must exist.
- object required
.spec .egress[] .toPorts[] .terminatingTLS .secret
Secret is the secret that contains the certificates and private key for the TLS context. By default, Cilium will search in this secret for the following items:
- ‘ca.crt’ - Which represents the trusted CA to verify remote source.
- ‘tls.crt’ - Which represents the public key certificate.
- ‘tls.key’ - Which represents the private key matching the public key certificate.
- string required
.spec .egress[] .toPorts[] .terminatingTLS .secret .name
Name is the name of the secret.
- string
.spec .egress[] .toPorts[] .terminatingTLS .secret .namespace
Namespace is the namespace in which the secret exists. Context of use determines the default value if left out (e.g., “default”).
- string
.spec .egress[] .toPorts[] .terminatingTLS .trustedCA
TrustedCA is the file name or k8s secret item name for the trusted CA. If omitted, ‘ca.crt’ is assumed, if it exists. If given, the item must exist.
- array
.spec .egress[] .toRequires
ToRequires is a list of additional constraints which must be met in order for the selected endpoints to be able to connect to other endpoints. These additional constraints do no by itself grant access privileges and must always be accompanied with at least one matching ToEndpoints.
Example: Any Endpoint with the label “team=A” requires any endpoint to which it communicates to also carry the label “team=A”.
- array
.spec .egress[] .toRequires[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .egress[] .toRequires[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .egress[] .toRequires[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .egress[] .toRequires[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .egress[] .toRequires[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.spec .egress[] .toServices
ToServices is a list of services to which the endpoint subject to the rule is allowed to initiate connections. Currently Cilium only supports toServices for K8s services.
- object
.spec .egress[] .toServices[] .k8sService
K8sService selects service by name and namespace pair
- string
.spec .egress[] .toServices[] .k8sService .namespace
- string
.spec .egress[] .toServices[] .k8sService .serviceName
- object
.spec .egress[] .toServices[] .k8sServiceSelector
K8sServiceSelector selects services by k8s labels and namespace
- string
.spec .egress[] .toServices[] .k8sServiceSelector .namespace
- object required
.spec .egress[] .toServices[] .k8sServiceSelector .selector
ServiceSelector is a label selector for k8s services
- array
.spec .egress[] .toServices[] .k8sServiceSelector .selector .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .egress[] .toServices[] .k8sServiceSelector .selector .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .egress[] .toServices[] .k8sServiceSelector .selector .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .egress[] .toServices[] .k8sServiceSelector .selector .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .egress[] .toServices[] .k8sServiceSelector .selector .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.spec .egressDeny
EgressDeny is a list of EgressDenyRule which are enforced at egress. Any rule inserted here will be denied regardless of the allowed egress rules in the ‘egress’ field. If omitted or empty, this rule does not apply at egress.
- array
.spec .egressDeny[] .icmps
ICMPs is a list of ICMP rule identified by type number which the endpoint subject to the rule is not allowed to connect to.
Example: Any endpoint with the label “app=httpd” is not allowed to initiate type 8 ICMP connections.
- array
.spec .egressDeny[] .icmps[] .fields
Fields is a list of ICMP fields.
- string
.spec .egressDeny[] .icmps[] .fields[] .family
Family is a IP address version. Currently, we support
IPv4
andIPv6
.IPv4
is set as default. - integer | string required
.spec .egressDeny[] .icmps[] .fields[] .type
Type is a ICMP-type. It should be an 8bit code (0-255), or it’s CamelCase name (for example, “EchoReply”). Allowed ICMP types are: Ipv4: EchoReply | DestinationUnreachable | Redirect | Echo | EchoRequest | RouterAdvertisement | RouterSelection | TimeExceeded | ParameterProblem | Timestamp | TimestampReply | Photuris | ExtendedEcho Request | ExtendedEcho Reply Ipv6: DestinationUnreachable | PacketTooBig | TimeExceeded | ParameterProblem | EchoRequest | EchoReply | MulticastListenerQuery| MulticastListenerReport | MulticastListenerDone | RouterSolicitation | RouterAdvertisement | NeighborSolicitation | NeighborAdvertisement | RedirectMessage | RouterRenumbering | ICMPNodeInformationQuery | ICMPNodeInformationResponse | InverseNeighborDiscoverySolicitation | InverseNeighborDiscoveryAdvertisement | HomeAgentAddressDiscoveryRequest | HomeAgentAddressDiscoveryReply | MobilePrefixSolicitation | MobilePrefixAdvertisement | DuplicateAddressRequestCodeSuffix | DuplicateAddressConfirmationCodeSuffix | ExtendedEchoRequest | ExtendedEchoReply
- array
.spec .egressDeny[] .toCIDR
ToCIDR is a list of IP blocks which the endpoint subject to the rule is allowed to initiate connections. Only connections destined for outside of the cluster and not targeting the host will be subject to CIDR rules. This will match on the destination IP address of outgoing connections. Adding a prefix into ToCIDR or into ToCIDRSet with no ExcludeCIDRs is equivalent. Overlaps are allowed between ToCIDR and ToCIDRSet.
Example: Any endpoint with the label “app=database-proxy” is allowed to initiate connections to 10.2.3.0/24
- array
.spec .egressDeny[] .toCIDRSet
ToCIDRSet is a list of IP blocks which the endpoint subject to the rule is allowed to initiate connections to in addition to connections which are allowed via ToEndpoints, along with a list of subnets contained within their corresponding IP block to which traffic should not be allowed. This will match on the destination IP address of outgoing connections. Adding a prefix into ToCIDR or into ToCIDRSet with no ExcludeCIDRs is equivalent. Overlaps are allowed between ToCIDR and ToCIDRSet.
Example: Any endpoint with the label “app=database-proxy” is allowed to initiate connections to 10.2.3.0/24 except from IPs in subnet 10.2.3.0/28.
- string
.spec .egressDeny[] .toCIDRSet[] .cidr
CIDR is a CIDR prefix / IP Block.
- string
.spec .egressDeny[] .toCIDRSet[] .cidrGroupRef
CIDRGroupRef is a reference to a CiliumCIDRGroup object. A CiliumCIDRGroup contains a list of CIDRs that the endpoint, subject to the rule, can (Ingress/Egress) or cannot (IngressDeny/EgressDeny) receive connections from.
- object
.spec .egressDeny[] .toCIDRSet[] .cidrGroupSelector
CIDRGroupSelector selects CiliumCIDRGroups by their labels, rather than by name.
- array
.spec .egressDeny[] .toCIDRSet[] .cidrGroupSelector .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .egressDeny[] .toCIDRSet[] .cidrGroupSelector .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .egressDeny[] .toCIDRSet[] .cidrGroupSelector .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .egressDeny[] .toCIDRSet[] .cidrGroupSelector .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .egressDeny[] .toCIDRSet[] .cidrGroupSelector .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.spec .egressDeny[] .toCIDRSet[] .except
ExceptCIDRs is a list of IP blocks which the endpoint subject to the rule is not allowed to initiate connections to. These CIDR prefixes should be contained within Cidr, using ExceptCIDRs together with CIDRGroupRef is not supported yet. These exceptions are only applied to the Cidr in this CIDRRule, and do not apply to any other CIDR prefixes in any other CIDRRules.
- array
.spec .egressDeny[] .toEndpoints
ToEndpoints is a list of endpoints identified by an EndpointSelector to which the endpoints subject to the rule are allowed to communicate.
Example: Any endpoint with the label “role=frontend” can communicate with any endpoint carrying the label “role=backend”.
- array
.spec .egressDeny[] .toEndpoints[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .egressDeny[] .toEndpoints[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .egressDeny[] .toEndpoints[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .egressDeny[] .toEndpoints[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .egressDeny[] .toEndpoints[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.spec .egressDeny[] .toEntities
ToEntities is a list of special entities to which the endpoint subject to the rule is allowed to initiate connections. Supported entities are
world
,cluster
,host
,remote-node
,kube-apiserver
,init
,health
,unmanaged
andall
. - array
.spec .egressDeny[] .toGroups
ToGroups is a directive that allows the integration with multiple outside providers. Currently, only AWS is supported, and the rule can select by multiple sub directives:
Example: toGroups:
- aws:
securityGroupsIds:
- ‘sg-XXXXXXXXXXXXX’
- aws:
securityGroupsIds:
- object
.spec .egressDeny[] .toGroups[] .aws
AWSGroup is an structure that can be used to whitelisting information from AWS integration
- object
.spec .egressDeny[] .toGroups[] .aws .labels
- string
.spec .egressDeny[] .toGroups[] .aws .region
- array
.spec .egressDeny[] .toGroups[] .aws .securityGroupsIds
- array
.spec .egressDeny[] .toGroups[] .aws .securityGroupsNames
- array
.spec .egressDeny[] .toNodes
ToNodes is a list of nodes identified by an EndpointSelector to which endpoints subject to the rule is allowed to communicate.
- array
.spec .egressDeny[] .toNodes[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .egressDeny[] .toNodes[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .egressDeny[] .toNodes[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .egressDeny[] .toNodes[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .egressDeny[] .toNodes[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.spec .egressDeny[] .toPorts
ToPorts is a list of destination ports identified by port number and protocol which the endpoint subject to the rule is not allowed to connect to.
Example: Any endpoint with the label “role=frontend” is not allowed to initiate connections to destination port 8080/tcp
- array
.spec .egressDeny[] .toPorts[] .ports
Ports is a list of L4 port/protocol
- integer
.spec .egressDeny[] .toPorts[] .ports[] .endPort
EndPort can only be an L4 port number.
- string required
.spec .egressDeny[] .toPorts[] .ports[] .port
Port can be an L4 port number, or a name in the form of “http” or “http-8080”.
- string
.spec .egressDeny[] .toPorts[] .ports[] .protocol
Protocol is the L4 protocol. If omitted or empty, any protocol matches. Accepted values: “TCP”, “UDP”, “SCTP”, “ANY”
Matching on ICMP is not supported.
Named port specified for a container may narrow this down, but may not contradict this.
- array
.spec .egressDeny[] .toRequires
ToRequires is a list of additional constraints which must be met in order for the selected endpoints to be able to connect to other endpoints. These additional constraints do no by itself grant access privileges and must always be accompanied with at least one matching ToEndpoints.
Example: Any Endpoint with the label “team=A” requires any endpoint to which it communicates to also carry the label “team=A”.
- array
.spec .egressDeny[] .toRequires[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .egressDeny[] .toRequires[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .egressDeny[] .toRequires[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .egressDeny[] .toRequires[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .egressDeny[] .toRequires[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.spec .egressDeny[] .toServices
ToServices is a list of services to which the endpoint subject to the rule is allowed to initiate connections. Currently Cilium only supports toServices for K8s services.
- object
.spec .egressDeny[] .toServices[] .k8sService
K8sService selects service by name and namespace pair
- string
.spec .egressDeny[] .toServices[] .k8sService .namespace
- string
.spec .egressDeny[] .toServices[] .k8sService .serviceName
- object
.spec .egressDeny[] .toServices[] .k8sServiceSelector
K8sServiceSelector selects services by k8s labels and namespace
- string
.spec .egressDeny[] .toServices[] .k8sServiceSelector .namespace
- object required
.spec .egressDeny[] .toServices[] .k8sServiceSelector .selector
ServiceSelector is a label selector for k8s services
- array
.spec .egressDeny[] .toServices[] .k8sServiceSelector .selector .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .egressDeny[] .toServices[] .k8sServiceSelector .selector .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .egressDeny[] .toServices[] .k8sServiceSelector .selector .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .egressDeny[] .toServices[] .k8sServiceSelector .selector .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .egressDeny[] .toServices[] .k8sServiceSelector .selector .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- object
.spec .enableDefaultDeny
EnableDefaultDeny determines whether this policy configures the subject endpoint(s) to have a default deny mode. If enabled, this causes all traffic not explicitly allowed by a network policy to be dropped.
If not specified, the default is true for each traffic direction that has rules, and false otherwise. For example, if a policy only has Ingress or IngressDeny rules, then the default for ingress is true and egress is false.
If multiple policies apply to an endpoint, that endpoint’s default deny will be enabled if any policy requests it.
This is useful for creating broad-based network policies that will not cause endpoints to enter default-deny mode.
- boolean
.spec .enableDefaultDeny .egress
Whether or not the endpoint should have a default-deny rule applied to egress traffic.
- boolean
.spec .enableDefaultDeny .ingress
Whether or not the endpoint should have a default-deny rule applied to ingress traffic.
- object
.spec .endpointSelector
EndpointSelector selects all endpoints which should be subject to this rule. EndpointSelector and NodeSelector cannot be both empty and are mutually exclusive.
- array
.spec .endpointSelector .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .endpointSelector .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .endpointSelector .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .endpointSelector .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .endpointSelector .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.spec .ingress
Ingress is a list of IngressRule which are enforced at ingress. If omitted or empty, this rule does not apply at ingress.
- object
.spec .ingress[] .authentication
Authentication is the required authentication type for the allowed traffic, if any.
- string required
.spec .ingress[] .authentication .mode
Mode is the required authentication mode for the allowed traffic, if any.
- array
.spec .ingress[] .fromCIDR
FromCIDR is a list of IP blocks which the endpoint subject to the rule is allowed to receive connections from. Only connections which do not originate from the cluster or from the local host are subject to CIDR rules. In order to allow in-cluster connectivity, use the FromEndpoints field. This will match on the source IP address of incoming connections. Adding a prefix into FromCIDR or into FromCIDRSet with no ExcludeCIDRs is equivalent. Overlaps are allowed between FromCIDR and FromCIDRSet.
Example: Any endpoint with the label “app=my-legacy-pet” is allowed to receive connections from 10.3.9.1
- array
.spec .ingress[] .fromCIDRSet
FromCIDRSet is a list of IP blocks which the endpoint subject to the rule is allowed to receive connections from in addition to FromEndpoints, along with a list of subnets contained within their corresponding IP block from which traffic should not be allowed. This will match on the source IP address of incoming connections. Adding a prefix into FromCIDR or into FromCIDRSet with no ExcludeCIDRs is equivalent. Overlaps are allowed between FromCIDR and FromCIDRSet.
Example: Any endpoint with the label “app=my-legacy-pet” is allowed to receive connections from 10.0.0.0/8 except from IPs in subnet 10.96.0.0/12.
- string
.spec .ingress[] .fromCIDRSet[] .cidr
CIDR is a CIDR prefix / IP Block.
- string
.spec .ingress[] .fromCIDRSet[] .cidrGroupRef
CIDRGroupRef is a reference to a CiliumCIDRGroup object. A CiliumCIDRGroup contains a list of CIDRs that the endpoint, subject to the rule, can (Ingress/Egress) or cannot (IngressDeny/EgressDeny) receive connections from.
- object
.spec .ingress[] .fromCIDRSet[] .cidrGroupSelector
CIDRGroupSelector selects CiliumCIDRGroups by their labels, rather than by name.
- array
.spec .ingress[] .fromCIDRSet[] .cidrGroupSelector .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .ingress[] .fromCIDRSet[] .cidrGroupSelector .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .ingress[] .fromCIDRSet[] .cidrGroupSelector .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .ingress[] .fromCIDRSet[] .cidrGroupSelector .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .ingress[] .fromCIDRSet[] .cidrGroupSelector .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.spec .ingress[] .fromCIDRSet[] .except
ExceptCIDRs is a list of IP blocks which the endpoint subject to the rule is not allowed to initiate connections to. These CIDR prefixes should be contained within Cidr, using ExceptCIDRs together with CIDRGroupRef is not supported yet. These exceptions are only applied to the Cidr in this CIDRRule, and do not apply to any other CIDR prefixes in any other CIDRRules.
- array
.spec .ingress[] .fromEndpoints
FromEndpoints is a list of endpoints identified by an EndpointSelector which are allowed to communicate with the endpoint subject to the rule.
Example: Any endpoint with the label “role=backend” can be consumed by any endpoint carrying the label “role=frontend”.
- array
.spec .ingress[] .fromEndpoints[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .ingress[] .fromEndpoints[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .ingress[] .fromEndpoints[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .ingress[] .fromEndpoints[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .ingress[] .fromEndpoints[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.spec .ingress[] .fromEntities
FromEntities is a list of special entities which the endpoint subject to the rule is allowed to receive connections from. Supported entities are
world
,cluster
andhost
- array
.spec .ingress[] .fromGroups
FromGroups is a directive that allows the integration with multiple outside providers. Currently, only AWS is supported, and the rule can select by multiple sub directives:
Example: FromGroups:
- aws:
securityGroupsIds:
- ‘sg-XXXXXXXXXXXXX’
- aws:
securityGroupsIds:
- object
.spec .ingress[] .fromGroups[] .aws
AWSGroup is an structure that can be used to whitelisting information from AWS integration
- object
.spec .ingress[] .fromGroups[] .aws .labels
- string
.spec .ingress[] .fromGroups[] .aws .region
- array
.spec .ingress[] .fromGroups[] .aws .securityGroupsIds
- array
.spec .ingress[] .fromGroups[] .aws .securityGroupsNames
- array
.spec .ingress[] .fromNodes
FromNodes is a list of nodes identified by an EndpointSelector which are allowed to communicate with the endpoint subject to the rule.
- array
.spec .ingress[] .fromNodes[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .ingress[] .fromNodes[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .ingress[] .fromNodes[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .ingress[] .fromNodes[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .ingress[] .fromNodes[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.spec .ingress[] .fromRequires
FromRequires is a list of additional constraints which must be met in order for the selected endpoints to be reachable. These additional constraints do no by itself grant access privileges and must always be accompanied with at least one matching FromEndpoints.
Example: Any Endpoint with the label “team=A” requires consuming endpoint to also carry the label “team=A”.
- array
.spec .ingress[] .fromRequires[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .ingress[] .fromRequires[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .ingress[] .fromRequires[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .ingress[] .fromRequires[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .ingress[] .fromRequires[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.spec .ingress[] .icmps
ICMPs is a list of ICMP rule identified by type number which the endpoint subject to the rule is allowed to receive connections on.
Example: Any endpoint with the label “app=httpd” can only accept incoming type 8 ICMP connections.
- array
.spec .ingress[] .icmps[] .fields
Fields is a list of ICMP fields.
- string
.spec .ingress[] .icmps[] .fields[] .family
Family is a IP address version. Currently, we support
IPv4
andIPv6
.IPv4
is set as default. - integer | string required
.spec .ingress[] .icmps[] .fields[] .type
Type is a ICMP-type. It should be an 8bit code (0-255), or it’s CamelCase name (for example, “EchoReply”). Allowed ICMP types are: Ipv4: EchoReply | DestinationUnreachable | Redirect | Echo | EchoRequest | RouterAdvertisement | RouterSelection | TimeExceeded | ParameterProblem | Timestamp | TimestampReply | Photuris | ExtendedEcho Request | ExtendedEcho Reply Ipv6: DestinationUnreachable | PacketTooBig | TimeExceeded | ParameterProblem | EchoRequest | EchoReply | MulticastListenerQuery| MulticastListenerReport | MulticastListenerDone | RouterSolicitation | RouterAdvertisement | NeighborSolicitation | NeighborAdvertisement | RedirectMessage | RouterRenumbering | ICMPNodeInformationQuery | ICMPNodeInformationResponse | InverseNeighborDiscoverySolicitation | InverseNeighborDiscoveryAdvertisement | HomeAgentAddressDiscoveryRequest | HomeAgentAddressDiscoveryReply | MobilePrefixSolicitation | MobilePrefixAdvertisement | DuplicateAddressRequestCodeSuffix | DuplicateAddressConfirmationCodeSuffix | ExtendedEchoRequest | ExtendedEchoReply
- array
.spec .ingress[] .toPorts
ToPorts is a list of destination ports identified by port number and protocol which the endpoint subject to the rule is allowed to receive connections on.
Example: Any endpoint with the label “app=httpd” can only accept incoming connections on port 80/tcp.
- object
.spec .ingress[] .toPorts[] .listener
listener specifies the name of a custom Envoy listener to which this traffic should be redirected to.
- object required
.spec .ingress[] .toPorts[] .listener .envoyConfig
EnvoyConfig is a reference to the CEC or CCEC resource in which the listener is defined.
- string
.spec .ingress[] .toPorts[] .listener .envoyConfig .kind
Kind is the resource type being referred to. Defaults to CiliumEnvoyConfig or CiliumClusterwideEnvoyConfig for CiliumNetworkPolicy and CiliumClusterwideNetworkPolicy, respectively. The only case this is currently explicitly needed is when referring to a CiliumClusterwideEnvoyConfig from CiliumNetworkPolicy, as using a namespaced listener from a cluster scoped policy is not allowed.
- string required
.spec .ingress[] .toPorts[] .listener .envoyConfig .name
Name is the resource name of the CiliumEnvoyConfig or CiliumClusterwideEnvoyConfig where the listener is defined in.
- string required
.spec .ingress[] .toPorts[] .listener .name
Name is the name of the listener.
- integer
.spec .ingress[] .toPorts[] .listener .priority
Priority for this Listener that is used when multiple rules would apply different listeners to a policy map entry. Behavior of this is implementation dependent.
- object
.spec .ingress[] .toPorts[] .originatingTLS
OriginatingTLS is the TLS context for the connections originated by the L7 proxy. For egress policy this specifies the client-side TLS parameters for the upstream connection originating from the L7 proxy to the remote destination. For ingress policy this specifies the client-side TLS parameters for the connection from the L7 proxy to the local endpoint.
- string
.spec .ingress[] .toPorts[] .originatingTLS .certificate
Certificate is the file name or k8s secret item name for the certificate chain. If omitted, ‘tls.crt’ is assumed, if it exists. If given, the item must exist.
- string
.spec .ingress[] .toPorts[] .originatingTLS .privateKey
PrivateKey is the file name or k8s secret item name for the private key matching the certificate chain. If omitted, ‘tls.key’ is assumed, if it exists. If given, the item must exist.
- object required
.spec .ingress[] .toPorts[] .originatingTLS .secret
Secret is the secret that contains the certificates and private key for the TLS context. By default, Cilium will search in this secret for the following items:
- ‘ca.crt’ - Which represents the trusted CA to verify remote source.
- ‘tls.crt’ - Which represents the public key certificate.
- ‘tls.key’ - Which represents the private key matching the public key certificate.
- string required
.spec .ingress[] .toPorts[] .originatingTLS .secret .name
Name is the name of the secret.
- string
.spec .ingress[] .toPorts[] .originatingTLS .secret .namespace
Namespace is the namespace in which the secret exists. Context of use determines the default value if left out (e.g., “default”).
- string
.spec .ingress[] .toPorts[] .originatingTLS .trustedCA
TrustedCA is the file name or k8s secret item name for the trusted CA. If omitted, ‘ca.crt’ is assumed, if it exists. If given, the item must exist.
- array
.spec .ingress[] .toPorts[] .ports
Ports is a list of L4 port/protocol
- integer
.spec .ingress[] .toPorts[] .ports[] .endPort
EndPort can only be an L4 port number.
- string required
.spec .ingress[] .toPorts[] .ports[] .port
Port can be an L4 port number, or a name in the form of “http” or “http-8080”.
- string
.spec .ingress[] .toPorts[] .ports[] .protocol
Protocol is the L4 protocol. If omitted or empty, any protocol matches. Accepted values: “TCP”, “UDP”, “SCTP”, “ANY”
Matching on ICMP is not supported.
Named port specified for a container may narrow this down, but may not contradict this.
- object
.spec .ingress[] .toPorts[] .rules
Rules is a list of additional port level rules which must be met in order for the PortRule to allow the traffic. If omitted or empty, no layer 7 rules are enforced.
- array
.spec .ingress[] .toPorts[] .rules .dns
DNS-specific rules.
- string
.spec .ingress[] .toPorts[] .rules .dns[] .matchName
MatchName matches literal DNS names. A trailing “.” is automatically added when missing.
- string
.spec .ingress[] .toPorts[] .rules .dns[] .matchPattern
MatchPattern allows using wildcards to match DNS names. All wildcards are case insensitive. The wildcards are:
- “” matches 0 or more DNS valid characters, and may occur anywhere in the pattern. As a special case a “” as the leftmost character, without a following “.” matches all subdomains as well as the name to the right. A trailing “.” is automatically added when missing.
Examples:
*.cilium.io
matches subdomains of cilium at that level www.cilium.io and blog.cilium.io match, cilium.io and google.com do not*cilium.io
matches cilium.io and all subdomains ends with “cilium.io” except those containing “.” separator, subcilium.io and sub-cilium.io match, www.cilium.io and blog.cilium.io does not sub*.cilium.io matches subdomains of cilium where the subdomain component begins with “sub” sub.cilium.io and subdomain.cilium.io match, www.cilium.io, blog.cilium.io, cilium.io and google.com do not - array
.spec .ingress[] .toPorts[] .rules .http
HTTP specific rules.
- array
.spec .ingress[] .toPorts[] .rules .http[] .headerMatches
HeaderMatches is a list of HTTP headers which must be present and match against the given values. Mismatch field can be used to specify what to do when there is no match.
- string
.spec .ingress[] .toPorts[] .rules .http[] .headerMatches[] .mismatch
Mismatch identifies what to do in case there is no match. The default is to drop the request. Otherwise the overall rule is still considered as matching, but the mismatches are logged in the access log.
- string required
.spec .ingress[] .toPorts[] .rules .http[] .headerMatches[] .name
Name identifies the header.
- object
.spec .ingress[] .toPorts[] .rules .http[] .headerMatches[] .secret
Secret refers to a secret that contains the value to be matched against. The secret must only contain one entry. If the referred secret does not exist, and there is no “Value” specified, the match will fail.
- string required
.spec .ingress[] .toPorts[] .rules .http[] .headerMatches[] .secret .name
Name is the name of the secret.
- string
.spec .ingress[] .toPorts[] .rules .http[] .headerMatches[] .secret .namespace
Namespace is the namespace in which the secret exists. Context of use determines the default value if left out (e.g., “default”).
- string
.spec .ingress[] .toPorts[] .rules .http[] .headerMatches[] .value
Value matches the exact value of the header. Can be specified either alone or together with “Secret”; will be used as the header value if the secret can not be found in the latter case.
- array
.spec .ingress[] .toPorts[] .rules .http[] .headers
Headers is a list of HTTP headers which must be present in the request. If omitted or empty, requests are allowed regardless of headers present.
- string
.spec .ingress[] .toPorts[] .rules .http[] .host
Host is an extended POSIX regex matched against the host header of a request. Examples:
- foo.bar.com will match the host fooXbar.com or foo-bar.com
- foo.bar.com will only match the host foo.bar.com
If omitted or empty, the value of the host header is ignored.
- string
.spec .ingress[] .toPorts[] .rules .http[] .method
Method is an extended POSIX regex matched against the method of a request, e.g. “GET”, “POST”, “PUT”, “PATCH”, “DELETE”, …
If omitted or empty, all methods are allowed.
- string
.spec .ingress[] .toPorts[] .rules .http[] .path
Path is an extended POSIX regex matched against the path of a request. Currently it can contain characters disallowed from the conventional “path” part of a URL as defined by RFC 3986.
If omitted or empty, all paths are all allowed.
- array
.spec .ingress[] .toPorts[] .rules .kafka
Kafka-specific rules.
- string
.spec .ingress[] .toPorts[] .rules .kafka[] .apiKey
APIKey is a case-insensitive string matched against the key of a request, e.g. “produce”, “fetch”, “createtopic”, “deletetopic”, et al Reference: https://kafka.apache.org/protocol#protocol_api_keys
If omitted or empty, and if Role is not specified, then all keys are allowed.
- string
.spec .ingress[] .toPorts[] .rules .kafka[] .apiVersion
APIVersion is the version matched against the api version of the Kafka message. If set, it has to be a string representing a positive integer.
If omitted or empty, all versions are allowed.
- string
.spec .ingress[] .toPorts[] .rules .kafka[] .clientID
ClientID is the client identifier as provided in the request.
From Kafka protocol documentation: This is a user supplied identifier for the client application. The user can use any identifier they like and it will be used when logging errors, monitoring aggregates, etc. For example, one might want to monitor not just the requests per second overall, but the number coming from each client application (each of which could reside on multiple servers). This id acts as a logical grouping across all requests from a particular client.
If omitted or empty, all client identifiers are allowed.
- string
.spec .ingress[] .toPorts[] .rules .kafka[] .role
Role is a case-insensitive string and describes a group of API keys necessary to perform certain higher-level Kafka operations such as “produce” or “consume”. A Role automatically expands into all APIKeys required to perform the specified higher-level operation.
The following values are supported:
- “produce”: Allow producing to the topics specified in the rule
- “consume”: Allow consuming from the topics specified in the rule
This field is incompatible with the APIKey field, i.e APIKey and Role cannot both be specified in the same rule.
If omitted or empty, and if APIKey is not specified, then all keys are allowed.
- string
.spec .ingress[] .toPorts[] .rules .kafka[] .topic
Topic is the topic name contained in the message. If a Kafka request contains multiple topics, then all topics must be allowed or the message will be rejected.
This constraint is ignored if the matched request message type doesn’t contain any topic. Maximum size of Topic can be 249 characters as per recent Kafka spec and allowed characters are a-z, A-Z, 0-9, -, . and _.
Older Kafka versions had longer topic lengths of 255, but in Kafka 0.10 version the length was changed from 255 to 249. For compatibility reasons we are using 255.
If omitted or empty, all topics are allowed.
- array
.spec .ingress[] .toPorts[] .rules .l7
Key-value pair rules.
- string
.spec .ingress[] .toPorts[] .rules .l7proto
Name of the L7 protocol for which the Key-value pair rules apply.
- array
.spec .ingress[] .toPorts[] .serverNames
ServerNames is a list of allowed TLS SNI values. If not empty, then TLS must be present and one of the provided SNIs must be indicated in the TLS handshake.
- object
.spec .ingress[] .toPorts[] .terminatingTLS
TerminatingTLS is the TLS context for the connection terminated by the L7 proxy. For egress policy this specifies the server-side TLS parameters to be applied on the connections originated from the local endpoint and terminated by the L7 proxy. For ingress policy this specifies the server-side TLS parameters to be applied on the connections originated from a remote source and terminated by the L7 proxy.
- string
.spec .ingress[] .toPorts[] .terminatingTLS .certificate
Certificate is the file name or k8s secret item name for the certificate chain. If omitted, ‘tls.crt’ is assumed, if it exists. If given, the item must exist.
- string
.spec .ingress[] .toPorts[] .terminatingTLS .privateKey
PrivateKey is the file name or k8s secret item name for the private key matching the certificate chain. If omitted, ‘tls.key’ is assumed, if it exists. If given, the item must exist.
- object required
.spec .ingress[] .toPorts[] .terminatingTLS .secret
Secret is the secret that contains the certificates and private key for the TLS context. By default, Cilium will search in this secret for the following items:
- ‘ca.crt’ - Which represents the trusted CA to verify remote source.
- ‘tls.crt’ - Which represents the public key certificate.
- ‘tls.key’ - Which represents the private key matching the public key certificate.
- string required
.spec .ingress[] .toPorts[] .terminatingTLS .secret .name
Name is the name of the secret.
- string
.spec .ingress[] .toPorts[] .terminatingTLS .secret .namespace
Namespace is the namespace in which the secret exists. Context of use determines the default value if left out (e.g., “default”).
- string
.spec .ingress[] .toPorts[] .terminatingTLS .trustedCA
TrustedCA is the file name or k8s secret item name for the trusted CA. If omitted, ‘ca.crt’ is assumed, if it exists. If given, the item must exist.
- array
.spec .ingressDeny
IngressDeny is a list of IngressDenyRule which are enforced at ingress. Any rule inserted here will be denied regardless of the allowed ingress rules in the ‘ingress’ field. If omitted or empty, this rule does not apply at ingress.
- array
.spec .ingressDeny[] .fromCIDR
FromCIDR is a list of IP blocks which the endpoint subject to the rule is allowed to receive connections from. Only connections which do not originate from the cluster or from the local host are subject to CIDR rules. In order to allow in-cluster connectivity, use the FromEndpoints field. This will match on the source IP address of incoming connections. Adding a prefix into FromCIDR or into FromCIDRSet with no ExcludeCIDRs is equivalent. Overlaps are allowed between FromCIDR and FromCIDRSet.
Example: Any endpoint with the label “app=my-legacy-pet” is allowed to receive connections from 10.3.9.1
- array
.spec .ingressDeny[] .fromCIDRSet
FromCIDRSet is a list of IP blocks which the endpoint subject to the rule is allowed to receive connections from in addition to FromEndpoints, along with a list of subnets contained within their corresponding IP block from which traffic should not be allowed. This will match on the source IP address of incoming connections. Adding a prefix into FromCIDR or into FromCIDRSet with no ExcludeCIDRs is equivalent. Overlaps are allowed between FromCIDR and FromCIDRSet.
Example: Any endpoint with the label “app=my-legacy-pet” is allowed to receive connections from 10.0.0.0/8 except from IPs in subnet 10.96.0.0/12.
- string
.spec .ingressDeny[] .fromCIDRSet[] .cidr
CIDR is a CIDR prefix / IP Block.
- string
.spec .ingressDeny[] .fromCIDRSet[] .cidrGroupRef
CIDRGroupRef is a reference to a CiliumCIDRGroup object. A CiliumCIDRGroup contains a list of CIDRs that the endpoint, subject to the rule, can (Ingress/Egress) or cannot (IngressDeny/EgressDeny) receive connections from.
- object
.spec .ingressDeny[] .fromCIDRSet[] .cidrGroupSelector
CIDRGroupSelector selects CiliumCIDRGroups by their labels, rather than by name.
- array
.spec .ingressDeny[] .fromCIDRSet[] .cidrGroupSelector .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .ingressDeny[] .fromCIDRSet[] .cidrGroupSelector .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .ingressDeny[] .fromCIDRSet[] .cidrGroupSelector .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .ingressDeny[] .fromCIDRSet[] .cidrGroupSelector .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .ingressDeny[] .fromCIDRSet[] .cidrGroupSelector .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.spec .ingressDeny[] .fromCIDRSet[] .except
ExceptCIDRs is a list of IP blocks which the endpoint subject to the rule is not allowed to initiate connections to. These CIDR prefixes should be contained within Cidr, using ExceptCIDRs together with CIDRGroupRef is not supported yet. These exceptions are only applied to the Cidr in this CIDRRule, and do not apply to any other CIDR prefixes in any other CIDRRules.
- array
.spec .ingressDeny[] .fromEndpoints
FromEndpoints is a list of endpoints identified by an EndpointSelector which are allowed to communicate with the endpoint subject to the rule.
Example: Any endpoint with the label “role=backend” can be consumed by any endpoint carrying the label “role=frontend”.
- array
.spec .ingressDeny[] .fromEndpoints[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .ingressDeny[] .fromEndpoints[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .ingressDeny[] .fromEndpoints[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .ingressDeny[] .fromEndpoints[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .ingressDeny[] .fromEndpoints[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.spec .ingressDeny[] .fromEntities
FromEntities is a list of special entities which the endpoint subject to the rule is allowed to receive connections from. Supported entities are
world
,cluster
andhost
- array
.spec .ingressDeny[] .fromGroups
FromGroups is a directive that allows the integration with multiple outside providers. Currently, only AWS is supported, and the rule can select by multiple sub directives:
Example: FromGroups:
- aws:
securityGroupsIds:
- ‘sg-XXXXXXXXXXXXX’
- aws:
securityGroupsIds:
- object
.spec .ingressDeny[] .fromGroups[] .aws
AWSGroup is an structure that can be used to whitelisting information from AWS integration
- object
.spec .ingressDeny[] .fromGroups[] .aws .labels
- string
.spec .ingressDeny[] .fromGroups[] .aws .region
- array
.spec .ingressDeny[] .fromGroups[] .aws .securityGroupsIds
- array
.spec .ingressDeny[] .fromGroups[] .aws .securityGroupsNames
- array
.spec .ingressDeny[] .fromNodes
FromNodes is a list of nodes identified by an EndpointSelector which are allowed to communicate with the endpoint subject to the rule.
- array
.spec .ingressDeny[] .fromNodes[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .ingressDeny[] .fromNodes[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .ingressDeny[] .fromNodes[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .ingressDeny[] .fromNodes[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .ingressDeny[] .fromNodes[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.spec .ingressDeny[] .fromRequires
FromRequires is a list of additional constraints which must be met in order for the selected endpoints to be reachable. These additional constraints do no by itself grant access privileges and must always be accompanied with at least one matching FromEndpoints.
Example: Any Endpoint with the label “team=A” requires consuming endpoint to also carry the label “team=A”.
- array
.spec .ingressDeny[] .fromRequires[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .ingressDeny[] .fromRequires[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .ingressDeny[] .fromRequires[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .ingressDeny[] .fromRequires[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .ingressDeny[] .fromRequires[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.spec .ingressDeny[] .icmps
ICMPs is a list of ICMP rule identified by type number which the endpoint subject to the rule is not allowed to receive connections on.
Example: Any endpoint with the label “app=httpd” can not accept incoming type 8 ICMP connections.
- array
.spec .ingressDeny[] .icmps[] .fields
Fields is a list of ICMP fields.
- string
.spec .ingressDeny[] .icmps[] .fields[] .family
Family is a IP address version. Currently, we support
IPv4
andIPv6
.IPv4
is set as default. - integer | string required
.spec .ingressDeny[] .icmps[] .fields[] .type
Type is a ICMP-type. It should be an 8bit code (0-255), or it’s CamelCase name (for example, “EchoReply”). Allowed ICMP types are: Ipv4: EchoReply | DestinationUnreachable | Redirect | Echo | EchoRequest | RouterAdvertisement | RouterSelection | TimeExceeded | ParameterProblem | Timestamp | TimestampReply | Photuris | ExtendedEcho Request | ExtendedEcho Reply Ipv6: DestinationUnreachable | PacketTooBig | TimeExceeded | ParameterProblem | EchoRequest | EchoReply | MulticastListenerQuery| MulticastListenerReport | MulticastListenerDone | RouterSolicitation | RouterAdvertisement | NeighborSolicitation | NeighborAdvertisement | RedirectMessage | RouterRenumbering | ICMPNodeInformationQuery | ICMPNodeInformationResponse | InverseNeighborDiscoverySolicitation | InverseNeighborDiscoveryAdvertisement | HomeAgentAddressDiscoveryRequest | HomeAgentAddressDiscoveryReply | MobilePrefixSolicitation | MobilePrefixAdvertisement | DuplicateAddressRequestCodeSuffix | DuplicateAddressConfirmationCodeSuffix | ExtendedEchoRequest | ExtendedEchoReply
- array
.spec .ingressDeny[] .toPorts
ToPorts is a list of destination ports identified by port number and protocol which the endpoint subject to the rule is not allowed to receive connections on.
Example: Any endpoint with the label “app=httpd” can not accept incoming connections on port 80/tcp.
- array
.spec .ingressDeny[] .toPorts[] .ports
Ports is a list of L4 port/protocol
- integer
.spec .ingressDeny[] .toPorts[] .ports[] .endPort
EndPort can only be an L4 port number.
- string required
.spec .ingressDeny[] .toPorts[] .ports[] .port
Port can be an L4 port number, or a name in the form of “http” or “http-8080”.
- string
.spec .ingressDeny[] .toPorts[] .ports[] .protocol
Protocol is the L4 protocol. If omitted or empty, any protocol matches. Accepted values: “TCP”, “UDP”, “SCTP”, “ANY”
Matching on ICMP is not supported.
Named port specified for a container may narrow this down, but may not contradict this.
- array
.spec .labels
Labels is a list of optional strings which can be used to re-identify the rule or to store metadata. It is possible to lookup or delete strings based on labels. Labels are not required to be unique, multiple rules can have overlapping or identical labels.
- string required
.spec .labels[] .key
- string
.spec .labels[] .source
Source can be one of the above values (e.g.: LabelSourceContainer).
- string
.spec .labels[] .value
- object
.spec .nodeSelector
NodeSelector selects all nodes which should be subject to this rule. EndpointSelector and NodeSelector cannot be both empty and are mutually exclusive. Can only be used in CiliumClusterwideNetworkPolicies.
- array
.spec .nodeSelector .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.spec .nodeSelector .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.spec .nodeSelector .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.spec .nodeSelector .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.spec .nodeSelector .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- undefined required
.spec .ingress
- undefined required
.spec .ingressDeny
- undefined required
.spec .egress
- undefined required
.spec .egressDeny
- array
.specs
Specs is a list of desired Cilium specific rule specification.
- string
.specs[] .description
Description is a free form string, it can be used by the creator of the rule to store human readable explanation of the purpose of this rule. Rules cannot be identified by comment.
- array
.specs[] .egress
Egress is a list of EgressRule which are enforced at egress. If omitted or empty, this rule does not apply at egress.
- object
.specs[] .egress[] .authentication
Authentication is the required authentication type for the allowed traffic, if any.
- string required
.specs[] .egress[] .authentication .mode
Mode is the required authentication mode for the allowed traffic, if any.
- array
.specs[] .egress[] .icmps
ICMPs is a list of ICMP rule identified by type number which the endpoint subject to the rule is allowed to connect to.
Example: Any endpoint with the label “app=httpd” is allowed to initiate type 8 ICMP connections.
- array
.specs[] .egress[] .icmps[] .fields
Fields is a list of ICMP fields.
- string
.specs[] .egress[] .icmps[] .fields[] .family
Family is a IP address version. Currently, we support
IPv4
andIPv6
.IPv4
is set as default. - integer | string required
.specs[] .egress[] .icmps[] .fields[] .type
Type is a ICMP-type. It should be an 8bit code (0-255), or it’s CamelCase name (for example, “EchoReply”). Allowed ICMP types are: Ipv4: EchoReply | DestinationUnreachable | Redirect | Echo | EchoRequest | RouterAdvertisement | RouterSelection | TimeExceeded | ParameterProblem | Timestamp | TimestampReply | Photuris | ExtendedEcho Request | ExtendedEcho Reply Ipv6: DestinationUnreachable | PacketTooBig | TimeExceeded | ParameterProblem | EchoRequest | EchoReply | MulticastListenerQuery| MulticastListenerReport | MulticastListenerDone | RouterSolicitation | RouterAdvertisement | NeighborSolicitation | NeighborAdvertisement | RedirectMessage | RouterRenumbering | ICMPNodeInformationQuery | ICMPNodeInformationResponse | InverseNeighborDiscoverySolicitation | InverseNeighborDiscoveryAdvertisement | HomeAgentAddressDiscoveryRequest | HomeAgentAddressDiscoveryReply | MobilePrefixSolicitation | MobilePrefixAdvertisement | DuplicateAddressRequestCodeSuffix | DuplicateAddressConfirmationCodeSuffix | ExtendedEchoRequest | ExtendedEchoReply
- array
.specs[] .egress[] .toCIDR
ToCIDR is a list of IP blocks which the endpoint subject to the rule is allowed to initiate connections. Only connections destined for outside of the cluster and not targeting the host will be subject to CIDR rules. This will match on the destination IP address of outgoing connections. Adding a prefix into ToCIDR or into ToCIDRSet with no ExcludeCIDRs is equivalent. Overlaps are allowed between ToCIDR and ToCIDRSet.
Example: Any endpoint with the label “app=database-proxy” is allowed to initiate connections to 10.2.3.0/24
- array
.specs[] .egress[] .toCIDRSet
ToCIDRSet is a list of IP blocks which the endpoint subject to the rule is allowed to initiate connections to in addition to connections which are allowed via ToEndpoints, along with a list of subnets contained within their corresponding IP block to which traffic should not be allowed. This will match on the destination IP address of outgoing connections. Adding a prefix into ToCIDR or into ToCIDRSet with no ExcludeCIDRs is equivalent. Overlaps are allowed between ToCIDR and ToCIDRSet.
Example: Any endpoint with the label “app=database-proxy” is allowed to initiate connections to 10.2.3.0/24 except from IPs in subnet 10.2.3.0/28.
- string
.specs[] .egress[] .toCIDRSet[] .cidr
CIDR is a CIDR prefix / IP Block.
- string
.specs[] .egress[] .toCIDRSet[] .cidrGroupRef
CIDRGroupRef is a reference to a CiliumCIDRGroup object. A CiliumCIDRGroup contains a list of CIDRs that the endpoint, subject to the rule, can (Ingress/Egress) or cannot (IngressDeny/EgressDeny) receive connections from.
- object
.specs[] .egress[] .toCIDRSet[] .cidrGroupSelector
CIDRGroupSelector selects CiliumCIDRGroups by their labels, rather than by name.
- array
.specs[] .egress[] .toCIDRSet[] .cidrGroupSelector .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .egress[] .toCIDRSet[] .cidrGroupSelector .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .egress[] .toCIDRSet[] .cidrGroupSelector .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .egress[] .toCIDRSet[] .cidrGroupSelector .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .egress[] .toCIDRSet[] .cidrGroupSelector .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.specs[] .egress[] .toCIDRSet[] .except
ExceptCIDRs is a list of IP blocks which the endpoint subject to the rule is not allowed to initiate connections to. These CIDR prefixes should be contained within Cidr, using ExceptCIDRs together with CIDRGroupRef is not supported yet. These exceptions are only applied to the Cidr in this CIDRRule, and do not apply to any other CIDR prefixes in any other CIDRRules.
- array
.specs[] .egress[] .toEndpoints
ToEndpoints is a list of endpoints identified by an EndpointSelector to which the endpoints subject to the rule are allowed to communicate.
Example: Any endpoint with the label “role=frontend” can communicate with any endpoint carrying the label “role=backend”.
- array
.specs[] .egress[] .toEndpoints[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .egress[] .toEndpoints[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .egress[] .toEndpoints[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .egress[] .toEndpoints[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .egress[] .toEndpoints[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.specs[] .egress[] .toEntities
ToEntities is a list of special entities to which the endpoint subject to the rule is allowed to initiate connections. Supported entities are
world
,cluster
,host
,remote-node
,kube-apiserver
,init
,health
,unmanaged
andall
. - array
.specs[] .egress[] .toFQDNs
ToFQDN allows whitelisting DNS names in place of IPs. The IPs that result from DNS resolution of
ToFQDN.MatchName
s are added to the same EgressRule object as ToCIDRSet entries, and behave accordingly. Any L4 and L7 rules within this EgressRule will also apply to these IPs. The DNS -> IP mapping is re-resolved periodically from within the cilium-agent, and the IPs in the DNS response are effected in the policy for selected pods as-is (i.e. the list of IPs is not modified in any way). Note: An explicit rule to allow for DNS traffic is needed for the pods, as ToFQDN counts as an egress rule and will enforce egress policy when PolicyEnforcment=default. Note: If the resolved IPs are IPs within the kubernetes cluster, the ToFQDN rule will not apply to that IP. Note: ToFQDN cannot occur in the same policy as other To* rules. - string
.specs[] .egress[] .toFQDNs[] .matchName
MatchName matches literal DNS names. A trailing “.” is automatically added when missing.
- string
.specs[] .egress[] .toFQDNs[] .matchPattern
MatchPattern allows using wildcards to match DNS names. All wildcards are case insensitive. The wildcards are:
- “” matches 0 or more DNS valid characters, and may occur anywhere in the pattern. As a special case a “” as the leftmost character, without a following “.” matches all subdomains as well as the name to the right. A trailing “.” is automatically added when missing.
Examples:
*.cilium.io
matches subdomains of cilium at that level www.cilium.io and blog.cilium.io match, cilium.io and google.com do not*cilium.io
matches cilium.io and all subdomains ends with “cilium.io” except those containing “.” separator, subcilium.io and sub-cilium.io match, www.cilium.io and blog.cilium.io does not sub*.cilium.io matches subdomains of cilium where the subdomain component begins with “sub” sub.cilium.io and subdomain.cilium.io match, www.cilium.io, blog.cilium.io, cilium.io and google.com do not - array
.specs[] .egress[] .toGroups
ToGroups is a directive that allows the integration with multiple outside providers. Currently, only AWS is supported, and the rule can select by multiple sub directives:
Example: toGroups:
- aws:
securityGroupsIds:
- ‘sg-XXXXXXXXXXXXX’
- aws:
securityGroupsIds:
- object
.specs[] .egress[] .toGroups[] .aws
AWSGroup is an structure that can be used to whitelisting information from AWS integration
- object
.specs[] .egress[] .toGroups[] .aws .labels
- string
.specs[] .egress[] .toGroups[] .aws .region
- array
.specs[] .egress[] .toGroups[] .aws .securityGroupsIds
- array
.specs[] .egress[] .toGroups[] .aws .securityGroupsNames
- array
.specs[] .egress[] .toNodes
ToNodes is a list of nodes identified by an EndpointSelector to which endpoints subject to the rule is allowed to communicate.
- array
.specs[] .egress[] .toNodes[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .egress[] .toNodes[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .egress[] .toNodes[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .egress[] .toNodes[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .egress[] .toNodes[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.specs[] .egress[] .toPorts
ToPorts is a list of destination ports identified by port number and protocol which the endpoint subject to the rule is allowed to connect to.
Example: Any endpoint with the label “role=frontend” is allowed to initiate connections to destination port 8080/tcp
- object
.specs[] .egress[] .toPorts[] .listener
listener specifies the name of a custom Envoy listener to which this traffic should be redirected to.
- object required
.specs[] .egress[] .toPorts[] .listener .envoyConfig
EnvoyConfig is a reference to the CEC or CCEC resource in which the listener is defined.
- string
.specs[] .egress[] .toPorts[] .listener .envoyConfig .kind
Kind is the resource type being referred to. Defaults to CiliumEnvoyConfig or CiliumClusterwideEnvoyConfig for CiliumNetworkPolicy and CiliumClusterwideNetworkPolicy, respectively. The only case this is currently explicitly needed is when referring to a CiliumClusterwideEnvoyConfig from CiliumNetworkPolicy, as using a namespaced listener from a cluster scoped policy is not allowed.
- string required
.specs[] .egress[] .toPorts[] .listener .envoyConfig .name
Name is the resource name of the CiliumEnvoyConfig or CiliumClusterwideEnvoyConfig where the listener is defined in.
- string required
.specs[] .egress[] .toPorts[] .listener .name
Name is the name of the listener.
- integer
.specs[] .egress[] .toPorts[] .listener .priority
Priority for this Listener that is used when multiple rules would apply different listeners to a policy map entry. Behavior of this is implementation dependent.
- object
.specs[] .egress[] .toPorts[] .originatingTLS
OriginatingTLS is the TLS context for the connections originated by the L7 proxy. For egress policy this specifies the client-side TLS parameters for the upstream connection originating from the L7 proxy to the remote destination. For ingress policy this specifies the client-side TLS parameters for the connection from the L7 proxy to the local endpoint.
- string
.specs[] .egress[] .toPorts[] .originatingTLS .certificate
Certificate is the file name or k8s secret item name for the certificate chain. If omitted, ‘tls.crt’ is assumed, if it exists. If given, the item must exist.
- string
.specs[] .egress[] .toPorts[] .originatingTLS .privateKey
PrivateKey is the file name or k8s secret item name for the private key matching the certificate chain. If omitted, ‘tls.key’ is assumed, if it exists. If given, the item must exist.
- object required
.specs[] .egress[] .toPorts[] .originatingTLS .secret
Secret is the secret that contains the certificates and private key for the TLS context. By default, Cilium will search in this secret for the following items:
- ‘ca.crt’ - Which represents the trusted CA to verify remote source.
- ‘tls.crt’ - Which represents the public key certificate.
- ‘tls.key’ - Which represents the private key matching the public key certificate.
- string required
.specs[] .egress[] .toPorts[] .originatingTLS .secret .name
Name is the name of the secret.
- string
.specs[] .egress[] .toPorts[] .originatingTLS .secret .namespace
Namespace is the namespace in which the secret exists. Context of use determines the default value if left out (e.g., “default”).
- string
.specs[] .egress[] .toPorts[] .originatingTLS .trustedCA
TrustedCA is the file name or k8s secret item name for the trusted CA. If omitted, ‘ca.crt’ is assumed, if it exists. If given, the item must exist.
- array
.specs[] .egress[] .toPorts[] .ports
Ports is a list of L4 port/protocol
- integer
.specs[] .egress[] .toPorts[] .ports[] .endPort
EndPort can only be an L4 port number.
- string required
.specs[] .egress[] .toPorts[] .ports[] .port
Port can be an L4 port number, or a name in the form of “http” or “http-8080”.
- string
.specs[] .egress[] .toPorts[] .ports[] .protocol
Protocol is the L4 protocol. If omitted or empty, any protocol matches. Accepted values: “TCP”, “UDP”, “SCTP”, “ANY”
Matching on ICMP is not supported.
Named port specified for a container may narrow this down, but may not contradict this.
- object
.specs[] .egress[] .toPorts[] .rules
Rules is a list of additional port level rules which must be met in order for the PortRule to allow the traffic. If omitted or empty, no layer 7 rules are enforced.
- array
.specs[] .egress[] .toPorts[] .rules .dns
DNS-specific rules.
- string
.specs[] .egress[] .toPorts[] .rules .dns[] .matchName
MatchName matches literal DNS names. A trailing “.” is automatically added when missing.
- string
.specs[] .egress[] .toPorts[] .rules .dns[] .matchPattern
MatchPattern allows using wildcards to match DNS names. All wildcards are case insensitive. The wildcards are:
- “” matches 0 or more DNS valid characters, and may occur anywhere in the pattern. As a special case a “” as the leftmost character, without a following “.” matches all subdomains as well as the name to the right. A trailing “.” is automatically added when missing.
Examples:
*.cilium.io
matches subdomains of cilium at that level www.cilium.io and blog.cilium.io match, cilium.io and google.com do not*cilium.io
matches cilium.io and all subdomains ends with “cilium.io” except those containing “.” separator, subcilium.io and sub-cilium.io match, www.cilium.io and blog.cilium.io does not sub*.cilium.io matches subdomains of cilium where the subdomain component begins with “sub” sub.cilium.io and subdomain.cilium.io match, www.cilium.io, blog.cilium.io, cilium.io and google.com do not - array
.specs[] .egress[] .toPorts[] .rules .http
HTTP specific rules.
- array
.specs[] .egress[] .toPorts[] .rules .http[] .headerMatches
HeaderMatches is a list of HTTP headers which must be present and match against the given values. Mismatch field can be used to specify what to do when there is no match.
- string
.specs[] .egress[] .toPorts[] .rules .http[] .headerMatches[] .mismatch
Mismatch identifies what to do in case there is no match. The default is to drop the request. Otherwise the overall rule is still considered as matching, but the mismatches are logged in the access log.
- string required
.specs[] .egress[] .toPorts[] .rules .http[] .headerMatches[] .name
Name identifies the header.
- object
.specs[] .egress[] .toPorts[] .rules .http[] .headerMatches[] .secret
Secret refers to a secret that contains the value to be matched against. The secret must only contain one entry. If the referred secret does not exist, and there is no “Value” specified, the match will fail.
- string required
.specs[] .egress[] .toPorts[] .rules .http[] .headerMatches[] .secret .name
Name is the name of the secret.
- string
.specs[] .egress[] .toPorts[] .rules .http[] .headerMatches[] .secret .namespace
Namespace is the namespace in which the secret exists. Context of use determines the default value if left out (e.g., “default”).
- string
.specs[] .egress[] .toPorts[] .rules .http[] .headerMatches[] .value
Value matches the exact value of the header. Can be specified either alone or together with “Secret”; will be used as the header value if the secret can not be found in the latter case.
- array
.specs[] .egress[] .toPorts[] .rules .http[] .headers
Headers is a list of HTTP headers which must be present in the request. If omitted or empty, requests are allowed regardless of headers present.
- string
.specs[] .egress[] .toPorts[] .rules .http[] .host
Host is an extended POSIX regex matched against the host header of a request. Examples:
- foo.bar.com will match the host fooXbar.com or foo-bar.com
- foo.bar.com will only match the host foo.bar.com
If omitted or empty, the value of the host header is ignored.
- string
.specs[] .egress[] .toPorts[] .rules .http[] .method
Method is an extended POSIX regex matched against the method of a request, e.g. “GET”, “POST”, “PUT”, “PATCH”, “DELETE”, …
If omitted or empty, all methods are allowed.
- string
.specs[] .egress[] .toPorts[] .rules .http[] .path
Path is an extended POSIX regex matched against the path of a request. Currently it can contain characters disallowed from the conventional “path” part of a URL as defined by RFC 3986.
If omitted or empty, all paths are all allowed.
- array
.specs[] .egress[] .toPorts[] .rules .kafka
Kafka-specific rules.
- string
.specs[] .egress[] .toPorts[] .rules .kafka[] .apiKey
APIKey is a case-insensitive string matched against the key of a request, e.g. “produce”, “fetch”, “createtopic”, “deletetopic”, et al Reference: https://kafka.apache.org/protocol#protocol_api_keys
If omitted or empty, and if Role is not specified, then all keys are allowed.
- string
.specs[] .egress[] .toPorts[] .rules .kafka[] .apiVersion
APIVersion is the version matched against the api version of the Kafka message. If set, it has to be a string representing a positive integer.
If omitted or empty, all versions are allowed.
- string
.specs[] .egress[] .toPorts[] .rules .kafka[] .clientID
ClientID is the client identifier as provided in the request.
From Kafka protocol documentation: This is a user supplied identifier for the client application. The user can use any identifier they like and it will be used when logging errors, monitoring aggregates, etc. For example, one might want to monitor not just the requests per second overall, but the number coming from each client application (each of which could reside on multiple servers). This id acts as a logical grouping across all requests from a particular client.
If omitted or empty, all client identifiers are allowed.
- string
.specs[] .egress[] .toPorts[] .rules .kafka[] .role
Role is a case-insensitive string and describes a group of API keys necessary to perform certain higher-level Kafka operations such as “produce” or “consume”. A Role automatically expands into all APIKeys required to perform the specified higher-level operation.
The following values are supported:
- “produce”: Allow producing to the topics specified in the rule
- “consume”: Allow consuming from the topics specified in the rule
This field is incompatible with the APIKey field, i.e APIKey and Role cannot both be specified in the same rule.
If omitted or empty, and if APIKey is not specified, then all keys are allowed.
- string
.specs[] .egress[] .toPorts[] .rules .kafka[] .topic
Topic is the topic name contained in the message. If a Kafka request contains multiple topics, then all topics must be allowed or the message will be rejected.
This constraint is ignored if the matched request message type doesn’t contain any topic. Maximum size of Topic can be 249 characters as per recent Kafka spec and allowed characters are a-z, A-Z, 0-9, -, . and _.
Older Kafka versions had longer topic lengths of 255, but in Kafka 0.10 version the length was changed from 255 to 249. For compatibility reasons we are using 255.
If omitted or empty, all topics are allowed.
- array
.specs[] .egress[] .toPorts[] .rules .l7
Key-value pair rules.
- string
.specs[] .egress[] .toPorts[] .rules .l7proto
Name of the L7 protocol for which the Key-value pair rules apply.
- array
.specs[] .egress[] .toPorts[] .serverNames
ServerNames is a list of allowed TLS SNI values. If not empty, then TLS must be present and one of the provided SNIs must be indicated in the TLS handshake.
- object
.specs[] .egress[] .toPorts[] .terminatingTLS
TerminatingTLS is the TLS context for the connection terminated by the L7 proxy. For egress policy this specifies the server-side TLS parameters to be applied on the connections originated from the local endpoint and terminated by the L7 proxy. For ingress policy this specifies the server-side TLS parameters to be applied on the connections originated from a remote source and terminated by the L7 proxy.
- string
.specs[] .egress[] .toPorts[] .terminatingTLS .certificate
Certificate is the file name or k8s secret item name for the certificate chain. If omitted, ‘tls.crt’ is assumed, if it exists. If given, the item must exist.
- string
.specs[] .egress[] .toPorts[] .terminatingTLS .privateKey
PrivateKey is the file name or k8s secret item name for the private key matching the certificate chain. If omitted, ‘tls.key’ is assumed, if it exists. If given, the item must exist.
- object required
.specs[] .egress[] .toPorts[] .terminatingTLS .secret
Secret is the secret that contains the certificates and private key for the TLS context. By default, Cilium will search in this secret for the following items:
- ‘ca.crt’ - Which represents the trusted CA to verify remote source.
- ‘tls.crt’ - Which represents the public key certificate.
- ‘tls.key’ - Which represents the private key matching the public key certificate.
- string required
.specs[] .egress[] .toPorts[] .terminatingTLS .secret .name
Name is the name of the secret.
- string
.specs[] .egress[] .toPorts[] .terminatingTLS .secret .namespace
Namespace is the namespace in which the secret exists. Context of use determines the default value if left out (e.g., “default”).
- string
.specs[] .egress[] .toPorts[] .terminatingTLS .trustedCA
TrustedCA is the file name or k8s secret item name for the trusted CA. If omitted, ‘ca.crt’ is assumed, if it exists. If given, the item must exist.
- array
.specs[] .egress[] .toRequires
ToRequires is a list of additional constraints which must be met in order for the selected endpoints to be able to connect to other endpoints. These additional constraints do no by itself grant access privileges and must always be accompanied with at least one matching ToEndpoints.
Example: Any Endpoint with the label “team=A” requires any endpoint to which it communicates to also carry the label “team=A”.
- array
.specs[] .egress[] .toRequires[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .egress[] .toRequires[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .egress[] .toRequires[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .egress[] .toRequires[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .egress[] .toRequires[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.specs[] .egress[] .toServices
ToServices is a list of services to which the endpoint subject to the rule is allowed to initiate connections. Currently Cilium only supports toServices for K8s services.
- object
.specs[] .egress[] .toServices[] .k8sService
K8sService selects service by name and namespace pair
- string
.specs[] .egress[] .toServices[] .k8sService .namespace
- string
.specs[] .egress[] .toServices[] .k8sService .serviceName
- object
.specs[] .egress[] .toServices[] .k8sServiceSelector
K8sServiceSelector selects services by k8s labels and namespace
- string
.specs[] .egress[] .toServices[] .k8sServiceSelector .namespace
- object required
.specs[] .egress[] .toServices[] .k8sServiceSelector .selector
ServiceSelector is a label selector for k8s services
- array
.specs[] .egress[] .toServices[] .k8sServiceSelector .selector .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .egress[] .toServices[] .k8sServiceSelector .selector .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .egress[] .toServices[] .k8sServiceSelector .selector .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .egress[] .toServices[] .k8sServiceSelector .selector .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .egress[] .toServices[] .k8sServiceSelector .selector .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.specs[] .egressDeny
EgressDeny is a list of EgressDenyRule which are enforced at egress. Any rule inserted here will be denied regardless of the allowed egress rules in the ‘egress’ field. If omitted or empty, this rule does not apply at egress.
- array
.specs[] .egressDeny[] .icmps
ICMPs is a list of ICMP rule identified by type number which the endpoint subject to the rule is not allowed to connect to.
Example: Any endpoint with the label “app=httpd” is not allowed to initiate type 8 ICMP connections.
- array
.specs[] .egressDeny[] .icmps[] .fields
Fields is a list of ICMP fields.
- string
.specs[] .egressDeny[] .icmps[] .fields[] .family
Family is a IP address version. Currently, we support
IPv4
andIPv6
.IPv4
is set as default. - integer | string required
.specs[] .egressDeny[] .icmps[] .fields[] .type
Type is a ICMP-type. It should be an 8bit code (0-255), or it’s CamelCase name (for example, “EchoReply”). Allowed ICMP types are: Ipv4: EchoReply | DestinationUnreachable | Redirect | Echo | EchoRequest | RouterAdvertisement | RouterSelection | TimeExceeded | ParameterProblem | Timestamp | TimestampReply | Photuris | ExtendedEcho Request | ExtendedEcho Reply Ipv6: DestinationUnreachable | PacketTooBig | TimeExceeded | ParameterProblem | EchoRequest | EchoReply | MulticastListenerQuery| MulticastListenerReport | MulticastListenerDone | RouterSolicitation | RouterAdvertisement | NeighborSolicitation | NeighborAdvertisement | RedirectMessage | RouterRenumbering | ICMPNodeInformationQuery | ICMPNodeInformationResponse | InverseNeighborDiscoverySolicitation | InverseNeighborDiscoveryAdvertisement | HomeAgentAddressDiscoveryRequest | HomeAgentAddressDiscoveryReply | MobilePrefixSolicitation | MobilePrefixAdvertisement | DuplicateAddressRequestCodeSuffix | DuplicateAddressConfirmationCodeSuffix | ExtendedEchoRequest | ExtendedEchoReply
- array
.specs[] .egressDeny[] .toCIDR
ToCIDR is a list of IP blocks which the endpoint subject to the rule is allowed to initiate connections. Only connections destined for outside of the cluster and not targeting the host will be subject to CIDR rules. This will match on the destination IP address of outgoing connections. Adding a prefix into ToCIDR or into ToCIDRSet with no ExcludeCIDRs is equivalent. Overlaps are allowed between ToCIDR and ToCIDRSet.
Example: Any endpoint with the label “app=database-proxy” is allowed to initiate connections to 10.2.3.0/24
- array
.specs[] .egressDeny[] .toCIDRSet
ToCIDRSet is a list of IP blocks which the endpoint subject to the rule is allowed to initiate connections to in addition to connections which are allowed via ToEndpoints, along with a list of subnets contained within their corresponding IP block to which traffic should not be allowed. This will match on the destination IP address of outgoing connections. Adding a prefix into ToCIDR or into ToCIDRSet with no ExcludeCIDRs is equivalent. Overlaps are allowed between ToCIDR and ToCIDRSet.
Example: Any endpoint with the label “app=database-proxy” is allowed to initiate connections to 10.2.3.0/24 except from IPs in subnet 10.2.3.0/28.
- string
.specs[] .egressDeny[] .toCIDRSet[] .cidr
CIDR is a CIDR prefix / IP Block.
- string
.specs[] .egressDeny[] .toCIDRSet[] .cidrGroupRef
CIDRGroupRef is a reference to a CiliumCIDRGroup object. A CiliumCIDRGroup contains a list of CIDRs that the endpoint, subject to the rule, can (Ingress/Egress) or cannot (IngressDeny/EgressDeny) receive connections from.
- object
.specs[] .egressDeny[] .toCIDRSet[] .cidrGroupSelector
CIDRGroupSelector selects CiliumCIDRGroups by their labels, rather than by name.
- array
.specs[] .egressDeny[] .toCIDRSet[] .cidrGroupSelector .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .egressDeny[] .toCIDRSet[] .cidrGroupSelector .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .egressDeny[] .toCIDRSet[] .cidrGroupSelector .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .egressDeny[] .toCIDRSet[] .cidrGroupSelector .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .egressDeny[] .toCIDRSet[] .cidrGroupSelector .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.specs[] .egressDeny[] .toCIDRSet[] .except
ExceptCIDRs is a list of IP blocks which the endpoint subject to the rule is not allowed to initiate connections to. These CIDR prefixes should be contained within Cidr, using ExceptCIDRs together with CIDRGroupRef is not supported yet. These exceptions are only applied to the Cidr in this CIDRRule, and do not apply to any other CIDR prefixes in any other CIDRRules.
- array
.specs[] .egressDeny[] .toEndpoints
ToEndpoints is a list of endpoints identified by an EndpointSelector to which the endpoints subject to the rule are allowed to communicate.
Example: Any endpoint with the label “role=frontend” can communicate with any endpoint carrying the label “role=backend”.
- array
.specs[] .egressDeny[] .toEndpoints[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .egressDeny[] .toEndpoints[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .egressDeny[] .toEndpoints[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .egressDeny[] .toEndpoints[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .egressDeny[] .toEndpoints[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.specs[] .egressDeny[] .toEntities
ToEntities is a list of special entities to which the endpoint subject to the rule is allowed to initiate connections. Supported entities are
world
,cluster
,host
,remote-node
,kube-apiserver
,init
,health
,unmanaged
andall
. - array
.specs[] .egressDeny[] .toGroups
ToGroups is a directive that allows the integration with multiple outside providers. Currently, only AWS is supported, and the rule can select by multiple sub directives:
Example: toGroups:
- aws:
securityGroupsIds:
- ‘sg-XXXXXXXXXXXXX’
- aws:
securityGroupsIds:
- object
.specs[] .egressDeny[] .toGroups[] .aws
AWSGroup is an structure that can be used to whitelisting information from AWS integration
- object
.specs[] .egressDeny[] .toGroups[] .aws .labels
- string
.specs[] .egressDeny[] .toGroups[] .aws .region
- array
.specs[] .egressDeny[] .toGroups[] .aws .securityGroupsIds
- array
.specs[] .egressDeny[] .toGroups[] .aws .securityGroupsNames
- array
.specs[] .egressDeny[] .toNodes
ToNodes is a list of nodes identified by an EndpointSelector to which endpoints subject to the rule is allowed to communicate.
- array
.specs[] .egressDeny[] .toNodes[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .egressDeny[] .toNodes[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .egressDeny[] .toNodes[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .egressDeny[] .toNodes[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .egressDeny[] .toNodes[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.specs[] .egressDeny[] .toPorts
ToPorts is a list of destination ports identified by port number and protocol which the endpoint subject to the rule is not allowed to connect to.
Example: Any endpoint with the label “role=frontend” is not allowed to initiate connections to destination port 8080/tcp
- array
.specs[] .egressDeny[] .toPorts[] .ports
Ports is a list of L4 port/protocol
- integer
.specs[] .egressDeny[] .toPorts[] .ports[] .endPort
EndPort can only be an L4 port number.
- string required
.specs[] .egressDeny[] .toPorts[] .ports[] .port
Port can be an L4 port number, or a name in the form of “http” or “http-8080”.
- string
.specs[] .egressDeny[] .toPorts[] .ports[] .protocol
Protocol is the L4 protocol. If omitted or empty, any protocol matches. Accepted values: “TCP”, “UDP”, “SCTP”, “ANY”
Matching on ICMP is not supported.
Named port specified for a container may narrow this down, but may not contradict this.
- array
.specs[] .egressDeny[] .toRequires
ToRequires is a list of additional constraints which must be met in order for the selected endpoints to be able to connect to other endpoints. These additional constraints do no by itself grant access privileges and must always be accompanied with at least one matching ToEndpoints.
Example: Any Endpoint with the label “team=A” requires any endpoint to which it communicates to also carry the label “team=A”.
- array
.specs[] .egressDeny[] .toRequires[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .egressDeny[] .toRequires[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .egressDeny[] .toRequires[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .egressDeny[] .toRequires[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .egressDeny[] .toRequires[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.specs[] .egressDeny[] .toServices
ToServices is a list of services to which the endpoint subject to the rule is allowed to initiate connections. Currently Cilium only supports toServices for K8s services.
- object
.specs[] .egressDeny[] .toServices[] .k8sService
K8sService selects service by name and namespace pair
- string
.specs[] .egressDeny[] .toServices[] .k8sService .namespace
- string
.specs[] .egressDeny[] .toServices[] .k8sService .serviceName
- object
.specs[] .egressDeny[] .toServices[] .k8sServiceSelector
K8sServiceSelector selects services by k8s labels and namespace
- string
.specs[] .egressDeny[] .toServices[] .k8sServiceSelector .namespace
- object required
.specs[] .egressDeny[] .toServices[] .k8sServiceSelector .selector
ServiceSelector is a label selector for k8s services
- array
.specs[] .egressDeny[] .toServices[] .k8sServiceSelector .selector .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .egressDeny[] .toServices[] .k8sServiceSelector .selector .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .egressDeny[] .toServices[] .k8sServiceSelector .selector .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .egressDeny[] .toServices[] .k8sServiceSelector .selector .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .egressDeny[] .toServices[] .k8sServiceSelector .selector .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- object
.specs[] .enableDefaultDeny
EnableDefaultDeny determines whether this policy configures the subject endpoint(s) to have a default deny mode. If enabled, this causes all traffic not explicitly allowed by a network policy to be dropped.
If not specified, the default is true for each traffic direction that has rules, and false otherwise. For example, if a policy only has Ingress or IngressDeny rules, then the default for ingress is true and egress is false.
If multiple policies apply to an endpoint, that endpoint’s default deny will be enabled if any policy requests it.
This is useful for creating broad-based network policies that will not cause endpoints to enter default-deny mode.
- boolean
.specs[] .enableDefaultDeny .egress
Whether or not the endpoint should have a default-deny rule applied to egress traffic.
- boolean
.specs[] .enableDefaultDeny .ingress
Whether or not the endpoint should have a default-deny rule applied to ingress traffic.
- object
.specs[] .endpointSelector
EndpointSelector selects all endpoints which should be subject to this rule. EndpointSelector and NodeSelector cannot be both empty and are mutually exclusive.
- array
.specs[] .endpointSelector .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .endpointSelector .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .endpointSelector .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .endpointSelector .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .endpointSelector .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.specs[] .ingress
Ingress is a list of IngressRule which are enforced at ingress. If omitted or empty, this rule does not apply at ingress.
- object
.specs[] .ingress[] .authentication
Authentication is the required authentication type for the allowed traffic, if any.
- string required
.specs[] .ingress[] .authentication .mode
Mode is the required authentication mode for the allowed traffic, if any.
- array
.specs[] .ingress[] .fromCIDR
FromCIDR is a list of IP blocks which the endpoint subject to the rule is allowed to receive connections from. Only connections which do not originate from the cluster or from the local host are subject to CIDR rules. In order to allow in-cluster connectivity, use the FromEndpoints field. This will match on the source IP address of incoming connections. Adding a prefix into FromCIDR or into FromCIDRSet with no ExcludeCIDRs is equivalent. Overlaps are allowed between FromCIDR and FromCIDRSet.
Example: Any endpoint with the label “app=my-legacy-pet” is allowed to receive connections from 10.3.9.1
- array
.specs[] .ingress[] .fromCIDRSet
FromCIDRSet is a list of IP blocks which the endpoint subject to the rule is allowed to receive connections from in addition to FromEndpoints, along with a list of subnets contained within their corresponding IP block from which traffic should not be allowed. This will match on the source IP address of incoming connections. Adding a prefix into FromCIDR or into FromCIDRSet with no ExcludeCIDRs is equivalent. Overlaps are allowed between FromCIDR and FromCIDRSet.
Example: Any endpoint with the label “app=my-legacy-pet” is allowed to receive connections from 10.0.0.0/8 except from IPs in subnet 10.96.0.0/12.
- string
.specs[] .ingress[] .fromCIDRSet[] .cidr
CIDR is a CIDR prefix / IP Block.
- string
.specs[] .ingress[] .fromCIDRSet[] .cidrGroupRef
CIDRGroupRef is a reference to a CiliumCIDRGroup object. A CiliumCIDRGroup contains a list of CIDRs that the endpoint, subject to the rule, can (Ingress/Egress) or cannot (IngressDeny/EgressDeny) receive connections from.
- object
.specs[] .ingress[] .fromCIDRSet[] .cidrGroupSelector
CIDRGroupSelector selects CiliumCIDRGroups by their labels, rather than by name.
- array
.specs[] .ingress[] .fromCIDRSet[] .cidrGroupSelector .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .ingress[] .fromCIDRSet[] .cidrGroupSelector .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .ingress[] .fromCIDRSet[] .cidrGroupSelector .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .ingress[] .fromCIDRSet[] .cidrGroupSelector .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .ingress[] .fromCIDRSet[] .cidrGroupSelector .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.specs[] .ingress[] .fromCIDRSet[] .except
ExceptCIDRs is a list of IP blocks which the endpoint subject to the rule is not allowed to initiate connections to. These CIDR prefixes should be contained within Cidr, using ExceptCIDRs together with CIDRGroupRef is not supported yet. These exceptions are only applied to the Cidr in this CIDRRule, and do not apply to any other CIDR prefixes in any other CIDRRules.
- array
.specs[] .ingress[] .fromEndpoints
FromEndpoints is a list of endpoints identified by an EndpointSelector which are allowed to communicate with the endpoint subject to the rule.
Example: Any endpoint with the label “role=backend” can be consumed by any endpoint carrying the label “role=frontend”.
- array
.specs[] .ingress[] .fromEndpoints[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .ingress[] .fromEndpoints[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .ingress[] .fromEndpoints[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .ingress[] .fromEndpoints[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .ingress[] .fromEndpoints[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.specs[] .ingress[] .fromEntities
FromEntities is a list of special entities which the endpoint subject to the rule is allowed to receive connections from. Supported entities are
world
,cluster
andhost
- array
.specs[] .ingress[] .fromGroups
FromGroups is a directive that allows the integration with multiple outside providers. Currently, only AWS is supported, and the rule can select by multiple sub directives:
Example: FromGroups:
- aws:
securityGroupsIds:
- ‘sg-XXXXXXXXXXXXX’
- aws:
securityGroupsIds:
- object
.specs[] .ingress[] .fromGroups[] .aws
AWSGroup is an structure that can be used to whitelisting information from AWS integration
- object
.specs[] .ingress[] .fromGroups[] .aws .labels
- string
.specs[] .ingress[] .fromGroups[] .aws .region
- array
.specs[] .ingress[] .fromGroups[] .aws .securityGroupsIds
- array
.specs[] .ingress[] .fromGroups[] .aws .securityGroupsNames
- array
.specs[] .ingress[] .fromNodes
FromNodes is a list of nodes identified by an EndpointSelector which are allowed to communicate with the endpoint subject to the rule.
- array
.specs[] .ingress[] .fromNodes[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .ingress[] .fromNodes[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .ingress[] .fromNodes[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .ingress[] .fromNodes[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .ingress[] .fromNodes[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.specs[] .ingress[] .fromRequires
FromRequires is a list of additional constraints which must be met in order for the selected endpoints to be reachable. These additional constraints do no by itself grant access privileges and must always be accompanied with at least one matching FromEndpoints.
Example: Any Endpoint with the label “team=A” requires consuming endpoint to also carry the label “team=A”.
- array
.specs[] .ingress[] .fromRequires[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .ingress[] .fromRequires[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .ingress[] .fromRequires[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .ingress[] .fromRequires[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .ingress[] .fromRequires[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.specs[] .ingress[] .icmps
ICMPs is a list of ICMP rule identified by type number which the endpoint subject to the rule is allowed to receive connections on.
Example: Any endpoint with the label “app=httpd” can only accept incoming type 8 ICMP connections.
- array
.specs[] .ingress[] .icmps[] .fields
Fields is a list of ICMP fields.
- string
.specs[] .ingress[] .icmps[] .fields[] .family
Family is a IP address version. Currently, we support
IPv4
andIPv6
.IPv4
is set as default. - integer | string required
.specs[] .ingress[] .icmps[] .fields[] .type
Type is a ICMP-type. It should be an 8bit code (0-255), or it’s CamelCase name (for example, “EchoReply”). Allowed ICMP types are: Ipv4: EchoReply | DestinationUnreachable | Redirect | Echo | EchoRequest | RouterAdvertisement | RouterSelection | TimeExceeded | ParameterProblem | Timestamp | TimestampReply | Photuris | ExtendedEcho Request | ExtendedEcho Reply Ipv6: DestinationUnreachable | PacketTooBig | TimeExceeded | ParameterProblem | EchoRequest | EchoReply | MulticastListenerQuery| MulticastListenerReport | MulticastListenerDone | RouterSolicitation | RouterAdvertisement | NeighborSolicitation | NeighborAdvertisement | RedirectMessage | RouterRenumbering | ICMPNodeInformationQuery | ICMPNodeInformationResponse | InverseNeighborDiscoverySolicitation | InverseNeighborDiscoveryAdvertisement | HomeAgentAddressDiscoveryRequest | HomeAgentAddressDiscoveryReply | MobilePrefixSolicitation | MobilePrefixAdvertisement | DuplicateAddressRequestCodeSuffix | DuplicateAddressConfirmationCodeSuffix | ExtendedEchoRequest | ExtendedEchoReply
- array
.specs[] .ingress[] .toPorts
ToPorts is a list of destination ports identified by port number and protocol which the endpoint subject to the rule is allowed to receive connections on.
Example: Any endpoint with the label “app=httpd” can only accept incoming connections on port 80/tcp.
- object
.specs[] .ingress[] .toPorts[] .listener
listener specifies the name of a custom Envoy listener to which this traffic should be redirected to.
- object required
.specs[] .ingress[] .toPorts[] .listener .envoyConfig
EnvoyConfig is a reference to the CEC or CCEC resource in which the listener is defined.
- string
.specs[] .ingress[] .toPorts[] .listener .envoyConfig .kind
Kind is the resource type being referred to. Defaults to CiliumEnvoyConfig or CiliumClusterwideEnvoyConfig for CiliumNetworkPolicy and CiliumClusterwideNetworkPolicy, respectively. The only case this is currently explicitly needed is when referring to a CiliumClusterwideEnvoyConfig from CiliumNetworkPolicy, as using a namespaced listener from a cluster scoped policy is not allowed.
- string required
.specs[] .ingress[] .toPorts[] .listener .envoyConfig .name
Name is the resource name of the CiliumEnvoyConfig or CiliumClusterwideEnvoyConfig where the listener is defined in.
- string required
.specs[] .ingress[] .toPorts[] .listener .name
Name is the name of the listener.
- integer
.specs[] .ingress[] .toPorts[] .listener .priority
Priority for this Listener that is used when multiple rules would apply different listeners to a policy map entry. Behavior of this is implementation dependent.
- object
.specs[] .ingress[] .toPorts[] .originatingTLS
OriginatingTLS is the TLS context for the connections originated by the L7 proxy. For egress policy this specifies the client-side TLS parameters for the upstream connection originating from the L7 proxy to the remote destination. For ingress policy this specifies the client-side TLS parameters for the connection from the L7 proxy to the local endpoint.
- string
.specs[] .ingress[] .toPorts[] .originatingTLS .certificate
Certificate is the file name or k8s secret item name for the certificate chain. If omitted, ‘tls.crt’ is assumed, if it exists. If given, the item must exist.
- string
.specs[] .ingress[] .toPorts[] .originatingTLS .privateKey
PrivateKey is the file name or k8s secret item name for the private key matching the certificate chain. If omitted, ‘tls.key’ is assumed, if it exists. If given, the item must exist.
- object required
.specs[] .ingress[] .toPorts[] .originatingTLS .secret
Secret is the secret that contains the certificates and private key for the TLS context. By default, Cilium will search in this secret for the following items:
- ‘ca.crt’ - Which represents the trusted CA to verify remote source.
- ‘tls.crt’ - Which represents the public key certificate.
- ‘tls.key’ - Which represents the private key matching the public key certificate.
- string required
.specs[] .ingress[] .toPorts[] .originatingTLS .secret .name
Name is the name of the secret.
- string
.specs[] .ingress[] .toPorts[] .originatingTLS .secret .namespace
Namespace is the namespace in which the secret exists. Context of use determines the default value if left out (e.g., “default”).
- string
.specs[] .ingress[] .toPorts[] .originatingTLS .trustedCA
TrustedCA is the file name or k8s secret item name for the trusted CA. If omitted, ‘ca.crt’ is assumed, if it exists. If given, the item must exist.
- array
.specs[] .ingress[] .toPorts[] .ports
Ports is a list of L4 port/protocol
- integer
.specs[] .ingress[] .toPorts[] .ports[] .endPort
EndPort can only be an L4 port number.
- string required
.specs[] .ingress[] .toPorts[] .ports[] .port
Port can be an L4 port number, or a name in the form of “http” or “http-8080”.
- string
.specs[] .ingress[] .toPorts[] .ports[] .protocol
Protocol is the L4 protocol. If omitted or empty, any protocol matches. Accepted values: “TCP”, “UDP”, “SCTP”, “ANY”
Matching on ICMP is not supported.
Named port specified for a container may narrow this down, but may not contradict this.
- object
.specs[] .ingress[] .toPorts[] .rules
Rules is a list of additional port level rules which must be met in order for the PortRule to allow the traffic. If omitted or empty, no layer 7 rules are enforced.
- array
.specs[] .ingress[] .toPorts[] .rules .dns
DNS-specific rules.
- string
.specs[] .ingress[] .toPorts[] .rules .dns[] .matchName
MatchName matches literal DNS names. A trailing “.” is automatically added when missing.
- string
.specs[] .ingress[] .toPorts[] .rules .dns[] .matchPattern
MatchPattern allows using wildcards to match DNS names. All wildcards are case insensitive. The wildcards are:
- “” matches 0 or more DNS valid characters, and may occur anywhere in the pattern. As a special case a “” as the leftmost character, without a following “.” matches all subdomains as well as the name to the right. A trailing “.” is automatically added when missing.
Examples:
*.cilium.io
matches subdomains of cilium at that level www.cilium.io and blog.cilium.io match, cilium.io and google.com do not*cilium.io
matches cilium.io and all subdomains ends with “cilium.io” except those containing “.” separator, subcilium.io and sub-cilium.io match, www.cilium.io and blog.cilium.io does not sub*.cilium.io matches subdomains of cilium where the subdomain component begins with “sub” sub.cilium.io and subdomain.cilium.io match, www.cilium.io, blog.cilium.io, cilium.io and google.com do not - array
.specs[] .ingress[] .toPorts[] .rules .http
HTTP specific rules.
- array
.specs[] .ingress[] .toPorts[] .rules .http[] .headerMatches
HeaderMatches is a list of HTTP headers which must be present and match against the given values. Mismatch field can be used to specify what to do when there is no match.
- string
.specs[] .ingress[] .toPorts[] .rules .http[] .headerMatches[] .mismatch
Mismatch identifies what to do in case there is no match. The default is to drop the request. Otherwise the overall rule is still considered as matching, but the mismatches are logged in the access log.
- string required
.specs[] .ingress[] .toPorts[] .rules .http[] .headerMatches[] .name
Name identifies the header.
- object
.specs[] .ingress[] .toPorts[] .rules .http[] .headerMatches[] .secret
Secret refers to a secret that contains the value to be matched against. The secret must only contain one entry. If the referred secret does not exist, and there is no “Value” specified, the match will fail.
- string required
.specs[] .ingress[] .toPorts[] .rules .http[] .headerMatches[] .secret .name
Name is the name of the secret.
- string
.specs[] .ingress[] .toPorts[] .rules .http[] .headerMatches[] .secret .namespace
Namespace is the namespace in which the secret exists. Context of use determines the default value if left out (e.g., “default”).
- string
.specs[] .ingress[] .toPorts[] .rules .http[] .headerMatches[] .value
Value matches the exact value of the header. Can be specified either alone or together with “Secret”; will be used as the header value if the secret can not be found in the latter case.
- array
.specs[] .ingress[] .toPorts[] .rules .http[] .headers
Headers is a list of HTTP headers which must be present in the request. If omitted or empty, requests are allowed regardless of headers present.
- string
.specs[] .ingress[] .toPorts[] .rules .http[] .host
Host is an extended POSIX regex matched against the host header of a request. Examples:
- foo.bar.com will match the host fooXbar.com or foo-bar.com
- foo.bar.com will only match the host foo.bar.com
If omitted or empty, the value of the host header is ignored.
- string
.specs[] .ingress[] .toPorts[] .rules .http[] .method
Method is an extended POSIX regex matched against the method of a request, e.g. “GET”, “POST”, “PUT”, “PATCH”, “DELETE”, …
If omitted or empty, all methods are allowed.
- string
.specs[] .ingress[] .toPorts[] .rules .http[] .path
Path is an extended POSIX regex matched against the path of a request. Currently it can contain characters disallowed from the conventional “path” part of a URL as defined by RFC 3986.
If omitted or empty, all paths are all allowed.
- array
.specs[] .ingress[] .toPorts[] .rules .kafka
Kafka-specific rules.
- string
.specs[] .ingress[] .toPorts[] .rules .kafka[] .apiKey
APIKey is a case-insensitive string matched against the key of a request, e.g. “produce”, “fetch”, “createtopic”, “deletetopic”, et al Reference: https://kafka.apache.org/protocol#protocol_api_keys
If omitted or empty, and if Role is not specified, then all keys are allowed.
- string
.specs[] .ingress[] .toPorts[] .rules .kafka[] .apiVersion
APIVersion is the version matched against the api version of the Kafka message. If set, it has to be a string representing a positive integer.
If omitted or empty, all versions are allowed.
- string
.specs[] .ingress[] .toPorts[] .rules .kafka[] .clientID
ClientID is the client identifier as provided in the request.
From Kafka protocol documentation: This is a user supplied identifier for the client application. The user can use any identifier they like and it will be used when logging errors, monitoring aggregates, etc. For example, one might want to monitor not just the requests per second overall, but the number coming from each client application (each of which could reside on multiple servers). This id acts as a logical grouping across all requests from a particular client.
If omitted or empty, all client identifiers are allowed.
- string
.specs[] .ingress[] .toPorts[] .rules .kafka[] .role
Role is a case-insensitive string and describes a group of API keys necessary to perform certain higher-level Kafka operations such as “produce” or “consume”. A Role automatically expands into all APIKeys required to perform the specified higher-level operation.
The following values are supported:
- “produce”: Allow producing to the topics specified in the rule
- “consume”: Allow consuming from the topics specified in the rule
This field is incompatible with the APIKey field, i.e APIKey and Role cannot both be specified in the same rule.
If omitted or empty, and if APIKey is not specified, then all keys are allowed.
- string
.specs[] .ingress[] .toPorts[] .rules .kafka[] .topic
Topic is the topic name contained in the message. If a Kafka request contains multiple topics, then all topics must be allowed or the message will be rejected.
This constraint is ignored if the matched request message type doesn’t contain any topic. Maximum size of Topic can be 249 characters as per recent Kafka spec and allowed characters are a-z, A-Z, 0-9, -, . and _.
Older Kafka versions had longer topic lengths of 255, but in Kafka 0.10 version the length was changed from 255 to 249. For compatibility reasons we are using 255.
If omitted or empty, all topics are allowed.
- array
.specs[] .ingress[] .toPorts[] .rules .l7
Key-value pair rules.
- string
.specs[] .ingress[] .toPorts[] .rules .l7proto
Name of the L7 protocol for which the Key-value pair rules apply.
- array
.specs[] .ingress[] .toPorts[] .serverNames
ServerNames is a list of allowed TLS SNI values. If not empty, then TLS must be present and one of the provided SNIs must be indicated in the TLS handshake.
- object
.specs[] .ingress[] .toPorts[] .terminatingTLS
TerminatingTLS is the TLS context for the connection terminated by the L7 proxy. For egress policy this specifies the server-side TLS parameters to be applied on the connections originated from the local endpoint and terminated by the L7 proxy. For ingress policy this specifies the server-side TLS parameters to be applied on the connections originated from a remote source and terminated by the L7 proxy.
- string
.specs[] .ingress[] .toPorts[] .terminatingTLS .certificate
Certificate is the file name or k8s secret item name for the certificate chain. If omitted, ‘tls.crt’ is assumed, if it exists. If given, the item must exist.
- string
.specs[] .ingress[] .toPorts[] .terminatingTLS .privateKey
PrivateKey is the file name or k8s secret item name for the private key matching the certificate chain. If omitted, ‘tls.key’ is assumed, if it exists. If given, the item must exist.
- object required
.specs[] .ingress[] .toPorts[] .terminatingTLS .secret
Secret is the secret that contains the certificates and private key for the TLS context. By default, Cilium will search in this secret for the following items:
- ‘ca.crt’ - Which represents the trusted CA to verify remote source.
- ‘tls.crt’ - Which represents the public key certificate.
- ‘tls.key’ - Which represents the private key matching the public key certificate.
- string required
.specs[] .ingress[] .toPorts[] .terminatingTLS .secret .name
Name is the name of the secret.
- string
.specs[] .ingress[] .toPorts[] .terminatingTLS .secret .namespace
Namespace is the namespace in which the secret exists. Context of use determines the default value if left out (e.g., “default”).
- string
.specs[] .ingress[] .toPorts[] .terminatingTLS .trustedCA
TrustedCA is the file name or k8s secret item name for the trusted CA. If omitted, ‘ca.crt’ is assumed, if it exists. If given, the item must exist.
- array
.specs[] .ingressDeny
IngressDeny is a list of IngressDenyRule which are enforced at ingress. Any rule inserted here will be denied regardless of the allowed ingress rules in the ‘ingress’ field. If omitted or empty, this rule does not apply at ingress.
- array
.specs[] .ingressDeny[] .fromCIDR
FromCIDR is a list of IP blocks which the endpoint subject to the rule is allowed to receive connections from. Only connections which do not originate from the cluster or from the local host are subject to CIDR rules. In order to allow in-cluster connectivity, use the FromEndpoints field. This will match on the source IP address of incoming connections. Adding a prefix into FromCIDR or into FromCIDRSet with no ExcludeCIDRs is equivalent. Overlaps are allowed between FromCIDR and FromCIDRSet.
Example: Any endpoint with the label “app=my-legacy-pet” is allowed to receive connections from 10.3.9.1
- array
.specs[] .ingressDeny[] .fromCIDRSet
FromCIDRSet is a list of IP blocks which the endpoint subject to the rule is allowed to receive connections from in addition to FromEndpoints, along with a list of subnets contained within their corresponding IP block from which traffic should not be allowed. This will match on the source IP address of incoming connections. Adding a prefix into FromCIDR or into FromCIDRSet with no ExcludeCIDRs is equivalent. Overlaps are allowed between FromCIDR and FromCIDRSet.
Example: Any endpoint with the label “app=my-legacy-pet” is allowed to receive connections from 10.0.0.0/8 except from IPs in subnet 10.96.0.0/12.
- string
.specs[] .ingressDeny[] .fromCIDRSet[] .cidr
CIDR is a CIDR prefix / IP Block.
- string
.specs[] .ingressDeny[] .fromCIDRSet[] .cidrGroupRef
CIDRGroupRef is a reference to a CiliumCIDRGroup object. A CiliumCIDRGroup contains a list of CIDRs that the endpoint, subject to the rule, can (Ingress/Egress) or cannot (IngressDeny/EgressDeny) receive connections from.
- object
.specs[] .ingressDeny[] .fromCIDRSet[] .cidrGroupSelector
CIDRGroupSelector selects CiliumCIDRGroups by their labels, rather than by name.
- array
.specs[] .ingressDeny[] .fromCIDRSet[] .cidrGroupSelector .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .ingressDeny[] .fromCIDRSet[] .cidrGroupSelector .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .ingressDeny[] .fromCIDRSet[] .cidrGroupSelector .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .ingressDeny[] .fromCIDRSet[] .cidrGroupSelector .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .ingressDeny[] .fromCIDRSet[] .cidrGroupSelector .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.specs[] .ingressDeny[] .fromCIDRSet[] .except
ExceptCIDRs is a list of IP blocks which the endpoint subject to the rule is not allowed to initiate connections to. These CIDR prefixes should be contained within Cidr, using ExceptCIDRs together with CIDRGroupRef is not supported yet. These exceptions are only applied to the Cidr in this CIDRRule, and do not apply to any other CIDR prefixes in any other CIDRRules.
- array
.specs[] .ingressDeny[] .fromEndpoints
FromEndpoints is a list of endpoints identified by an EndpointSelector which are allowed to communicate with the endpoint subject to the rule.
Example: Any endpoint with the label “role=backend” can be consumed by any endpoint carrying the label “role=frontend”.
- array
.specs[] .ingressDeny[] .fromEndpoints[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .ingressDeny[] .fromEndpoints[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .ingressDeny[] .fromEndpoints[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .ingressDeny[] .fromEndpoints[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .ingressDeny[] .fromEndpoints[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.specs[] .ingressDeny[] .fromEntities
FromEntities is a list of special entities which the endpoint subject to the rule is allowed to receive connections from. Supported entities are
world
,cluster
andhost
- array
.specs[] .ingressDeny[] .fromGroups
FromGroups is a directive that allows the integration with multiple outside providers. Currently, only AWS is supported, and the rule can select by multiple sub directives:
Example: FromGroups:
- aws:
securityGroupsIds:
- ‘sg-XXXXXXXXXXXXX’
- aws:
securityGroupsIds:
- object
.specs[] .ingressDeny[] .fromGroups[] .aws
AWSGroup is an structure that can be used to whitelisting information from AWS integration
- object
.specs[] .ingressDeny[] .fromGroups[] .aws .labels
- string
.specs[] .ingressDeny[] .fromGroups[] .aws .region
- array
.specs[] .ingressDeny[] .fromGroups[] .aws .securityGroupsIds
- array
.specs[] .ingressDeny[] .fromGroups[] .aws .securityGroupsNames
- array
.specs[] .ingressDeny[] .fromNodes
FromNodes is a list of nodes identified by an EndpointSelector which are allowed to communicate with the endpoint subject to the rule.
- array
.specs[] .ingressDeny[] .fromNodes[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .ingressDeny[] .fromNodes[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .ingressDeny[] .fromNodes[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .ingressDeny[] .fromNodes[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .ingressDeny[] .fromNodes[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.specs[] .ingressDeny[] .fromRequires
FromRequires is a list of additional constraints which must be met in order for the selected endpoints to be reachable. These additional constraints do no by itself grant access privileges and must always be accompanied with at least one matching FromEndpoints.
Example: Any Endpoint with the label “team=A” requires consuming endpoint to also carry the label “team=A”.
- array
.specs[] .ingressDeny[] .fromRequires[] .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .ingressDeny[] .fromRequires[] .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .ingressDeny[] .fromRequires[] .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .ingressDeny[] .fromRequires[] .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .ingressDeny[] .fromRequires[] .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- array
.specs[] .ingressDeny[] .icmps
ICMPs is a list of ICMP rule identified by type number which the endpoint subject to the rule is not allowed to receive connections on.
Example: Any endpoint with the label “app=httpd” can not accept incoming type 8 ICMP connections.
- array
.specs[] .ingressDeny[] .icmps[] .fields
Fields is a list of ICMP fields.
- string
.specs[] .ingressDeny[] .icmps[] .fields[] .family
Family is a IP address version. Currently, we support
IPv4
andIPv6
.IPv4
is set as default. - integer | string required
.specs[] .ingressDeny[] .icmps[] .fields[] .type
Type is a ICMP-type. It should be an 8bit code (0-255), or it’s CamelCase name (for example, “EchoReply”). Allowed ICMP types are: Ipv4: EchoReply | DestinationUnreachable | Redirect | Echo | EchoRequest | RouterAdvertisement | RouterSelection | TimeExceeded | ParameterProblem | Timestamp | TimestampReply | Photuris | ExtendedEcho Request | ExtendedEcho Reply Ipv6: DestinationUnreachable | PacketTooBig | TimeExceeded | ParameterProblem | EchoRequest | EchoReply | MulticastListenerQuery| MulticastListenerReport | MulticastListenerDone | RouterSolicitation | RouterAdvertisement | NeighborSolicitation | NeighborAdvertisement | RedirectMessage | RouterRenumbering | ICMPNodeInformationQuery | ICMPNodeInformationResponse | InverseNeighborDiscoverySolicitation | InverseNeighborDiscoveryAdvertisement | HomeAgentAddressDiscoveryRequest | HomeAgentAddressDiscoveryReply | MobilePrefixSolicitation | MobilePrefixAdvertisement | DuplicateAddressRequestCodeSuffix | DuplicateAddressConfirmationCodeSuffix | ExtendedEchoRequest | ExtendedEchoReply
- array
.specs[] .ingressDeny[] .toPorts
ToPorts is a list of destination ports identified by port number and protocol which the endpoint subject to the rule is not allowed to receive connections on.
Example: Any endpoint with the label “app=httpd” can not accept incoming connections on port 80/tcp.
- array
.specs[] .ingressDeny[] .toPorts[] .ports
Ports is a list of L4 port/protocol
- integer
.specs[] .ingressDeny[] .toPorts[] .ports[] .endPort
EndPort can only be an L4 port number.
- string required
.specs[] .ingressDeny[] .toPorts[] .ports[] .port
Port can be an L4 port number, or a name in the form of “http” or “http-8080”.
- string
.specs[] .ingressDeny[] .toPorts[] .ports[] .protocol
Protocol is the L4 protocol. If omitted or empty, any protocol matches. Accepted values: “TCP”, “UDP”, “SCTP”, “ANY”
Matching on ICMP is not supported.
Named port specified for a container may narrow this down, but may not contradict this.
- array
.specs[] .labels
Labels is a list of optional strings which can be used to re-identify the rule or to store metadata. It is possible to lookup or delete strings based on labels. Labels are not required to be unique, multiple rules can have overlapping or identical labels.
- string required
.specs[] .labels[] .key
- string
.specs[] .labels[] .source
Source can be one of the above values (e.g.: LabelSourceContainer).
- string
.specs[] .labels[] .value
- object
.specs[] .nodeSelector
NodeSelector selects all nodes which should be subject to this rule. EndpointSelector and NodeSelector cannot be both empty and are mutually exclusive. Can only be used in CiliumClusterwideNetworkPolicies.
- array
.specs[] .nodeSelector .matchExpressions
matchExpressions is a list of label selector requirements. The requirements are ANDed.
- string required
.specs[] .nodeSelector .matchExpressions[] .key
key is the label key that the selector applies to.
- string required
.specs[] .nodeSelector .matchExpressions[] .operator
operator represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
- array
.specs[] .nodeSelector .matchExpressions[] .values
values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
- object
.specs[] .nodeSelector .matchLabels
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is “key”, the operator is “In”, and the values array contains only “value”. The requirements are ANDed.
- object
.status
Status is the status of the Cilium policy rule
- array
.status .conditions
- string
.status .conditions[] .lastTransitionTime
The last time the condition transitioned from one status to another.
- string
.status .conditions[] .message
A human readable message indicating details about the transition.
- string
.status .conditions[] .reason
The reason for the condition’s last transition.
- string required
.status .conditions[] .status
The status of the condition, one of True, False, or Unknown
- string required
.status .conditions[] .type
The type of the policy condition
- object
.status .derivativePolicies
DerivativePolicies is the status of all policies derived from the Cilium policy