{"data":{"slug":"github-google-skills-skills-cloud-gke-platform-security-f1d92ae85108","title":"Secure GKE Cluster with Platform-Level Hardening","summary":"Secures GKE clusters by enabling security add-ons, hardening RBAC, and enabling Shielded Nodes and GKE Sandbox. The deliverable includes hardened cluster configurations with audit-ready RBAC, enabled Secret Manager, and verifiable boot integrity via Shielded Nodes.","url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-gke-platform-security-f1d92ae85108","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-google-skills-skills-cloud-gke-platform-security-f1d92ae85108","markdown_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-gke-platform-security-f1d92ae85108.md","download_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-gke-platform-security-f1d92ae85108\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before executing any `gcloud`, REST API, or MCP command, you MUST read [Usage Attribution](references\/attribution.md). For commands executed directly in the terminal, prefix `gcloud` with `CLOUDSDK_METRICS_REQUEST_ATTRIBUTION=\"agent-skills\/1.0 (skill:gke-platform-security)\"` and append `agent-skills\/1.0 (skill:gke-platform-security)` to `User-Agent` headers.","instructions":"---\nname: gke-platform-security\ndescription: >-\n  Plans, configures, and hardens platform-level Google Kubernetes Engine (GKE)\n  cluster security. Covers cluster add-ons (Secret Manager enablement), RBAC\n  hardening (disabling insecure bindings, audit tools), Binary Authorization,\n  Secrets Encryption (--database-encryption-key), Security Posture (--security-posture),\n  enabling Shielded Nodes, GKE Sandbox cluster enablement, GKE IAM roles, and\n  cross-service authentication IAM patterns. Use when securing cluster control\n  planes, hardening GKE RBAC, enabling Shielded Nodes, enabling GKE Sandbox runtime,\n  enabling cluster-wide security add-ons, or managing GKE IAM roles. Don't use\n  for Workload Identity (use gke-workload-identity) or workload-level security\n  (SecretProviderClass, PSS, NetPol, gVisor pod runtimeClassName; use gke-workload-security).\nmetadata:\n  version: \"1.0.2\"\n  category: Security\n---\n\n# GKE Platform Security\n\nThis reference covers platform-level security hardening and cluster\nconfiguration for Google Kubernetes Engine (GKE). For workload-level security\ncontrols (such as Workload Identity Service Account bindings,\nSecretProviderClass volume mounts, Network Policies, and Pod Security\nStandards), refer to the `gke-workload-security` skill.\n\n> **MCP Tools:** `gke:get_cluster`, `k8s:check_k8s_auth`,\n> `k8s:get_k8s_resource`, `k8s:apply_k8s_manifest`, `gke:update_cluster`\n\n## Attribution\n\n**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you\nMUST read [Usage Attribution](references\/attribution.md). For commands executed\ndirectly in the terminal (never in generated scripts, Terraform, or user code),\nprefix `gcloud` with\n`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION=\"agent-skills\/1.0 (skill:gke-platform-security)\"`\nand append `agent-skills\/1.0 (skill:gke-platform-security)` to `User-Agent` headers.\n\n## Golden Path Security Defaults\n\nSetting                                                        | Golden Path Value                       | Day-0\/1 | Notes\n-------------------------------------------------------------- | --------------------------------------- | ------- | -----\n`workloadIdentityConfig.workloadPool`                          | `<PROJECT>.svc.id.goog`                 | Day-0   | Workload Identity Federation for cluster pods\n`secretManagerConfig.enabled`                                  | `true`                                  | Day-1   | Google Secret Manager cluster add-on integration\n`secretManagerConfig.rotationConfig`                           | `enabled: true, rotationInterval: 120s` | Day-1   | Automatic secret rotation at the cluster level\n`rbacBindingConfig.enableInsecureBindingSystemAuthenticated`   | `false`                                 | Day-0   | Blocks legacy `system:authenticated` bindings\n`rbacBindingConfig.enableInsecureBindingSystemUnauthenticated` | `false`                                 | Day-0   | Blocks legacy `system:unauthenticated` bindings\n`nodeConfig.shieldedInstanceConfig.enableSecureBoot`           | `true`                                  | Day-0   | Verifiable boot integrity\n`nodeConfig.shieldedInstanceConfig.enableIntegrityMonitoring`  | `true`                                  | Day-0   | Runtime integrity checks\n`nodeConfig.workloadMetadataConfig.mode`                       | `GKE_METADATA`                          | Day-0   | Blocks legacy metadata API, enforces Workload Identity\nPrivate cluster + Dataplane V2 settings                        | See the `gke-networking` skill          | Day-0   | Private nodes, private endpoint enforcement, ADVANCED_DATAPATH\n\n## Secret Manager Add-on Enablement\n\nThe golden path enables Secret Manager at the cluster level with automatic\nsecret rotation.\n\n```bash\n# Verify Secret Manager is enabled on cluster\ngcloud container clusters describe <CLUSTER_NAME> --region <REGION> \\\n  --format=\"value(secretManagerConfig.enabled)\" \\\n  --quiet\n\n# Enable if not already (Day-1 change)\ngcloud container clusters update <CLUSTER_NAME> --region <REGION> \\\n  --enable-secret-manager \\\n  --secret-manager-rotation-interval=120s \\\n  --quiet\n```\n\n> **Note:** For configuring `SecretProviderClass` manifests and mounting secrets\n> as volumes inside application deployments, see the `gke-workload-security`\n> skill.\n\n## RBAC Hardening\n\nThe golden path disables insecure legacy RBAC bindings that grant broad access\nto `system:authenticated` and `system:unauthenticated` groups.\n\n```bash\n# Verify insecure bindings are disabled\ngcloud container clusters describe <CLUSTER_NAME> --region <REGION> \\\n  --format=\"yaml(rbacBindingConfig)\" \\\n  --quiet\n```\n\n**Best practices for RBAC:**\n\n-   Use namespace-scoped Roles over cluster-wide ClusterRoles.\n-   Bind to specific Groups or ServiceAccounts, never to `system:authenticated`\n    or `system:unauthenticated`.\n-   Audit permissions via MCP: `k8s:check_k8s_auth(parent=\"...\", verb=\"list\",\n    resourceType=\"pods\", namespace=\"...\")` (or `kubectl auth can-i --list\n    --as=<user>`).\n-   Review bindings via MCP: `k8s:get_k8s_resource(parent=\"...\",\n    resourceType=\"clusterrolebinding\")` (or `kubectl get\n    clusterrolebindings,rolebindings --all-namespaces`).\n\n> See the `gke-multitenancy` skill for enterprise RBAC planning and\n> https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/best-practices\/rbac.md.txt\n\n## Binary Authorization\n\nNot enabled in golden path by default but recommended for enforcing production\nimage provenance across the cluster:\n\n```bash\n# Enable Binary Authorization\ngcloud container clusters update <CLUSTER_NAME> --region <REGION> \\\n  --binauthz-evaluation-mode=PROJECT_SINGLETON_POLICY_ENFORCE \\\n  --quiet\n```\n\n## Shielded Nodes & GKE Sandbox Enablement\n\nEnabling verifiable node boot integrity and kernel isolation features at the\ncluster level:\n\n```bash\n# Enable Shielded Nodes on an existing cluster\ngcloud container clusters update <CLUSTER_NAME> --region <REGION> \\\n  --enable-shielded-nodes \\\n  --quiet\n\n# Enable GKE Sandbox (gVisor) runtime on an existing cluster\ngcloud container clusters update <CLUSTER_NAME> --region <REGION> \\\n  --enable-gke-sandbox \\\n  --quiet\n```\n\n> **Note:** To run workloads inside the gVisor sandbox, specify\n> `runtimeClassName: gvisor` in your Pod specs as detailed in the\n> `gke-workload-security` skill.\n\n## Common IAM Roles\n\nThe five most common predefined IAM roles for GKE platform and cluster access:\n\n| Role                            | Purpose             | When to Use          |\n| ------------------------------- | ------------------- | -------------------- |\n| `roles\/container.admin`         | Full control over   | Platform team admins |\n:                                 : clusters and        : managing cluster     :\n:                                 : Kubernetes          : lifecycle            :\n:                                 : resources           :                      :\n| `roles\/container.clusterAdmin`  | Manage clusters but | Cluster operators    |\n:                                 : not project-level   : who create\/delete    :\n:                                 : IAM                 : clusters             :\n| `roles\/container.developer`     | Deploy workloads    | Application          |\n:                                 : (pods, services,    : developers deploying :\n:                                 : deployments)        : to existing clusters :\n| `roles\/container.viewer`        | Read-only access to | Monitoring,          |\n:                                 : clusters and        : auditing, or         :\n:                                 : Kubernetes          : read-only dashboards :\n:                                 : resources           :                      :\n| `roles\/container.clusterViewer` | List and get        | CI\/CD pipelines that |\n:                                 : cluster details     : need cluster         :\n:                                 : only                : metadata             :\n\n> **Principle of least privilege**: Start with `roles\/container.viewer` or\n> `roles\/container.developer` and escalate only as needed. Avoid granting\n> `roles\/container.admin` broadly across teams.\n\n## Service Accounts & Agents\n\n-   **GKE Service Agent**\n    (`service-<PROJECT_NUMBER>@container-engine-robot.iam.gserviceaccount.com`):\n    Automatically created. Manages nodes, networking, and cluster operations on\n    your behalf. Do not remove or modify its permissions.\n-   **Node Service Account**: By default, nodes use the Compute Engine default\n    service account. For production platforms, create a dedicated Google Service\n    Account with minimal required permissions (`roles\/monitoring.metricWriter`,\n    `roles\/logging.logWriter`) and assign it at node pool creation time.\n-   **Workload Identity**: For binding Google Service Accounts to Kubernetes\n    Service Accounts (`roles\/iam.workloadIdentityUser`), refer to the\n    `gke-workload-security` skill.\n\n## Cross-Service Authentication Patterns\n\nCommon project-level IAM policy binding patterns for granting backend Google\nService Accounts (GSAs) access to external Google Cloud services before linking\nvia Workload Identity:\n\n```bash\n# Grant a GSA access to Cloud Storage objects\ngcloud projects add-iam-policy-binding <PROJECT_ID> \\\n  --member \"serviceAccount:<GSA_NAME>@<PROJECT_ID>.iam.gserviceaccount.com\" \\\n  --role \"roles\/storage.objectViewer\" \\\n  --quiet\n\n# Grant a GSA access to Cloud SQL databases\ngcloud projects add-iam-policy-binding <PROJECT_ID> \\\n  --member \"serviceAccount:<GSA_NAME>@<PROJECT_ID>.iam.gserviceaccount.com\" \\\n  --role \"roles\/cloudsql.client\" \\\n  --quiet\n\n# Grant a GSA access to Pub\/Sub subscriptions\ngcloud projects add-iam-policy-binding <PROJECT_ID> \\\n  --member \"serviceAccount:<GSA_NAME>@<PROJECT_ID>.iam.gserviceaccount.com\" \\\n  --role \"roles\/pubsub.subscriber\" \\\n  --quiet\n\n## Resources\n\n- [GKE Cluster Hardening Guide](https:\/\/cloud.google.com\/kubernetes-engine\/docs\/how-to\/hardening-your-cluster)\n- [GKE RBAC Best Practices](https:\/\/cloud.google.com\/kubernetes-engine\/docs\/best-practices\/rbac)\n- [Secret Manager Add-on for GKE](https:\/\/cloud.google.com\/secret-manager\/docs\/secret-manager-managed-csi-component)\n- [Binary Authorization on GKE](https:\/\/cloud.google.com\/binary-authorization\/docs\/setting-up)\n- [Shielded GKE Nodes](https:\/\/cloud.google.com\/kubernetes-engine\/docs\/how-to\/shielded-gke-nodes)\n- [GKE Sandbox (gVisor)](https:\/\/cloud.google.com\/kubernetes-engine\/docs\/how-to\/sandbox-pods)\n```\n","use_cases":["Securing GKE cluster control planes","Hardening GKE RBAC configurations","Enabling Shielded Nodes for verifiable boot integrity","Enabling GKE Sandbox runtime for kernel isolation"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/google\/skills\/blob\/e3c591afe426ea585e4c21799e5199d6d47cd1be\/skills\/cloud\/gke-platform-security\/SKILL.md","source_commit":"e3c591afe426ea585e4c21799e5199d6d47cd1be","license":null,"version":null,"listing_approved_at":"2026-11-17","created_at":"2026-11-16T16:26:08.000000Z","updated_at":"2026-11-17T10:20:00.000000Z","seo_title":"Secure GKE Cluster with Platform-Level Hardening","seo_description":"Secure GKE clusters with platform-level hardening, including RBAC hardening, Shielded Nodes, and GKE Sandbox enablement.","seo_keywords":["secure GKE cluster","GKE RBAC hardening","Shielded Nodes GKE","GKE Sandbox enablement","GKE cluster security"]}}