| name | cis-gke-v170-5.6.6 |
| description | Consider firewalling GKE worker nodes (Manual) |
| category | cis-gke |
| version | 1.7.0 |
| author | cyberstrike-official |
| tags | ["cis","gke","kubernetes","gcp","networking","firewall","worker-nodes","ingress","egress"] |
| cis_id | 5.6.6 |
| cis_benchmark | CIS Google Kubernetes Engine (GKE) Benchmark v1.7.0 |
| tech_stack | ["kubernetes","gcp","gke"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
5.6.6 Consider firewalling GKE worker nodes (Manual)
Profile Applicability
Description
Reduce the network attack surface of GKE nodes by using Firewalls to restrict ingress and egress traffic.
Rationale
Utilizing stringent ingress and egress firewall rules minimizes the ports and services exposed to an network-based attacker, whilst also restricting egress routes within or out of the cluster in the event that a compromised component attempts to form an outbound connection.
Impact
All instances targeted by a firewall rule, either using a tag or a service account will be affected. Ensure there are no adverse effects on other instances using the target tag or service account before implementing the firewall rule.
Audit
Using Google Cloud Console:
- Go to Compute Engine by visiting: https://console.cloud.google.com/compute/instances.
- For each instance within your cluster, use the 'more actions' menu (3 vertical dots) and select to 'View network details'.
- If there are multiple network interfaces attached to the instance, select the network interface to view in the 'Network interface' details section and see all the rules that apply to the network interface, within the 'Firewall rules' tab. Make sure the firewall rules are appropriate for your environment.
Using Command Line:
For the instance being evaluated, obtain its Service account and tags:
gcloud compute instances describe <instance_name> --zone <compute_zone> --format json | jq '{tags: .tags.items[], serviceaccount:.serviceAccounts[].email, network: .networkInterfaces[].network}'
This will return:
{
"tags": "<tag>",
"serviceaccount": "<service_account>"
"network": "https://www.googleapis.com/compute/v1/projects/<project_id>/global/networks/<network>"
}
Then, observe the firewall rules applied to the instance by using the following command, replacing <tag> and <service_account> as appropriate: