[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78C768KB8PBFW8R9X6V3PPP":3,"skill-same:01M78C768KB8PBFW8R9X6V3PPP":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":14,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M78C768KB8PBFW8R9X6V3PPP","gke-security",null,"Plans, configures, and hardens Google Kubernetes Engine (GKE) security. Covers Workload Identity Federation, Secret Manager integration, RBAC hardening, Binary Authorization, Network Policies (Dataplane V2), Pod Security Standards, and IAM roles. Use when securing GKE clusters, setting up Workload Identity, hardening RBAC configurations, or configuring GKE secrets. Don't use for general network routing configuration (use gke-networking instead).","Solizardking\u002Fskillhub-main","Solizardking","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F108096810?v=4","01M786KDB10AYV042N0F9BD5B5","Clawd","01M786NYYXSZK1D05WM8JQPC48",0,"MIT","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fgoogle\u002Fcloud\u002Fgke-security\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: gke-security\ndescription: >-\n  Plans, configures, and hardens Google Kubernetes Engine (GKE) security.\n  Covers Workload Identity Federation, Secret Manager integration, RBAC\n  hardening, Binary Authorization, Network Policies (Dataplane V2), Pod\n  Security Standards, and IAM roles. Use when securing GKE clusters, setting up\n  Workload Identity, hardening RBAC configurations, or configuring GKE secrets.\n  Don't use for general network routing configuration (use gke-networking instead).\nmetadata:\n  category: Security\n---\n\n# GKE Security\n\nThis reference covers security configuration for GKE clusters. The golden path\nenforces a hardened security posture by default.\n\n> **MCP Tools:** `get_cluster`, `check_k8s_auth`, `get_k8s_resource`,\n> `apply_k8s_manifest`, `update_cluster`\n\n## Golden Path Security Defaults\n\nSetting                                                        | Golden Path Value                       | Day-0\u002F1 | Notes\n-------------------------------------------------------------- | --------------------------------------- | ------- | -----\n`workloadIdentityConfig.workloadPool`                          | `\u003CPROJECT>.svc.id.goog`                 | Day-0   | Workload Identity Federation for Pods\n`secretManagerConfig.enabled`                                  | `true`                                  | Day-1   | Google Secret Manager integration\n`secretManagerConfig.rotationConfig`                           | `enabled: true, rotationInterval: 120s` | Day-1   | Automatic secret rotation\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## Workload Identity Federation\n\nWorkload Identity is the recommended way for pods to access Google Cloud APIs.\nIt eliminates the need for static service account keys.\n\n### Setup\n\n```bash\n# 1. Create a Google Service Account (GSA)\ngcloud iam service-accounts create \u003CGSA_NAME> \\\n  --project \u003CPROJECT_ID> \\\n  --display-name \"Workload Identity SA\" \\\n  --quiet\n\n# 2. Grant IAM roles to the GSA\ngcloud projects add-iam-policy-binding \u003CPROJECT_ID> \\\n  --member \"serviceAccount:\u003CGSA_NAME>@\u003CPROJECT_ID>.iam.gserviceaccount.com\" \\\n  --role \"\u003CROLE>\" \\\n  --quiet\n\n# 3. Create Kubernetes Service Account (KSA)\nkubectl create namespace \u003CNAMESPACE>\nkubectl create serviceaccount \u003CKSA_NAME> --namespace \u003CNAMESPACE>\n\n# 4. Bind KSA to GSA\ngcloud iam service-accounts add-iam-policy-binding \\\n  \u003CGSA_NAME>@\u003CPROJECT_ID>.iam.gserviceaccount.com \\\n  --role roles\u002Fiam.workloadIdentityUser \\\n  --member \"serviceAccount:\u003CPROJECT_ID>.svc.id.goog[\u003CNAMESPACE>\u002F\u003CKSA_NAME>]\" \\\n  --quiet\n\n# 5. Annotate KSA\nkubectl annotate serviceaccount \u003CKSA_NAME> \\\n  --namespace \u003CNAMESPACE> \\\n  iam.gke.io\u002Fgcp-service-account=\u003CGSA_NAME>@\u003CPROJECT_ID>.iam.gserviceaccount.com\n```\n\n> See [assets\u002Fworkload-identity-pod.yaml](.\u002Fassets\u002Fworkload-identity-pod.yaml)\n> for a test pod.\n\n### Verification\n\n```bash\nkubectl run workload-identity-test \\\n  --image=gcr.io\u002Fgoogle.com\u002Fcloudsdktool\u002Fcloud-sdk:slim \\\n  --serviceaccount=\u003CKSA_NAME> --namespace=\u003CNAMESPACE> \\\n  --rm -it -- gcloud auth list --quiet\n```\n\n## Secret Manager Integration\n\nThe golden path enables Secret Manager with automatic rotation. Secrets are\nsynced to Kubernetes Secrets.\n\n```bash\n# Verify Secret Manager is enabled on cluster\ngcloud container clusters describe \u003CCLUSTER_NAME> --region \u003CREGION> \\\n  --format=\"value(secretManagerConfig.enabled)\" \\\n  --quiet\n\n# Enable if not already (Day-1 change)\ngcloud container clusters update \u003CCLUSTER_NAME> --region \u003CREGION> \\\n  --enable-secret-manager \\\n  --secret-manager-rotation-interval=120s \\\n  --quiet\n```\n\n### Mounting Secrets via CSI Volume (Deployment Example)\n\nOnce the Secret Manager add-on is enabled, workloads can mount secrets as\nvolumes using the Secrets Store CSI driver. This requires two steps:\n\n1.  **Define a `SecretProviderClass`** to specify which secrets to retrieve from\n    Secret Manager.\n2.  **Mount the volume in a `Deployment`** referencing that class.\n\n> [!IMPORTANT] **Production Best Practice**: Always demonstrate workload\n> integrations (like Secret Manager CSI) using production-standard\n> **`Deployment`** manifests rather than raw `Pod` manifests.\n\n#### Step 1: Create the SecretProviderClass\n\n```yaml\napiVersion: secrets-store.csi.x-k8s.io\u002Fv1\nkind: SecretProviderClass\nmetadata:\n  name: app-secrets-provider\n  namespace: default\nspec:\n  provider: gke  # Identifies GKE managed provider\n  parameters:\n    secrets: |\n      - resourceName: \"projects\u002F\u003CPROJECT_ID>\u002Fsecrets\u002Fdb-password\u002Fversions\u002Flatest\"\n        fileName: \"db-password.txt\"\n```\n\n#### Step 2: Mount the secret in a Deployment\n\n```yaml\napiVersion: apps\u002Fv1\nkind: Deployment\nmetadata:\n  name: secure-app\n  namespace: default\nspec:\n  replicas: 2\n  selector:\n    matchLabels:\n      app: secure-app\n  template:\n    metadata:\n      labels:\n        app: secure-app\n    spec:\n      serviceAccountName: secure-ksa  # Must be bound to GSA with Secret Manager Secret Accessor role\n      containers:\n      - name: app\n        image: \u003CIMAGE>\n        volumeMounts:\n        - name: secrets-volume\n          mountPath: \"\u002Fvar\u002Fsecrets\"\n          readOnly: true\n      volumes:\n      - name: secrets-volume\n        csi:\n          driver: secrets-store.csi.k8s.io\n          readOnly: true\n          volumeAttributes:\n            secretProviderClass: \"app-secrets-provider\"\n```\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 \u003CCLUSTER_NAME> --region \u003CREGION> \\\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-   Audit permissions via MCP: `check_k8s_auth(parent=\"...\", verb=\"list\",\n    resourceType=\"pods\", namespace=\"...\")` (or `kubectl auth can-i --list\n    --as=\u003Cuser>`)\n-   Review bindings via MCP: `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:\u002F\u002Fdocs.cloud.google.com\u002Fkubernetes-engine\u002Fdocs\u002Fbest-practices\u002Frbac.md.txt\n\n## Binary Authorization\n\nNot enabled in golden path by default but recommended for production image\nprovenance:\n\n```bash\n# Enable Binary Authorization\ngcloud container clusters update \u003CCLUSTER_NAME> --region \u003CREGION> \\\n  --binauthz-evaluation-mode=PROJECT_SINGLETON_POLICY_ENFORCE \\\n  --quiet\n```\n\n## Network Policies\n\nDataplane V2 (golden path) provides built-in Network Policy enforcement. Apply\ndefault-deny per namespace:\n\n```\n# MCP (preferred)\napply_k8s_manifest(parent=\"...\", yamlManifest=\"\u003Ccontents of default-deny-netpol.yaml>\")\n\n# kubectl fallback\nkubectl apply -f .\u002Fassets\u002Fdefault-deny-netpol.yaml -n \u003CNAMESPACE>\n```\n\n## GKE Sandbox (gVisor)\n\nFor running untrusted workloads in an isolated sandbox:\n\n```bash\n# Enable on cluster (Standard clusters)\ngcloud container clusters update \u003CCLUSTER_NAME> --region \u003CREGION> --enable-gke-sandbox --quiet\n\n# Use in pod spec\n# Add: runtimeClassName: gvisor\n```\n\n## Pod Security Standards (Golden Path)\n\nPod Security Standards define three profiles that restrict what pods can do. The\n**`restricted` profile is the golden path default** for production namespaces.\n\n| Profile      | Level                 | Use Case                           |\n| ------------ | --------------------- | ---------------------------------- |\n| `privileged` | Unrestricted          | System namespaces (`kube-system`), |\n:              :                       : infrastructure controllers         :\n| `baseline`   | Minimally restrictive | Shared\u002Fdev namespaces, legacy apps |\n:              :                       : being migrated                     :\n| `restricted` | **Golden path**       | Production workloads -- blocks     |\n:              :                       : privilege escalation, host access, :\n:              :                       : root                               :\n\n**Enforce via namespace labels (Pod Security Admission):**\n\n```yaml\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: production\n  labels:\n    pod-security.kubernetes.io\u002Fenforce: restricted\n    pod-security.kubernetes.io\u002Fwarn: restricted\n    pod-security.kubernetes.io\u002Faudit: restricted\n```\n\n**Gradual rollout strategy:**\n\n1.  Start with `warn` + `audit` on existing namespaces to identify violations\n2.  Fix non-compliant workloads (remove `privileged`, `hostNetwork`, root user,\n    etc.)\n3.  Enable `enforce` once all workloads pass\n\n`restricted` blocks: running as root, privilege escalation, host\nnetworking\u002FPID\u002FIPC, host path volumes, and most capabilities. The golden path\n`workload-identity-pod.yaml` already complies.\n\n## Network Policy Logging (Recommended)\n\nWith Dataplane V2 (golden path), you can enable logging for Network Policy\ndecisions. **Not a golden path default** -- recommended for security auditing.\n\n```bash\ngcloud container clusters update \u003CCLUSTER_NAME> --region \u003CREGION> \\\n  --enable-network-policy-logging \\\n  --quiet\n```\n\nThis logs allowed and denied connections, useful for troubleshooting Network\nPolicy rules and auditing traffic flows.\n\n## Common IAM Roles\n\nThe five most common predefined IAM roles for GKE:\n\n| Role                            | Purpose             | When to Use          |\n| ------------------------------- | ------------------- | -------------------- |\n| `roles\u002Fcontainer.admin`         | Full control over   | Platform team admins |\n:                                 : clusters and        : managing cluster     :\n:                                 : Kubernetes          : lifecycle            :\n:                                 : resources           :                      :\n| `roles\u002Fcontainer.clusterAdmin`  | Manage clusters but | Cluster operators    |\n:                                 : not project-level   : who create\u002Fdelete    :\n:                                 : IAM                 : clusters             :\n| `roles\u002Fcontainer.developer`     | Deploy workloads    | Application          |\n:                                 : (pods, services,    : developers deploying :\n:                                 : deployments)        : to existing clusters :\n| `roles\u002Fcontainer.viewer`        | Read-only access to | Monitoring,          |\n:                                 : clusters and        : auditing, or         :\n:                                 : Kubernetes          : read-only dashboards :\n:                                 : resources           :                      :\n| `roles\u002Fcontainer.clusterViewer` | List and get        | CI\u002FCD pipelines that |\n:                                 : cluster details     : need cluster         :\n:                                 : only                : metadata             :\n\n> **Principle of least privilege**: Start with `roles\u002Fcontainer.viewer` or\n> `roles\u002Fcontainer.developer` and escalate only as needed. Avoid granting\n> `roles\u002Fcontainer.admin` broadly.\n\n## Service Accounts & Agents\n\n-   **GKE Service Agent**\n    (`service-\u003CPROJECT_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, create a dedicated SA with minimal\n    permissions and assign it via node pool config.\n-   **Workload Identity**: The recommended way for pods to access Google Cloud\n    APIs. Maps a Kubernetes ServiceAccount to a Google IAM ServiceAccount — see\n    [Workload Identity setup](#workload-identity-federation) above.\n\n## Cross-Service Authentication Patterns\n\nCommon patterns for granting GKE workloads access to other Google Cloud\nservices:\n\n```bash\n# Grant a GKE workload access to Cloud Storage\ngcloud projects add-iam-policy-binding \u003CPROJECT_ID> \\\n  --member \"serviceAccount:\u003CGSA_NAME>@\u003CPROJECT_ID>.iam.gserviceaccount.com\" \\\n  --role \"roles\u002Fstorage.objectViewer\" \\\n  --quiet\n\n# Grant a GKE workload access to Cloud SQL\ngcloud projects add-iam-policy-binding \u003CPROJECT_ID> \\\n  --member \"serviceAccount:\u003CGSA_NAME>@\u003CPROJECT_ID>.iam.gserviceaccount.com\" \\\n  --role \"roles\u002Fcloudsql.client\" \\\n  --quiet\n\n# Grant a GKE workload access to Pub\u002FSub\ngcloud projects add-iam-policy-binding \u003CPROJECT_ID> \\\n  --member \"serviceAccount:\u003CGSA_NAME>@\u003CPROJECT_ID>.iam.gserviceaccount.com\" \\\n  --role \"roles\u002Fpubsub.subscriber\" \\\n  --quiet\n```\n\nIn all cases, the GSA must be bound to a KSA via Workload Identity (see setup\nabove). The pod then uses the KSA to authenticate as the GSA.\n","# GKE Security\n\nThis reference covers security configuration for GKE clusters. The golden path\nenforces a hardened security posture by default.\n\n> **MCP Tools:** `get_cluster`, `check_k8s_auth`, `get_k8s_resource`,\n> `apply_k8s_manifest`, `update_cluster`\n\n## Golden Path Security Defaults\n\nSetting                                                        | Golden Path Value                       | Day-0\u002F1 | Notes\n-------------------------------------------------------------- | --------------------------------------- | ------- | -----\n`workloadIdentityConfig.workloadPool`                          | `\u003CPROJECT>.svc.id.goog`                 | Day-0   | Workload Identity Federation for Pods\n`secretManagerConfig.enabled`                                  | `true`                                  | Day-1   | Google Secret Manager integration\n`secretManagerConfig.rotationConfig`                           | `enabled: true, rotationInterval: 120s` | Day-1   | Automatic secret rotation\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## Workload Identity Federation\n\nWorkload Identity is the recommended way for pods to access Google Cloud APIs.\nIt eliminates the need for static service account keys.\n\n### Setup\n\n```bash\n# 1. Create a Google Service Account (GSA)\ngcloud iam service-accounts create \u003CGSA_NAME> \\\n  --project \u003CPROJECT_ID> \\\n  --display-name \"Workload Identity SA\" \\\n  --quiet\n\n# 2. Grant IAM roles to the GSA\ngcloud projects add-iam-policy-binding \u003CPROJECT_ID> \\\n  --member \"serviceAccount:\u003CGSA_NAME>@\u003CPROJECT_ID>.iam.gserviceaccount.com\" \\\n  --role \"\u003CROLE>\" \\\n  --quiet\n\n# 3. Create Kubernetes Service Account (KSA)\nkubectl create namespace \u003CNAMESPACE>\nkubectl create serviceaccount \u003CKSA_NAME> --namespace \u003CNAMESPACE>\n\n# 4. Bind KSA to GSA\ngcloud iam service-accounts add-iam-policy-binding \\\n  \u003CGSA_NAME>@\u003CPROJECT_ID>.iam.gserviceaccount.com \\\n  --role roles\u002Fiam.workloadIdentityUser \\\n  --member \"serviceAccount:\u003CPROJECT_ID>.svc.id.goog[\u003CNAMESPACE>\u002F\u003CKSA_NAME>]\" \\\n  --quiet\n\n# 5. Annotate KSA\nkubectl annotate serviceaccount \u003CKSA_NAME> \\\n  --namespace \u003CNAMESPACE> \\\n  iam.gke.io\u002Fgcp-service-account=\u003CGSA_NAME>@\u003CPROJECT_ID>.iam.gserviceaccount.com\n```\n\n> See [assets\u002Fworkload-identity-pod.yaml](.\u002Fassets\u002Fworkload-identity-pod.yaml)\n> for a test pod.\n\n### Verification\n\n```bash\nkubectl run workload-identity-test \\\n  --image=gcr.io\u002Fgoogle.com\u002Fcloudsdktool\u002Fcloud-sdk:slim \\\n  --serviceaccount=\u003CKSA_NAME> --namespace=\u003CNAMESPACE> \\\n  --rm -it -- gcloud auth list --quiet\n```\n\n## Secret Manager Integration\n\nThe golden path enables Secret Manager with automatic rotation. Secrets are\nsynced to Kubernetes Secrets.\n\n```bash\n# Verify Secret Manager is enabled on cluster\ngcloud container clusters describe \u003CCLUSTER_NAME> --region \u003CREGION> \\\n  --format=\"value(secretManagerConfig.enabled)\" \\\n  --quiet\n\n# Enable if not already (Day-1 change)\ngcloud container clusters update \u003CCLUSTER_NAME> --region \u003CREGION> \\\n  --enable-secret-manager \\\n  --secret-manager-rotation-interval=120s \\\n  --quiet\n```\n\n### Mounting Secrets via CSI Volume (Deployment Example)\n\nOnce the Secret Manager add-on is enabled, workloads can mount secrets as\nvolumes using the Secrets Store CSI driver. This requires two steps:\n\n1.  **Define a `SecretProviderClass`** to specify which secrets to retrieve from\n    Secret Manager.\n2.  **Mount the volume in a `Deployment`** referencing that class.\n\n> [!IMPORTANT] **Production Best Practice**: Always demonstrate workload\n> integrations (like Secret Manager CSI) using production-standard\n> **`Deployment`** manifests rather than raw `Pod` manifests.\n\n#### Step 1: Create the SecretProviderClass\n\n```yaml\napiVersion: secrets-store.csi.x-k8s.io\u002Fv1\nkind: SecretProviderClass\nmetadata:\n  name: app-secrets-provider\n  namespace: default\nspec:\n  provider: gke  # Identifies GKE managed provider\n  parameters:\n    secrets: |\n      - resourceName: \"projects\u002F\u003CPROJECT_ID>\u002Fsecrets\u002Fdb-password\u002Fversions\u002Flatest\"\n        fileName: \"db-password.txt\"\n```\n\n#### Step 2: Mount the secret in a Deployment\n\n```yaml\napiVersion: apps\u002Fv1\nkind: Deployment\nmetadata:\n  name: secure-app\n  namespace: default\nspec:\n  replicas: 2\n  selector:\n    matchLabels:\n      app: secure-app\n  template:\n    metadata:\n      labels:\n        app: secure-app\n    spec:\n      serviceAccountName: secure-ksa  # Must be bound to GSA with Secret Manager Secret Accessor role\n      containers:\n      - name: app\n        image: \u003CIMAGE>\n        volumeMounts:\n        - name: secrets-volume\n          mountPath: \"\u002Fvar\u002Fsecrets\"\n          readOnly: true\n      volumes:\n      - name: secrets-volume\n        csi:\n          driver: secrets-store.csi.k8s.io\n          readOnly: true\n          volumeAttributes:\n            secretProviderClass: \"app-secrets-provider\"\n```\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 \u003CCLUSTER_NAME> --region \u003CREGION> \\\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-   Audit permissions via MCP: `check_k8s_auth(parent=\"...\", verb=\"list\",\n    resourceType=\"pods\", namespace=\"...\")` (or `kubectl auth can-i --list\n    --as=\u003Cuser>`)\n-   Review bindings via MCP: `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:\u002F\u002Fdocs.cloud.google.com\u002Fkubernetes-engine\u002Fdocs\u002Fbest-practices\u002Frbac.md.txt\n\n## Binary Authorization\n\nNot enabled in golden path by default but recommended for production image\nprovenance:\n\n```bash\n# Enable Binary Authorization\ngcloud container clusters update \u003CCLUSTER_NAME> --region \u003CREGION> \\\n  --binauthz-evaluation-mode=PROJECT_SINGLETON_POLICY_ENFORCE \\\n  --quiet\n```\n\n## Network Policies\n\nDataplane V2 (golden path) provides built-in Network Policy enforcement. Apply\ndefault-deny per namespace:\n\n```\n# MCP (preferred)\napply_k8s_manifest(parent=\"...\", yamlManifest=\"\u003Ccontents of default-deny-netpol.yaml>\")\n\n# kubectl fallback\nkubectl apply -f .\u002Fassets\u002Fdefault-deny-netpol.yaml -n \u003CNAMESPACE>\n```\n\n## GKE Sandbox (gVisor)\n\nFor running untrusted workloads in an isolated sandbox:\n\n```bash\n# Enable on cluster (Standard clusters)\ngcloud container clusters update \u003CCLUSTER_NAME> --region \u003CREGION> --enable-gke-sandbox --quiet\n\n# Use in pod spec\n# Add: runtimeClassName: gvisor\n```\n\n## Pod Security Standards (Golden Path)\n\nPod Security Standards define three profiles that restrict what pods can do. The\n**`restricted` profile is the golden path default** for production namespaces.\n\n| Profile      | Level                 | Use Case                           |\n| ------------ | --------------------- | ---------------------------------- |\n| `privileged` | Unrestricted          | System namespaces (`kube-system`), |\n:              :                       : infrastructure controllers         :\n| `baseline`   | Minimally restrictive | Shared\u002Fdev namespaces, legacy apps |\n:              :                       : being migrated                     :\n| `restricted` | **Golden path**       | Production workloads -- blocks     |\n:              :                       : privilege escalation, host access, :\n:              :                       : root                               :\n\n**Enforce via namespace labels (Pod Security Admission):**\n\n```yaml\napiVersion: v1\nkind: Namespace\nmetadata:\n  name: production\n  labels:\n    pod-security.kubernetes.io\u002Fenforce: restricted\n    pod-security.kubernetes.io\u002Fwarn: restricted\n    pod-security.kubernetes.io\u002Faudit: restricted\n```\n\n**Gradual rollout strategy:**\n\n1.  Start with `warn` + `audit` on existing namespaces to identify violations\n2.  Fix non-compliant workloads (remove `privileged`, `hostNetwork`, root user,\n    etc.)\n3.  Enable `enforce` once all workloads pass\n\n`restricted` blocks: running as root, privilege escalation, host\nnetworking\u002FPID\u002FIPC, host path volumes, and most capabilities. The golden path\n`workload-identity-pod.yaml` already complies.\n\n## Network Policy Logging (Recommended)\n\nWith Dataplane V2 (golden path), you can enable logging for Network Policy\ndecisions. **Not a golden path default** -- recommended for security auditing.\n\n```bash\ngcloud container clusters update \u003CCLUSTER_NAME> --region \u003CREGION> \\\n  --enable-network-policy-logging \\\n  --quiet\n```\n\nThis logs allowed and denied connections, useful for troubleshooting Network\nPolicy rules and auditing traffic flows.\n\n## Common IAM Roles\n\nThe five most common predefined IAM roles for GKE:\n\n| Role                            | Purpose             | When to Use          |\n| ------------------------------- | ------------------- | -------------------- |\n| `roles\u002Fcontainer.admin`         | Full control over   | Platform team admins |\n:                                 : clusters and        : managing cluster     :\n:                                 : Kubernetes          : lifecycle            :\n:                                 : resources           :                      :\n| `roles\u002Fcontainer.clusterAdmin`  | Manage clusters but | Cluster operators    |\n:                                 : not project-level   : who create\u002Fdelete    :\n:                                 : IAM                 : clusters             :\n| `roles\u002Fcontainer.developer`     | Deploy workloads    | Application          |\n:                                 : (pods, services,    : developers deploying :\n:                                 : deployments)        : to existing clusters :\n| `roles\u002Fcontainer.viewer`        | Read-only access to | Monitoring,          |\n:                                 : clusters and        : auditing, or         :\n:                                 : Kubernetes          : read-only dashboards :\n:                                 : resources           :                      :\n| `roles\u002Fcontainer.clusterViewer` | List and get        | CI\u002FCD pipelines that |\n:                                 : cluster details     : need cluster         :\n:                                 : only                : metadata             :\n\n> **Principle of least privilege**: Start with `roles\u002Fcontainer.viewer` or\n> `roles\u002Fcontainer.developer` and escalate only as needed. Avoid granting\n> `roles\u002Fcontainer.admin` broadly.\n\n## Service Accounts & Agents\n\n-   **GKE Service Agent**\n    (`service-\u003CPROJECT_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, create a dedicated SA with minimal\n    permissions and assign it via node pool config.\n-   **Workload Identity**: The recommended way for pods to access Google Cloud\n    APIs. Maps a Kubernetes ServiceAccount to a Google IAM ServiceAccount — see\n    [Workload Identity setup](#workload-identity-federation) above.\n\n## Cross-Service Authentication Patterns\n\nCommon patterns for granting GKE workloads access to other Google Cloud\nservices:\n\n```bash\n# Grant a GKE workload access to Cloud Storage\ngcloud projects add-iam-policy-binding \u003CPROJECT_ID> \\\n  --member \"serviceAccount:\u003CGSA_NAME>@\u003CPROJECT_ID>.iam.gserviceaccount.com\" \\\n  --role \"roles\u002Fstorage.objectViewer\" \\\n  --quiet\n\n# Grant a GKE workload access to Cloud SQL\ngcloud projects add-iam-policy-binding \u003CPROJECT_ID> \\\n  --member \"serviceAccount:\u003CGSA_NAME>@\u003CPROJECT_ID>.iam.gserviceaccount.com\" \\\n  --role \"roles\u002Fcloudsql.client\" \\\n  --quiet\n\n# Grant a GKE workload access to Pub\u002FSub\ngcloud projects add-iam-policy-binding \u003CPROJECT_ID> \\\n  --member \"serviceAccount:\u003CGSA_NAME>@\u003CPROJECT_ID>.iam.gserviceaccount.com\" \\\n  --role \"roles\u002Fpubsub.subscriber\" \\\n  --quiet\n```\n\nIn all cases, the GSA must be bound to a KSA via Workload Identity (see setup\nabove). The pod then uses the KSA to authenticate as the GSA.\n",{"name":5,"metadata":24,"description":7},{"category":25},"Security","main","be3de0244dc1a57e323d8160787ebb40fb64930e","skills\u002Fgoogle\u002Fcloud\u002Fgke-security","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main","https:\u002F\u002Fskills.x402.wtf","https:\u002F\u002Fgithub.com\u002FSolizardking","https:\u002F\u002Fmusebook.trade","Got a mile high and never came down","2026-10-08 23:20:13",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add Solizardking\u002Fskillhub-main --skill gke-security",{"tool":41,"command":42},"bunx","bunx skills add Solizardking\u002Fskillhub-main --skill gke-security",{"tool":44,"command":45},"pnpm","pnpm dlx skills add Solizardking\u002Fskillhub-main --skill gke-security","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fgoogle\u002Fcloud\u002Fgke-security\u002FSKILL.md",true,[49,55],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"assets\u002Fdefault-deny-netpol.yaml","ASSET","资产文件",177,"https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fgoogle\u002Fcloud\u002Fgke-security\u002Fassets\u002Fdefault-deny-netpol.yaml",{"path":56,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":57,"sourceHtmlUrl":58},"assets\u002Fworkload-identity-pod.yaml",900,"https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fgoogle\u002Fcloud\u002Fgke-security\u002Fassets\u002Fworkload-identity-pod.yaml",[60,67,74,81,88,96],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M78E0TGCAMNPS207BA3G07S7","zkrouter","Self-hosted OpenAI-compatible LLM router — smart tier-based routing, ZK-stamped routing decisions, mode overrides, free OpenRouter at install via the Birth bot. Save 60-80% on inference costs by routing to the cheapest capable model across 12+ OpenRouter models.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzkrouter\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M78E0R1Z8BDT6EDTHY17MTNB","zk","For custom ZK Solana programs and privacy-preserving applications to prevent double spending. Guide to integrate rent-free nullifier PDAs for double-spend prevention.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzk\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M78E0P3ZTZ1YWF8MD5MM23QE","zk-omni-messaging","Zero-knowledge omnichain messaging between Robinhood Chain and Solana using CheshireZkOmniMessenger (msgType 4) with nullifier anti-replay and the zk-omni-relayer service.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzk-omni-messaging\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M78E0JXZ2PNB1896VXAGDBWD","zerion-wallet-data","Use when the user asks to check a wallet's portfolio, token balances, DeFi positions, PnL, transaction history, or NFTs. Provides interpreted on-chain data across 40+ EVM chains and Solana via x402 pay-per-request or API key — no raw RPC decoding needed.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fzerion-wallet-data\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":92,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M78E0G14FH9GRRTQYMKD5E59","youtube-clipper","YouTube 视频智能剪辑工具。下载视频和字幕，AI 分析生成精细章节（几分钟级别）， 用户选择片段后自动剪辑、翻译字幕为中英双语、烧录字幕到视频，并生成总结文案。 使用场景：当用户需要剪辑 YouTube 视频、生成短视频片段、制作双语字幕版本时。 关键词：视频剪辑、YouTube、字幕翻译、双语字幕、视频下载、clip video","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":19},"01M78E0C2ZYA99CFFDNB7ZMK5S","yield-optimization","Multi-chain yield optimization via yield.xyz (StakeKit). Discover 2,988+ yield opportunities across 75+ blockchains, build deposit\u002Fwithdrawal transactions with shell scripts, and sign them with a MoonPay wallet. Use when the user wants to earn yield, find the best lending or staking rate, enter\u002Fexit a position, or check portfolio balances.","https:\u002F\u002Fgithub.com\u002FSolizardking\u002Fskillhub-main\u002Fblob\u002Fmain\u002Fskills\u002Fyield-optimization\u002FSKILL.md",[],[]]