Cilium CNI rules and exceptions when creating a Container Runtime Profile

Blocking network connections in containers

If you are using Cilium CNI, you must specify the Cilium CNI rules in addition to the CIDR and FQDN when choosing a network connection blocking option.

Rules for CIDR and FQDN for Cilium CNI are applied only to specify resources external to Kubernetes. To specify internal Kubernetes resources, you must use resource labels instead of CIDR and FQDN.

Cilium CNI rules are specified together with the CIDR and FQDN values, separated by commas, as follows:

entity:<ENTITY_NAME> -OR- endpoint:<NAMESPACE> -OR- service:<NAMESPACE>{|<LABEL_1_KEY>=<LABEL_2_VALUE>{,<LABEL_N_KEY>=LABEL_N_VALUE}}

where:

This format for defining rules and exclusions only applies to Cilium CNI. If you use it for other CNIs, the solution ignores incorrectly specified settings.

Applying network policies containing DNS names

Network policies that contain DNS names can be used to configure access policies for network endpoints on which not Cilium CNI is not used. Such policies specify domain names that support DNS queries. Cilium CNI can use a DNS proxy to determine the association of such domain names with IP addresses based on the DNS responses it receives from network endpoints. IP address information is obtained using the matchName or matchPattern rules from all DNS responses available to the Cilium CNI on the node.

Network policies containing DNS names can be applied only if the --enable-l7-proxy=true option is specified in the Cilium CNI configuration. If this option is not specified, the solution cannot apply policies containing DNS names, and a connection error is displayed in information about network activity monitoring and analysis actions.

When using Cilium CNI, you must also take into account the rules for setting the values of variables when deploying node-agents.

Applying CIDR-based rules

In Kaspersky Container Security exceptions for ingress and egress connections in a runtime profile contain an IP address or a range of IP addresses of connection sources in CIDR4 and CIDR6 notations. Cilium CNI treats CIDR as the connection source address located outside the cluster. If the connection is between pods in the cluster, such a connection is also considered external to the cluster.

In Cilium CNI, to define addresses of objects in a cluster, you must use pod labels (for example, fromCIDR and toCIDR).

Traffic bundling

When a pod in a cluster sends a request to a resource out of the cluster and receives a response from this resource, Cilium CNI treats the ingress and egress traffic as a single connection (TrafficDirection = Egress). All data packages exchanged by the connection endpoints will be classified as egress traffic.

If the applicable runtime profile allows egress connections and prohibits ingress connections, Cilium CNI allows ingress traffic in response to the submitted request.

Network events aggregation

In Cilium CNI, if several identical events occur within a short period, Cilium applies the aggregation rule and merges these events.

Example of aggregation

You run the ping -c5 company.com command, which resulted in five identical network requests sent to the company.com web address at one-second intervals to test the connection and five identical responses were received. Cilium CNI combined these five event pairs into one pair (a request and a response).

By default, the aggregation period for identical events is five seconds. You can change the aggregation period in the Cilium CNI configuration by specifying the value for the monitor-aggregation-intervalInsert parameter.

Page top