5.6.1 Enable VPC Flow Logs and Intranode Visibility (Automated)
Profile Applicability
- Level 2
Description
Enable VPC Flow Logs and Intranode Visibility to see pod-level traffic, even for traffic within a worker node.
Rationale
Enabling Intranode Visibility makes intranode pod to pod traffic visible to the networking fabric. With this feature, VPC Flow Logs or other VPC features can be used for intranode traffic.
Impact
Enabling it on existing cluster causes the cluster master and the cluster nodes to restart, which might cause disruption.
Audit
Using Google Cloud Console:
- Go to Kubernetes Engine by visiting: https://console.cloud.google.com/kubernetes/list
- Select the desired cluster, and under the
Clustersection, make sure thatIntranode visibilityis set toEnabled.
Using Command Line:
Run this command:
gcloud container clusters describe <cluster_name> --zone <compute_zone> --format json | jq '.networkConfig.enableIntraNodeVisibility'
The result should return true if Intranode Visibility is Enabled.
Remediation
Enable Intranode Visibility:
Using Google Cloud Console:
- Go to Kubernetes Engine by visiting: https://console.cloud.google.com/kubernetes/list.
- Select Kubernetes clusters for which intranode visibility is disabled.
- Within the
Detailspane, under theNetworksection, click on the pencil icon namedEdit intranode visibility. - Check the box next to
Enable Intranode visibility. - Click
SAVE CHANGES.
Using Command Line:
To enable intranode visibility on an existing cluster, run the following command:
gcloud container clusters update <cluster_name> --enable-intra-node-visibility
Enable VPC Flow Logs:
Using Google Cloud Console:
- Go to Kubernetes Engine by visiting: https://console.cloud.google.com/kubernetes/list.
- Select Kubernetes clusters for which VPC Flow Logs are disabled.
- Select
Nodestab. - Select Node Pool without VPC Flow Logs enabled.
- Select an Instance Group within the node pool.
- Select an
Instance Group Member. - Select the
Subnetworkunder Network Interfaces. - Click on
EDIT. - Set Flow logs to
On. - Click
SAVE.
Using Command Line:
- Find the subnetwork name associated with the cluster.
gcloud container clusters describe <cluster_name> --region <cluster_region> --format json | jq '.subnetwork'
- Update the subnetwork to enable VPC Flow Logs.
gcloud compute networks subnets update <subnet_name> --enable-flow-logs
Default Value
By default, Intranode Visibility is disabled.
References
- https://cloud.google.com/kubernetes-engine/docs/how-to/intranode-visibility
- https://cloud.google.com/vpc/docs/using-flow-logs
CIS Controls
| Controls Version | Control | IG 1 | IG 2 | IG 3 |
|---|---|---|---|---|
| v8 | 8.5 Collect Detailed Audit Logs | x | x | |
| v7 | 6.3 Enable Detailed Logging | x | x |