Questa pagina descrive l'approccio adottato da Google Kubernetes Engine (GKE) per
migliorare la conformità ai benchmark del Center for Internet Security (CIS) per
Kubernetes e per GKE. Questa pagina include le seguenti
informazioni:
Come configuriamo il control plane GKE gestito in modo che sia conforme
al benchmark CIS Kubernetes
Come configurare i nodi e i carichi di lavoro GKE in modo che siano conformi
al benchmark CIS Google Kubernetes Engine (GKE)
Informazioni sui benchmark CIS
CIS rilascia i seguenti benchmark che contengono linee guida per la configurazione sicura di Kubernetes:
Benchmark CIS Kubernetes: si applica al progetto open source Kubernetes.
Lo scopo è fornire indicazioni per una serie di implementazioni di Kubernetes autogestite e ospitate.
Benchmark CIS GKE: stabilisce linee guida per la configurazione sicura
dei componenti che puoi controllare nei cluster GKE. Include
suggerimenti specifici per GKE su Google Cloud.
Ti consigliamo di dare la priorità al benchmark CIS GKE, perché è specifico per GKE su Google Cloud. Il benchmark CIS Kubernetes
contiene molti suggerimenti per i controlli che non puoi visualizzare o
modificare in GKE. Il nostro approccio alla sicurezza dei cluster include
mitigazioni che vanno oltre l'ambito del benchmark Kubernetes open source e
potrebbero comportare conflitti con questi suggerimenti.
Altri benchmark applicabili a GKE
Oltre al benchmark CIS GKE e al benchmark CIS Kubernetes, ai sistemi operativi disponibili in GKE si applicano i seguenti benchmark. Anche se un benchmark del sistema operativo specifico non riguarda esplicitamente l'utilizzo di Kubernetes, devi comunque farvi riferimento per ulteriori indicazioni sulla sicurezza.
Il control plane, incluse le VM del control plane, il server API e i componenti
come il database di stato del cluster (basato su etcd o Spanner),
kube-controller-manager e kube-scheduler.
Il sistema operativo del nodo.
Questi componenti esistono in un progetto di proprietà di GKE, quindi non puoi
modificare o valutare nessuno di questi componenti in base ai controlli del benchmark CIS
corrispondenti. Tuttavia, puoi valutare e correggere i controlli CIS Benchmark
che si applicano ai nodi worker e ai carichi di lavoro. In base al modello di responsabilità condivisa GKE, questi componenti sono di tua responsabilità.
Il nostro approccio alla protezione di GKE per il benchmark CIS
GKE è un'implementazione gestita di Kubernetes open source. Gestiamo completamente il control plane e siamo responsabili della protezione della configurazione dei componenti del control plane. La tabella seguente descrive alcune delle nostre decisioni che potrebbero influire sul punteggio dei benchmark CIS:
Approccio alla sicurezza di GKE
Autenticazione
Alcuni componenti di monitoraggio GKE utilizzano l'autenticazione
anonima per ottenere le metriche.
Alcuni componenti del control plane vengono avviati utilizzando token statici, che vengono poi utilizzati per l'autenticazione al server API. Questi
token vengono generati ogni volta che una VM viene avviata o riavviata.
Controller di ammissione
GKE disattiva i seguenti controller di ammissione:
EventRateLimit: questa è una funzionalità alpha di Kubernetes
AlwaysPullImages: questo controller fornisce una certa protezione
per le immagini del registro privato nei cluster multitenant non cooperativi, al
costo di rendere i registri delle immagini un unico punto di errore per
la creazione di nuovi pod nel cluster.
SecurityContextDeny: il
controller di ammissione Pod Security
è preferito ed è disponibile in tutte le versioni di GKE.
Se utilizzi GKE Enterprise, puoi anche abilitare l'applicazione
degli standard di sicurezza dei pod utilizzando
Policy Controller.
ImagePolicyWebhook: GKE disabilita
ImagePolicyWebhook per impostazione predefinita perché dispone di meccanismi propri per
la gestione e la sicurezza delle immagini. In questo modo, GKE mantiene
un controllo più rigoroso sull'ambiente e garantisce che le sue pratiche di sicurezza
vengano applicate in modo coerente.
Tuttavia, puoi utilizzare
Autorizzazione binaria o Policy Controller per la gestione dei criteri.
Audit logging
GKE acquisisce gli audit log utilizzando il
criterio di controllo GKE.
Di conseguenza, non è necessario impostare alcun flag di audit logging del server API Kubernetes.
GKE utilizza mTLS per il traffico tra i componenti del control plane e tra il control plane e i nodi. Per maggiori dettagli, vedi
Attendibilità del cluster.
etcd
In Kubernetes open source, il database dello stato del cluster utilizza
etcd. In GKE, il database di backend che
memorizza lo stato del cluster è una delle seguenti tecnologie:
etcd: il cluster esegue istanze etcd sul control plane.
Spanner: GKE archivia lo stato del cluster in un database basato su Spanner separato dalle VM del control plane.
Tutti i cluster GKE pubblicano l'API etcd nelle VM del control plane. Qualsiasi interazione del client con l'API Kubernetes è la stessa di Kubernetes open source. A seconda della tecnologia di database che funge da backend
per l'API etcd nel tuo cluster, potresti notare discrepanze in qualsiasi
punteggio correlato a etcd nel benchmark CIS Kubernetes open source.
kubelet
GKE abilita la porta di sola lettura kubelet non autenticata. Puoi disattivare la porta
impostando --no-autoprovisioning-enable-insecure-kubelet-readonly-port.
La porta di sola lettura verrà disattivata per impostazione predefinita in una release futura dopo avervi concesso un po' di tempo per la migrazione.
La modalità GKE Standard consente ai carichi di lavoro di modificare
i valori predefiniti del kernel, se necessario.
GKE limita il numero di eventi Kubernetes in kubelet per ridurre il rischio di attacchi Denial of Service.
GKE utilizza mTLS per proteggere il traffico tra kubelet e il server API.
GKE ruota i certificati del server per impostazione predefinita e
ruota i certificati client quando sono abilitati i nodi GKE schermati.
Puoi automatizzare la valutazione dei tuoi cluster rispetto ai benchmark utilizzando uno dei seguenti metodi:
Benchmark CIS GKE:
Tutte le versioni di GKE:
Esegui kube-bench per valutare i nodi worker rispetto al benchmark. Per
i dettagli, consulta il repository GitHub kube-bench.
Utilizza uno strumento di terze parti come Twistlock Defender per valutare i nodi rispetto
al benchmark.
GKE Enterprise: utilizza la dashboard di conformità per valutare la conformità di tutti i tuoi cluster con il benchmark CIS GKE. Per
maggiori dettagli, consulta Informazioni sulla dashboard di conformità GKE.
Benchmark CIS Kubernetes: esegui kube-bench per valutare i nodi worker rispetto al benchmark. Non puoi valutare il piano di controllo gestito in base a questi
suggerimenti nel benchmark.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-01 UTC."],[],[],null,["# CIS Benchmarks\n\n[Autopilot](/kubernetes-engine/docs/concepts/autopilot-overview) [Standard](/kubernetes-engine/docs/concepts/choose-cluster-mode)\n\n*** ** * ** ***\n\nThis page describes the approach that Google Kubernetes Engine (GKE) takes to\nimprove compliance with the Center for Internet Security (CIS) benchmarks for\nKubernetes and for GKE. This page includes the following\ninformation:\n\n- How we configure the managed GKE control plane to conform to the CIS Kubernetes Benchmark\n- How you can configure your GKE nodes and workloads to conform to the CIS Google Kubernetes Engine (GKE) Benchmark\n\nAbout the CIS Benchmarks\n------------------------\n\nCIS releases the following benchmarks that contain secure configuration\nguidelines for Kubernetes:\n\n- **CIS Kubernetes Benchmark**: Applies to the open source Kubernetes project. Intended to provide guidance for a variety of self-managed and hosted Kubernetes implementations.\n- **CIS GKE Benchmark**: Establishes guidelines for the secure configuration of components you can control in GKE clusters. Includes recommendations that are specific to GKE on Google Cloud.\n\nWe recommend that you **prioritize the CIS GKE Benchmark**, because it is\nspecific to GKE on Google Cloud. The CIS Kubernetes\nBenchmark contains many recommendations for controls that you can't view or\nmodify in GKE. Our approach to cluster security includes\nmitigations that go beyond the scope of the open source Kubernetes benchmark and\nmight result in conflicts with those recommendations.\n\n### Other benchmarks that apply to GKE\n\nIn addition to the CIS GKE Benchmark and the CIS Kubernetes Benchmark, the following benchmarks apply to the operating systems that are available in GKE. Even if a specific OS benchmark doesn't explicitly address Kubernetes usage, you should still reference that benchmark for additional security guidance.\n\n- [**Container-Optimized OS Benchmark**](https://www.cisecurity.org/benchmark/google_cloud_computing_platform): the default operating system that's installed on all GKE Linux nodes\n- [**Ubuntu Linux Benchmark**](https://www.cisecurity.org/benchmark/ubuntu_linux): available for GKE Standard\n- [**Windows Server Benchmark**](https://www.cisecurity.org/benchmark/microsoft_windows_server): available for GKE Standard\n\nThe default container runtime, containerd, doesn't have a benchmark.\n\n### Shared responsibility model\n\nBased on the\n[GKE shared responsibility model](/kubernetes-engine/docs/concepts/shared-responsibility),\nwe manage the following components for you:\n\n- The control plane, including the control plane VMs, API server, and components like the cluster state database (etcd or Spanner-based), kube-controller-manager, and kube-scheduler.\n- The node operating system.\n\nThese components exist in a project that GKE owns, so you can't\nmodify or evaluate any of these components against corresponding CIS Benchmark\ncontrols. You can, however, evaluate and remediate any CIS Benchmark controls\nthat apply to your worker nodes and your workloads. Based on the\nGKE shared responsibility model, these components are your\nresponsibility.\n\nOur approach to securing GKE for the CIS Benchmark\n--------------------------------------------------\n\nGKE is a managed implementation of open source Kubernetes. We\nfully manage the control plane and are responsible for securing the\nconfiguration of control plane components. The following table describes some of\nour decisions that might affect scoring of the CIS benchmarks:\n\nEvaluate GKE against the CIS Benchmarks\n---------------------------------------\n\n| **Note:** This section mentions third-party applications like `kube-bench`. The versions of the CIS Benchmarks that these applications evaluate might not be the latest available versions. Ensure that you check which version your chosen application uses for evaluations.\n\nYou can automate evaluation of your clusters against the Benchmarks by using one\nof the following methods:\n\n- CIS GKE Benchmark:\n - Run `kube-bench` to evaluate worker nodes against the Benchmark. For details, see the [kube-bench GitHub repository](https://github.com/aquasecurity/kube-bench).\n - Use a third-party tool like Twistlock Defender to evaluate nodes against the Benchmark.\n- CIS Kubernetes Benchmark: Run `kube-bench` to evaluate worker nodes against the Benchmark. You can't evaluate the managed control plane against those recommendations in the Benchmark.\n\nWhat's next\n-----------\n\n- Read the [GKE security overview](/kubernetes-engine/docs/concepts/security-overview).\n- Follow security best practices in the [GKE hardening guide](/kubernetes-engine/docs/how-to/hardening-your-cluster).\n- Learn about monitoring your clusters for security issues with [GKE security posture](/kubernetes-engine/docs/concepts/about-security-posture-dashboard).\n- Learn how to evaluate your clusters for compliance issues in the [GKE compliance dashboard](/kubernetes-engine/fleet-management/docs/about-compliance-dashboard) for GKE Enterprise."]]