Skip to main content
skill Claude Code Gemini CLI CX Codex official · Google

gke-platform-security — GKE skill: cluster security

This skill helps configure and harden Google Kubernetes Engine clusters, covering RBAC, Secret Manager, Shielded Nodes, and GKE Sandbox. Use it to review or change security settings at the platform level.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add google/skills --skill gke-platform-security -a claude-code
Open on GitHub

What gke-platform-security does

The skill covers cluster security settings: disabling insecure RBAC bindings, enabling Secret Manager with secret rotation, configuring Binary Authorization, and setting up secrets encryption and Security Posture. It also provides commands for Shielded Nodes and GKE Sandbox, plus Kubernetes and MCP tools for reviewing access.

Before running gcloud commands directly in a terminal, read references/attribution.md and add the required attribution to requests. That step is mandatory for direct command execution. Pods that run in the GKE Sandbox need runtimeClassName: gvisor in their specs.

This skill focuses on cluster-level configuration. Workload Identity and application-level controls are covered by gke-workload-identity and gke-workload-security; gke-multitenancy is referenced for enterprise RBAC planning. Check that distinction when the task concerns access or isolation for an individual Pod.

What it helps with

  • check whether Secret Manager and secret rotation are enabled
  • disable insecure RBAC bindings for broad user groups
  • enforce image provenance with Binary Authorization
  • enable Shielded Nodes or GKE Sandbox on a cluster
  • audit Kubernetes permissions with MCP or kubectl

Example prompts for the agent

  • Review RBAC in my GKE cluster and find bindings to `system:authenticated`.
  • Enable Secret Manager and secret rotation for cluster `<CLUSTER_NAME>` in region `<REGION>`.
  • Prepare the commands to enable Shielded Nodes and GKE Sandbox on the existing cluster.

How to install gke-platform-security

1Skills CLI (Vercel)

npx skills add google/skills --skill gke-platform-security -a claude-code

2Manually: put the files in place

~/.claude/skills/gke-platform-security/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/gke-platform-security/

From the same set172

The whole set →
bigquery-basics official google Manages BigQuery resources and runs SQL queries. Use it to create datasets, tables and views, or handle basic data ingestion and analysis. Claude Code Gemini CLI CX Codex 17,678installs cloud-run-basics official google This skill helps an agent manage Cloud Run services, jobs, and worker pools when a project needs HTTP deployment, scheduled work, or pull-based background processing. Claude Code Gemini CLI CX Codex 17,532installs gemini-api official google Connects Gemini API from Google Cloud Agent Platform to the agent. Gives access to Gemini models, multimodal input, function calling, and context caching. Claude Code Gemini CLI CX Codex 17,116installs google-cloud-recipe-auth official Google LLC This skill explains Google Cloud authentication and permissions. Use it when setting up IAM, ADC, or service accounts for local code and production workloads. Claude Code Gemini CLI CX Codex 15,450installs google-cloud-recipe-onboarding official Google LLC Guides a developer through a first Google Cloud project: CLI checks, sign-in, project setup and billing. It fits a personal first project. Claude Code Gemini CLI CX Codex 15,390installs cloud-sql-basics official google This skill helps create and explain Cloud SQL resources for MySQL, PostgreSQL, and SQL Server. Use it when setting up a database in Google Cloud. Claude Code Gemini CLI CX Codex 14,679installs google-cloud-waf-security official google This skill reviews Google Cloud workloads against the security pillar of the Well-Architected Framework and suggests actions for IAM, networks, data, and operations. Claude Code Gemini CLI CX Codex 14,620installs google-cloud-waf-cost-optimization official google Reviews Google Cloud workloads through the Well-Architected Cost Optimization pillar. Use it to inspect spending, resize resources, assess discounts, or find idle capacity. Claude Code Gemini CLI CX Codex 14,266installs

Similar

firebase-security-rules-auditor Google LLC Audits Firebase rules for data leaks, privilege escalation, and validation gaps. Use it when reviewing Firestore or Cloud Storage access. Claude Code CX Codex Cursor +1 138,200installs cloud-sync thedotmack Syncs your claude-mem database with cmem.ai Pro cloud storage. Checks sync status, manages the connection, and uploads observation narratives to the server. Claude Code CX Codex Cursor +1 2,100installs solidity-security Seth Hobson This skill helps write and audit Solidity contracts against common vulnerabilities. Use it for DeFi work, security checks, and audit preparation. Claude Code CX Codex Cursor 15,382installs compliance-check official anthropics Skill surfaces applicable regulations, required approvals, and risk areas for any action, product feature, or business initiative. Use before launching anything that touches personal data or has cross-border implications. Claude Code CX Codex Cursor +1 3,300installs risk-assessment official anthropics Identifies, evaluates, and plans mitigations for operational risks across projects, vendors, and decisions. It generates a prioritized register with assigned owners. Claude Code CX Codex Cursor +1 3,300installs git-guardrails-claude-code Matt Pocock This skill adds a Claude Code hook that stops risky Git commands before they run. Use it when an agent must not push or discard working-tree changes. Claude Code 499,069installs ponytail-review DietrichGebert ponytail-review reviews a change beyond the diff, checking connected code, bugs, risks, load, tests, speed, and unnecessary code. Use it for PRs and commits. Claude Code CX Codex Cursor +1 56,300installs ponytail-audit DietrichGebert It audits a repository and ranks bugs, risks, and redundant code in a one-shot report. Use it when you need a review without code changes. Claude Code CX Codex Cursor +1 44,800installs

Questions about gke-platform-security

How do I install gke-platform-security in Claude Code?

Run npx skills add google/skills --skill gke-platform-security -a claude-code. The skill will be available at ~/.claude/skills/gke-platform-security/SKILL.md.

What does gke-platform-security do?

It helps review and configure GKE cluster security, including RBAC, Secret Manager, Binary Authorization, Shielded Nodes, and GKE Sandbox. It also describes Kubernetes and MCP tools for access audits.

What should I do before running gcloud commands?

Read references/attribution.md first. For commands executed directly in a terminal, the skill requires attribution in the CLOUDSDK_METRICS_REQUEST_ATTRIBUTION environment variable and the User-Agent header.

Source text

SKILL.md · Apache-2.0
---
name: gke-platform-security
description: >-
  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,
  Secrets Encryption (--database-encryption-key), Security Posture (--security-posture),
  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 Identity (use gke-workload-identity) or workload-level security
  (SecretProviderClass, PSS, NetPol, gVisor pod runtimeClassName; use gke-workload-security).
metadata:
  version: "1.0.2"
  category: Security
---

# GKE Platform Security

This reference covers platform-level security hardening and cluster
configuration for Google Kubernetes Engine (GKE). For workload-level security
controls (such as Workload Identity Service Account bindings,
SecretProviderClass volume mounts, Network Policies, and Pod Security
Standards), refer to the `gke-workload-security` skill.

> **MCP Tools:** `gke:get_cluster`, `k8s:check_k8s_auth`,
> `k8s:get_k8s_resource`, `k8s:apply_k8s_manifest`, `gke:update_cluster`

## Attribution

**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
MUST read [Usage Attribution](references/attribution.md). For commands executed
directly in the terminal (never in generated scripts, Terraform, or user code),
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.

## Golden Path Security Defaults

Setting                                                        | Golden Path Value                       | Day-0/1 | Notes
-------------------------------------------------------------- | --------------------------------------- | ------- | -----
`workloadIdentityConfig.workloadPool`                          | `<PROJECT>.svc.id.goog`                 | Day-0   | Workload Identity Federation for cluster pods
`secretManagerConfig.enabled`                                  | `true`                                  | Day-1   | Google Secret Manager cluster add-on integration
`secretManagerConfig.rotationConfig`                           | `enabled: true, rotationInterval: 120s` | Day-1   | Automatic secret rotation at the cluster level
`rbacBindingConfig.enableInsecureBindingSystemAuthenticated`   | `false`                                 | Day-0   | Blocks legacy `system:authenticated` bindings
`rbacBindingConfig.enableInsecureBindingSystemUnauthenticated` | `false`                                 | Day-0   | Blocks legacy `system:unauthenticated` bindings
`nodeConfig.shieldedInstanceConfig.enableSecureBoot`           | `true`                                  | Day-0   | Verifiable boot integrity
`nodeConfig.shieldedInstanceConfig.enableIntegrityMonitoring`  | `true`                                  | Day-0   | Runtime integrity checks
`nodeConfig.workloadMetadataConfig.mode`                       | `GKE_METADATA`                          | Day-0   | Blocks legacy metadata API, enforces Workload Identity
Private cluster + Dataplane V2 settings                        | See the `gke-networking` skill          | Day-0   | Private nodes, private endpoint enforcement, ADVANCED_DATAPATH

## Secret Manager Add-on Enablement

The golden path enables Secret Manager at the cluster level with automatic
secret rotation.

```bash
# 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 \
  --quiet
```

> **Note:** For configuring `SecretProviderClass` manifests and mounting secrets
> as volumes inside application deployments, see the `gke-workload-security`
> skill.

## RBAC Hardening

The golden path disables insecure legacy RBAC bindings that grant broad access
to `system:authenticated` and `system:unauthenticated` groups.

```bash
# Verify insecure bindings are disabled
gcloud container clusters describe <CLUSTER_NAME> --region <REGION> \
  --format="yaml(rbacBindingConfig)" \
  --quiet
```

**Best practices for RBAC:**

-   Use namespace-scoped Roles over cluster-wide ClusterRoles.
-   Bind to specific Groups or ServiceAccounts, never to `system:authenticated`
    or `system:unauthenticated`.
-   Audit permissions via MCP: `k8s:check_k8s_auth(parent="...", verb="list",
    resourceType="pods", namespace="...")` (or `kubectl auth can-i --list
    --as=<user>`).
-   Review bindings via MCP: `k8s:get_k8s_resource(parent="...",
    resourceType="clusterrolebinding")` (or `kubectl get
    clusterrolebindings,rolebindings --all-namespaces`).

> See the `gke-multitenancy` skill for enterprise RBAC planning and
> https://docs.cloud.google.com/kubernetes-engine/docs/best-practices/rbac.md.txt

## Binary Authorization

Not enabled in golden path by default but recommended for enforcing production
image provenance across the cluster:

```bash
# Enable Binary Authorization
gcloud container clusters update <CLUSTER_NAME> --region <REGION> \
  --binauthz-evaluation-mode=PROJECT_SINGLETON_POLICY_ENFORCE \
  --quiet
```

## Shielded Nodes & GKE Sandbox Enablement

Enabling verifiable node boot integrity and kernel isolation features at the
cluster level:

```bash
# 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 \
  --quiet
```

> **Note:** To run workloads inside the gVisor sandbox, specify
> `runtimeClassName: gvisor` in your Pod specs as detailed in the
> `gke-workload-security` skill.

## Common IAM Roles

The five most common predefined IAM roles for GKE platform and cluster access:

| Role                            | Purpose             | When to Use          |
| ------------------------------- | ------------------- | -------------------- |
| `roles/container.admin`         | Full control over   | Platform team admins |
:                                 : clusters and        : managing cluster     :
:                                 : Kubernetes          : lifecycle            :
:                                 : resources           :                      :
| `roles/container.clusterAdmin`  | Manage clusters but | Cluster operators    |
:                                 : not project-level   : who create/delete    :
:                                 : IAM                 : clusters             :
| `roles/container.developer`     | Deploy workloads    | Application          |
:                                 : (pods, services,    : developers deploying :
:                                 : deployments)        : to existing clusters :
| `roles/container.viewer`        | Read-only access to | Monitoring,          |
:                                 : clusters and        : auditing, or         :
:                                 : Kubernetes          : read-only dashboards :
:                                 : resources           :                      :
| `roles/container.clusterViewer` | List and get        | CI/CD pipelines that |
:                                 : cluster details     : need cluster         :
:                                 : only                : metadata             :

> **Principle of least privilege**: Start with `roles/container.viewer` or
> `roles/container.developer` and escalate only as needed. Avoid granting
> `roles/container.admin` broadly across teams.

## Service Accounts & Agents

-   **GKE Service Agent**
    (`service-<PROJECT_NUMBER>@container-engine-robot.iam.gserviceaccount.com`):
    Automatically created. Manages nodes, networking, and cluster operations on
    your behalf. Do not remove or modify its permissions.
-   **Node Service Account**: By default, nodes use the Compute Engine default
    service account. For production platforms, create a dedicated Google Service
    Account with minimal required permissions (`roles/monitoring.metricWriter`,
    `roles/logging.logWriter`) and assign it at node pool creation time.
-   **Workload Identity**: For binding Google Service Accounts to Kubernetes
    Service Accounts (`roles/iam.workloadIdentityUser`), refer to the
    `gke-workload-security` skill.

## Cross-Service Authentication Patterns

Common project-level IAM policy binding patterns for granting backend Google
Service Accounts (GSAs) access to external Google Cloud services before linking
via Workload Identity:

```bash
# 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/secret-manager/docs/secret-manager-managed-csi-component)
- [Binary Authorization on GKE](https://cloud.google.com/binary-authorization/docs/setting-up)
- [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/how-to/sandbox-pods)
```

© google · Apache-2.0 · google/skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor