Skip to main content

More Info:

Reduce The Network Attack Surface Of Gke Nodes By Using Firewalls To Restrict Ingress And Egress Traffic

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS GKE

Triage and Remediation

Remediation

Manual Steps

  1. Identify node networks, tags, and service accounts
    Run on any machine with gcloud access:
    Review which VPC/subnets your nodes use, their network tags, and node service accounts.
  2. List current firewall rules affecting node networks/tags
sourceRanges,sourceTags,sourceServiceAccounts,targetTags,targetServiceAccounts)”
For egress restriction example:
Adjust names, CIDRs, tags, ports, and directions according to your design.
  1. Tighten or remove overly permissive rules
    For rules you deem too broad:
    • Edit them in your IaC (if applicable) and redeploy, or:
    • Update or delete directly:
      or
    Make changes incrementally and monitor workload behavior to avoid breaking connectivity.
  2. Verify node exposure after changes
    Re-run:
    Confirm that:
    • Worker-node-related rules have specific target-tags/target-service-accounts.
    • Ingress and egress rules use the minimal necessary CIDR ranges and ports.
    • No remaining broad 0.0.0.0/0 rules apply to worker nodes unless explicitly justified.
kubectl cannot configure GKE node firewall rules, because they are managed at the Google Cloud VPC / firewall level, not via Kubernetes API objects. Configure firewall rules using Google Cloud (console, gcloud, or IaC) as described in the Manual Steps section.

Additional Reading: