Loading...
Loading...
Plans, configures, and hardens platform-level Google Kubernetes Engine (GKE) cluster security. Covers cluster add-ons (Secret Manager enablement), RBAC hardening (disabling insecure bindings, audit tools), Binary Authorization, enabling Shielded Nodes, GKE Sandbox cluster enablement, GKE IAM roles, and cross-service authentication IAM patterns. Use when securing cluster control planes, hardening GKE RBAC, enabling Shielded Nodes, enabling GKE Sandbox runtime, enabling cluster-wide security add-ons, or managing GKE IAM roles. Don't use for workload-level security (Workload Identity, SecretProviderClass, PSS, NetPol, gVisor pod runtimeClassName; use gke-workload-security instead).
npx skill4agent add google/skills gke-platform-securitygke-workload-securityMCP Tools:,gke:get_cluster,k8s:check_k8s_auth,k8s:get_k8s_resource,k8s:apply_k8s_manifestgke:update_cluster
| Setting | Golden Path Value | Day-0/1 | Notes |
|---|---|---|---|
| | Day-0 | Workload Identity Federation for cluster pods |
| | Day-1 | Google Secret Manager cluster add-on integration |
| | Day-1 | Automatic secret rotation at the cluster level |
| | Day-0 | Blocks legacy |
| | Day-0 | Blocks legacy |
| | Day-0 | Verifiable boot integrity |
| | Day-0 | Runtime integrity checks |
| | Day-0 | Blocks legacy metadata API, enforces Workload Identity |
| Private cluster + Dataplane V2 settings | See the | Day-0 | Private nodes, private endpoint enforcement, ADVANCED_DATAPATH |
# Verify Secret Manager is enabled on cluster
gcloud container clusters describe <CLUSTER_NAME> --region <REGION> \
--format="value(secretManagerConfig.enabled)" \
--quiet
# Enable if not already (Day-1 change)
gcloud container clusters update <CLUSTER_NAME> --region <REGION> \
--enable-secret-manager \
--secret-manager-rotation-interval=120s \
--quietNote: For configuringmanifests and mounting secrets as volumes inside application deployments, see theSecretProviderClassskill.gke-workload-security
system:authenticatedsystem:unauthenticated# Verify insecure bindings are disabled
gcloud container clusters describe <CLUSTER_NAME> --region <REGION> \
--format="yaml(rbacBindingConfig)" \
--quietsystem:authenticatedsystem:unauthenticatedk8s:check_k8s_auth(parent="...", verb="list", resourceType="pods", namespace="...")kubectl auth can-i --list --as=<user>k8s:get_k8s_resource(parent="...", resourceType="clusterrolebinding")kubectl get clusterrolebindings,rolebindings --all-namespacesSee theskill for enterprise RBAC planning and https://docs.cloud.google.com/kubernetes-engine/docs/best-practices/rbac.md.txtgke-multitenancy
# Enable Binary Authorization
gcloud container clusters update <CLUSTER_NAME> --region <REGION> \
--binauthz-evaluation-mode=PROJECT_SINGLETON_POLICY_ENFORCE \
--quiet# Enable Shielded Nodes on an existing cluster
gcloud container clusters update <CLUSTER_NAME> --region <REGION> \
--enable-shielded-nodes \
--quiet
# Enable GKE Sandbox (gVisor) runtime on an existing cluster
gcloud container clusters update <CLUSTER_NAME> --region <REGION> \
--enable-gke-sandbox \
--quietNote: To run workloads inside the gVisor sandbox, specifyin your Pod specs as detailed in theruntimeClassName: gvisorskill.gke-workload-security
| Role | Purpose | When to Use |
|---|---|---|
| Full control over | Platform team admins |
| : : clusters and : managing cluster : | ||
| : : Kubernetes : lifecycle : | ||
| : : resources : : | ||
| Manage clusters but | Cluster operators |
| : : not project-level : who create/delete : | ||
| : : IAM : clusters : | ||
| Deploy workloads | Application |
| : : (pods, services, : developers deploying : | ||
| : : deployments) : to existing clusters : | ||
| Read-only access to | Monitoring, |
| : : clusters and : auditing, or : | ||
| : : Kubernetes : read-only dashboards : | ||
| : : resources : : | ||
| List and get | CI/CD pipelines that |
| : : cluster details : need cluster : | ||
| : : only : metadata : |
Principle of least privilege: Start withorroles/container.viewerand escalate only as needed. Avoid grantingroles/container.developerbroadly across teams.roles/container.admin
service-<PROJECT_NUMBER>@container-engine-robot.iam.gserviceaccount.comroles/monitoring.metricWriterroles/logging.logWriterroles/iam.workloadIdentityUsergke-workload-security# Grant a GSA access to Cloud Storage objects
gcloud projects add-iam-policy-binding <PROJECT_ID> \
--member "serviceAccount:<GSA_NAME>@<PROJECT_ID>.iam.gserviceaccount.com" \
--role "roles/storage.objectViewer" \
--quiet
# Grant a GSA access to Cloud SQL databases
gcloud projects add-iam-policy-binding <PROJECT_ID> \
--member "serviceAccount:<GSA_NAME>@<PROJECT_ID>.iam.gserviceaccount.com" \
--role "roles/cloudsql.client" \
--quiet
# Grant a GSA access to Pub/Sub subscriptions
gcloud projects add-iam-policy-binding <PROJECT_ID> \
--member "serviceAccount:<GSA_NAME>@<PROJECT_ID>.iam.gserviceaccount.com" \
--role "roles/pubsub.subscriber" \
--quiet
## Resources
- [GKE Cluster Hardening Guide](https://cloud.google.com/kubernetes-engine/docs/how-to/hardening-your-cluster)
- [GKE RBAC Best Practices](https://cloud.google.com/kubernetes-engine/docs/best-practices/rbac)
- [Secret Manager Add-on for GKE](https://cloud.google.com/kubernetes-engine/docs/how-to/secret-manager)
- [Binary Authorization on GKE](https://cloud.google.com/binary-authorization/docs/getting-started-gke)
- [Shielded GKE Nodes](https://cloud.google.com/kubernetes-engine/docs/how-to/shielded-gke-nodes)
- [GKE Sandbox (gVisor)](https://cloud.google.com/kubernetes-engine/docs/concepts/sandbox)