gke-security
google/skills
Workload Identity, Secret Manager, RBAC, 바이너리 인증, 네트워크 정책 및 Pod 보안 표준을 통해 Google Kubernetes Engine(GKE) 클러스터의 보안을 강화합니다.
...모든 것을 확장하십시오GKE 보안
이 참조 문서는 GKE 클러스터의 보안 구성을 다룹니다. 골든 패스는 기본적으로 강화된 보안 태세를 적용합니다.
MCP 도구:
get_cluster,check_k8s_auth,get_k8s_resource,apply_k8s_manifest,update_cluster
골든 패스 보안 기본값
| 설정 | 골든 패스 값 | Day-0/1 | 비고 |
|---|---|---|---|
workloadIdentityConfig.workloadPool |
|
Day-0 | 파드용 워크로드 ID 페더레이션 |
secretManagerConfig.enabled |
true |
Day-1 | Google Secret Manager 통합 |
secretManagerConfig.rotationConfig |
활성화됨: true, rotationInterval: 120s |
1일차 | 비밀 자동 로테이션 |
rbacBindingConfig.enableInsecureBindingSystemAuthenticated |
false |
Day-0 | 레거시 시스템:인증된 바인딩 차단 |
rbacBindingConfig.enableInsecureBindingSystemUnauthenticated |
false |
Day-0 | 레거시 시스템 차단 : 인증되지 않은 바인딩 |
nodeConfig.shieldedInstanceConfig.enableSecureBoot |
true |
Day-0 | 부팅 무결성 검증 |
nodeConfig.shieldedInstanceConfig.enableIntegrityMonitoring |
true |
Day-0 | 런타임 무결성 검사 |
nodeConfig.workloadMetadataConfig.mode |
GKE_METADATA |
Day-0 | 레거시 메타데이터 API 차단, 워크로드 ID 적용 |
| 프라이빗 클러스터 + 데이터플레인 V2 설정 | gke-networking 스킬 참조 |
Day-0 | 프라이빗 노드, 프라이빗 엔드포인트 적용, ADVANCED_DATAPATH |
워크로드 ID 페더레이션
워크로드 ID는 파드가 Google Cloud API에 액세스하는 데 권장되는 방법입니다. 이를 통해 정적 서비스 계정 키가 필요하지 않습니다.
설정
# 1. Google 서비스 계정(GSA) 생성
gcloud iam service-accounts create \
--project \
--display-name "Workload Identity SA" \
--quiet
# 2. GSA에 IAM 역할 부여
gcloud projects add-iam-policy-binding \
--member "serviceAccount:@.iam.gserviceaccount.com" \
--role "" \
--quiet
# 3. 쿠버네티스 서비스 계정(KSA) 생성
kubectl create namespace
kubectl create serviceaccount --namespace
# 4. KSA를 GSA에 바인딩
gcloud iam service-accounts add-iam-policy-binding \
@.iam.gserviceaccount.com \
--role roles/iam.workloadIdentityUser \
--member "serviceAccount:.svc.id.goog[/]" \
--quiet
# 5. KSA에 어노테이션 추가
kubectl annotate serviceaccount \
--namespace \
iam.gke.io/gcp-service-account=@.iam.gserviceaccount.com
테스트용 파드는 assets/workload-identity-pod.yaml 을 참조하십시오.
검증
kubectl run workload-identity-test \
--image=gcr.io/google.com/cloudsdktool/cloud-sdk:slim \
--serviceaccount= --namespace= \
--rm -it -- gcloud auth list --quiet
Secret Manager 통합
골든 패스를 통해 자동 로테이션 기능이 포함된 Secret Manager가 활성화됩니다. 시크릿은 Kubernetes 시크릿과 동기화됩니다.
# 클러스터에서 Secret Manager가 활성화되었는지 확인
gcloud container clusters describe --region \
--format="value(secretManagerConfig.enabled)" \
--quiet
# 아직 활성화되지 않은 경우 활성화하기 (Day-1 변경)
gcloud container clusters update --region \
--enable-secret-manager \
--secret-manager-rotation-interval=120s \
--quiet
CSI 볼륨을 통한 시크릿 마운트 (배포 예시)
Secret Manager 애드온이 활성화되면 워크로드는 Secrets Store CSI 드라이버를 사용하여 시크릿을 볼륨으로 마운트할 수 있습니다. 이를 위해서는 다음 두 단계가 필요합니다:
- Secret Manager에서 어떤 시크릿을 가져올지 지정하기 위해
SecretProviderClass를정의합니다. - 해당 클래스를 참조하는
Deployment에서 볼륨을 마운트합니다.
[!중요] 프로덕션 모범 사례: Secret Manager CSI와 같은 워크로드 통합은 원시
Pod매니페스트가 아닌 프로덕션 표준Deployment매니페스트를 사용하여 항상 시연해야 합니다.
1단계: SecretProviderClass 생성
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
name: app-secrets-provider
namespace: default
spec:
provider: gke # GKE 관리형 제공자를 식별합니다
parameters:
secrets: |
- resourceName: "projects//secrets/db-password/versions/latest"
fileName: "db-password.txt"
2단계: Deployment에 시크릿 마운트하기
apiVersion: apps/v1
kind: Deployment
metadata:
name: secure-app
namespace: default
spec:
replicas: 2
selector:
matchLabels:
app: secure-app
template:
metadata:
labels:
app: secure-app
spec:
serviceAccountName: secure-ksa # Secret Manager의 Secret Accessor 역할을 가진 GSA에 바인딩되어야 함
containers:
- name: app
image:
volumeMounts:
- name: secrets-volume
mountPath: "/var/secrets"
readOnly: true
volumes:
- name: secrets-volume
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: "app-secrets-provider"
RBAC 보안 강화
골든 패스는 system:authenticated 및 system:unauthenticated 그룹에 광범위한 액세스 권한을 부여하는
안전하지 않은 레거시 RBAC 바인딩을 비활성화합니다.
# 보안이 취약한 바인딩이 비활성화되었는지 확인
gcloud container clusters describe --region \
--format="yaml(rbacBindingConfig)" \
--quiet
RBAC 모범 사례:
- 클러스터 전체에 적용되는 ClusterRole보다는 네임스페이스 범위의 Role을 사용하십시오
- 특정 그룹이나 서비스 계정에 바인딩하고, 절대로
system:authenticated에바인딩하지 마십시오 - MCP를 통해 권한 감사 수행:
check_k8s_auth(parent="...", verb="list", resourceType="pods", namespace="...")(또는kubectl auth can-i --list --as=) - MCP를 통해 바인딩을 검토하십시오:
get_k8s_resource(parent="...", resourceType="clusterrolebinding")(또는kubectl get clusterrolebindings,rolebindings --all-namespaces)
엔터프라이즈 RBAC 계획을 위한
gke-multitenancy스킬 및 https://docs.cloud.google.com/kubernetes-engine/docs/best-practices/rbac.md.txt
바이너리 인증
기본적으로 골든 패스에서는 활성화되어 있지 않지만, 프로덕션 이미지 출처 확인을 위해 권장됩니다:
# 바이너리 인증 활성화
gcloud container clusters update --region \
--binauthz-evaluation-mode=PROJECT_SINGLETON_POLICY_ENFORCE \
--quiet
네트워크 정책
Dataplane V2(골든 패스)는 내장된 네트워크 정책 적용 기능을 제공합니다. 네임스페이스별로 기본 거부(default-deny)를 적용하려면:
# MCP (권장)
apply_k8s_manifest(parent="...", yamlManifest="")
# kubectl 대체 방법
kubectl apply -f ./assets/default-deny-netpol.yaml -n
GKE 샌드박스 (gVisor)
격리된 샌드박스에서 신뢰할 수 없는 워크로드를 실행하려면:
# 클러스터에서 활성화 (표준 클러스터)
gcloud container clusters update --region --enable-gke-sandbox --quiet
# 파드 사양에서 사용
# 추가: runtimeClassName: gvisor
팟 보안 표준(골든 패스)
Pod 보안 표준은 Pod가 수행할 수 있는 작업을 제한하는 세 가지 프로필을 정의합니다.
'restricted' 프로필은 프로덕션 네임스페이스의골든 패스 기본값입니다.
| 프로필 | 레벨 | 사용 사례 |
|---|---|---|
privileged |
제한 없음 | 시스템 네임스페이스(kube-system), |
| : : : 인프라 컨트롤러 : | ||
기준 |
최소 제한 | 공유/dev 네임스페이스, 레거시 애플리케이션 |
| : : : 마이그레이션 중인 : | ||
제한됨 |
골든 경로 | 프로덕션 워크로드 -- 차단됨 |
| : : : 권한 상승, 호스트 액세스, : | ||
| : : : 루트 : |
네임스페이스 레이블을 통해 적용 (Pod 보안 승인):
apiVersion: v1
kind: Namespace
metadata:
name: production
labels:
pod-security.kubernetes.io/enforce: restricted
pod-security.kubernetes.io/warn: restricted
pod-security.kubernetes.io/audit: restricted
점진적 적용 전략:
- 기존 네임스페이스에 대해
경고및감사기능을 먼저 적용하여 위반 사항 파악 - 규정을 준수하지 않는 워크로드를 수정합니다(
privileged,hostNetwork, root user 등 제거). - 모든 워크로드가 기준을 충족하면
강제 적용을활성화
제한 대상 항목: root 권한으로 실행, 권한 상승, 호스트
네트워킹/PID/IPC, 호스트 경로 볼륨 및 대부분의 기능. 표준 경로인
workload-identity-pod.yaml은 이미 규정을 준수합니다.
네트워크 정책 로깅 (권장)
Dataplane V2(골든 패스)를 사용하면 네트워크 정책 결정 사항에 대한 로깅을 활성화할 수 있습니다. 골든 패스의 기본 설정은 아니지만, 보안 감사를 위해 권장됩니다.
gcloud container clusters update --region \
--enable-network-policy-logging \
--quiet
이렇게 하면 허용 및 거부된 연결이 로깅되며, 네트워크 정책 규칙의 문제 해결 및 트래픽 흐름 감사에 유용합니다.
일반적인 IAM 역할
GKE에서 가장 흔히 사용되는 5가지 사전 정의된 IAM 역할:
| 역할 | 목적 | 사용 시점 |
|---|---|---|
roles/container.admin |
다음에 대한 완전한 제어 권한 | 플랫폼 팀 관리자 |
| : : 클러스터 및 : 클러스터 관리 : | ||
| : : 쿠버네티스 : 라이프사이클 : | ||
| : : 리소스 : : | ||
roles/container.clusterAdmin |
클러스터를 관리하지만 | 클러스터 운영자는 |
| : : 프로젝트 수준은 아님 : 생성/삭제하는 : | ||
| : : IAM : 클러스터 : | ||
roles/container.developer |
워크로드 배포 | 애플리케이션 |
| : : (포드, 서비스, : 배포하는 개발자 : | ||
| : : 배포) : 기존 클러스터에 : | ||
roles/container.viewer |
다음에 대한 읽기 전용 액세스 | 모니터링, |
| : : 클러스터 및 : 감사, 또는 : | ||
| : : 쿠버네티스 : 읽기 전용 대시보드 : | ||
| : : 리소스 : : | ||
roles/container.clusterViewer |
CI/CD 파이프라인을 열거하고 가져오기 | 다음 조건을 충족하는 CI/CD 파이프라인 |
| : : 클러스터 세부 정보 : 클러스터가 필요한 : | ||
| : : 클러스터만 : 메타데이터 : |
최소 권한 원칙:
roles/container.viewer또는roles/container.developer로 시작하여 필요한 경우에만 권한을 상향 조정하십시오.roles/container.admin 권한을광범위하게 부여하는 것은 피하십시오.
서비스 계정 및 에이전트
- GKE 서비스 에이전트
(
service-): 자동으로 생성됩니다. 사용자를 대신하여 노드, 네트워킹 및 클러스터 운영을 관리합니다. 이 계정의 권한을 제거하거나 수정하지 마십시오.@container-engine-robot.iam.gserviceaccount.com - 노드 서비스 계정: 기본적으로 노드는 Compute Engine의 기본 서비스 계정을 사용합니다. 프로덕션 환경에서는 최소한의 권한만 가진 전용 서비스 계정을 생성하고 노드 풀 구성을 통해 할당하십시오.
- 워크로드 ID: 파드가 Google Cloud API에 액세스하는 데 권장되는 방법입니다. Kubernetes 서비스 계정을 Google IAM 서비스 계정에 매핑합니다. 자세한 내용은 위의 ‘워크로드 ID 설정’을 참조하세요.
서비스 간 인증 패턴
GKE 워크로드에 다른 Google Cloud 서비스에 대한 액세스 권한을 부여하는 일반적인 패턴:
# GKE 워크로드에 Cloud Storage 액세스 권한 부여
gcloud projects add-iam-policy-binding \
--member "serviceAccount:@.iam.gserviceaccount.com" \
--role "roles/storage.objectViewer" \
--quiet
# GKE 워크로드에 Cloud SQL 액세스 권한 부여
gcloud projects add-iam-policy-binding \
--member "serviceAccount:@.iam.gserviceaccount.com" \
--role "roles/cloudsql.client" \
--quiet
# GKE 워크로드에 Pub/Sub 액세스 권한 부여
gcloud projects add-iam-policy-binding \
--member "serviceAccount:@.iam.gserviceaccount.com" \
--role "roles/pubsub.subscriber" \
--quiet
모든 경우에 GSA는 워크로드 ID(Workload Identity)를 통해 KSA에 바인딩되어야 합니다(위의 설정 참조). 그러면 포드는 KSA를 사용하여 GSA로 인증합니다.
---
name: gke-security
description: Hardens Google Kubernetes Engine (GKE) clusters with Workload Identity, Secret Manager, RBAC, Binary Authorization, Network Policies, and Pod Security Standards.
---
# GKE Security
This reference covers security configuration for GKE clusters. The golden path
enforces a hardened security posture by default.
> **MCP Tools:** `get_cluster`, `check_k8s_auth`, `get_k8s_resource`,
> `apply_k8s_manifest`, `update_cluster`
## Golden Path Security Defaults
Setting | Golden Path Value | Day-0/1 | Notes
-------------------------------------------------------------- | --------------------------------------- | ------- | -----
`workloadIdentityConfig.workloadPool` | `<PROJECT>.svc.id.goog` | Day-0 | Workload Identity Federation for Pods
`secretManagerConfig.enabled` | `true` | Day-1 | Google Secret Manager integration
`secretManagerConfig.rotationConfig` | `enabled: true, rotationInterval: 120s` | Day-1 | Automatic secret rotation
`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
## Workload Identity Federation
Workload Identity is the recommended way for pods to access Google Cloud APIs.
It eliminates the need for static service account keys.
### Setup
```bash
# 1. Create a Google Service Account (GSA)
gcloud iam service-accounts create <GSA_NAME> \
--project <PROJECT_ID> \
--display-name "Workload Identity SA" \
--quiet
# 2. Grant IAM roles to the GSA
gcloud projects add-iam-policy-binding <PROJECT_ID> \
--member "serviceAccount:<GSA_NAME>@<PROJECT_ID>.iam.gserviceaccount.com" \
--role "<ROLE>" \
--quiet
# 3. Create Kubernetes Service Account (KSA)
kubectl create namespace <NAMESPACE>
kubectl create serviceaccount <KSA_NAME> --namespace <NAMESPACE>
# 4. Bind KSA to GSA
gcloud iam service-accounts add-iam-policy-binding \
<GSA_NAME>@<PROJECT_ID>.iam.gserviceaccount.com \
--role roles/iam.workloadIdentityUser \
--member "serviceAccount:<PROJECT_ID>.svc.id.goog[<NAMESPACE>/<KSA_NAME>]" \
--quiet
# 5. Annotate KSA
kubectl annotate serviceaccount <KSA_NAME> \
--namespace <NAMESPACE> \
iam.gke.io/gcp-service-account=<GSA_NAME>@<PROJECT_ID>.iam.gserviceaccount.com
```
> See [assets/workload-identity-pod.yaml](./assets/workload-identity-pod.yaml)
> for a test pod.
### Verification
```bash
kubectl run workload-identity-test \
--image=gcr.io/google.com/cloudsdktool/cloud-sdk:slim \
--serviceaccount=<KSA_NAME> --namespace=<NAMESPACE> \
--rm -it -- gcloud auth list --quiet
```
## Secret Manager Integration
The golden path enables Secret Manager with automatic rotation. Secrets are
synced to Kubernetes Secrets.
```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
```
### Mounting Secrets via CSI Volume (Deployment Example)
Once the Secret Manager add-on is enabled, workloads can mount secrets as
volumes using the Secrets Store CSI driver. This requires two steps:
1. **Define a `SecretProviderClass`** to specify which secrets to retrieve from
Secret Manager.
2. **Mount the volume in a `Deployment`** referencing that class.
> [!IMPORTANT] **Production Best Practice**: Always demonstrate workload
> integrations (like Secret Manager CSI) using production-standard
> **`Deployment`** manifests rather than raw `Pod` manifests.
#### Step 1: Create the SecretProviderClass
```yaml
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
name: app-secrets-provider
namespace: default
spec:
provider: gke # Identifies GKE managed provider
parameters:
secrets: |
- resourceName: "projects/<PROJECT_ID>/secrets/db-password/versions/latest"
fileName: "db-password.txt"
```
#### Step 2: Mount the secret in a Deployment
```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: secure-app
namespace: default
spec:
replicas: 2
selector:
matchLabels:
app: secure-app
template:
metadata:
labels:
app: secure-app
spec:
serviceAccountName: secure-ksa # Must be bound to GSA with Secret Manager Secret Accessor role
containers:
- name: app
image: <IMAGE>
volumeMounts:
- name: secrets-volume
mountPath: "/var/secrets"
readOnly: true
volumes:
- name: secrets-volume
csi:
driver: secrets-store.csi.k8s.io
readOnly: true
volumeAttributes:
secretProviderClass: "app-secrets-provider"
```
## 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`
- Audit permissions via MCP: `check_k8s_auth(parent="...", verb="list",
resourceType="pods", namespace="...")` (or `kubectl auth can-i --list
--as=<user>`)
- Review bindings via MCP: `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 production image
provenance:
```bash
# Enable Binary Authorization
gcloud container clusters update <CLUSTER_NAME> --region <REGION> \
--binauthz-evaluation-mode=PROJECT_SINGLETON_POLICY_ENFORCE \
--quiet
```
## Network Policies
Dataplane V2 (golden path) provides built-in Network Policy enforcement. Apply
default-deny per namespace:
```
# MCP (preferred)
apply_k8s_manifest(parent="...", yamlManifest="<contents of default-deny-netpol.yaml>")
# kubectl fallback
kubectl apply -f ./assets/default-deny-netpol.yaml -n <NAMESPACE>
```
## GKE Sandbox (gVisor)
For running untrusted workloads in an isolated sandbox:
```bash
# Enable on cluster (Standard clusters)
gcloud container clusters update <CLUSTER_NAME> --region <REGION> --enable-gke-sandbox --quiet
# Use in pod spec
# Add: runtimeClassName: gvisor
```
## Pod Security Standards (Golden Path)
Pod Security Standards define three profiles that restrict what pods can do. The
**`restricted` profile is the golden path default** for production namespaces.
| Profile | Level | Use Case |
| ------------ | --------------------- | ---------------------------------- |
| `privileged` | Unrestricted | System namespaces (`kube-system`), |
: : : infrastructure controllers :
| `baseline` | Minimally restrictive | Shared/dev namespaces, legacy apps |
: : : being migrated :
| `restricted` | **Golden path** | Production workloads -- blocks |
: : : privilege escalation, host access, :
: : : root :
**Enforce via namespace labels (Pod Security Admission):**
```yaml
apiVersion: v1
kind: Namespace
metadata:
name: production
labels:
pod-security.kubernetes.io/enforce: restricted
pod-security.kubernetes.io/warn: restricted
pod-security.kubernetes.io/audit: restricted
```
**Gradual rollout strategy:**
1. Start with `warn` + `audit` on existing namespaces to identify violations
2. Fix non-compliant workloads (remove `privileged`, `hostNetwork`, root user,
etc.)
3. Enable `enforce` once all workloads pass
`restricted` blocks: running as root, privilege escalation, host
networking/PID/IPC, host path volumes, and most capabilities. The golden path
`workload-identity-pod.yaml` already complies.
## Network Policy Logging (Recommended)
With Dataplane V2 (golden path), you can enable logging for Network Policy
decisions. **Not a golden path default** -- recommended for security auditing.
```bash
gcloud container clusters update <CLUSTER_NAME> --region <REGION> \
--enable-network-policy-logging \
--quiet
```
This logs allowed and denied connections, useful for troubleshooting Network
Policy rules and auditing traffic flows.
## Common IAM Roles
The five most common predefined IAM roles for GKE:
| 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.
## 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, create a dedicated SA with minimal
permissions and assign it via node pool config.
- **Workload Identity**: The recommended way for pods to access Google Cloud
APIs. Maps a Kubernetes ServiceAccount to a Google IAM ServiceAccount — see
[Workload Identity setup](#workload-identity-federation) above.
## Cross-Service Authentication Patterns
Common patterns for granting GKE workloads access to other Google Cloud
services:
```bash
# Grant a GKE workload access to Cloud Storage
gcloud projects add-iam-policy-binding <PROJECT_ID> \
--member "serviceAccount:<GSA_NAME>@<PROJECT_ID>.iam.gserviceaccount.com" \
--role "roles/storage.objectViewer" \
--quiet
# Grant a GKE workload access to Cloud SQL
gcloud projects add-iam-policy-binding <PROJECT_ID> \
--member "serviceAccount:<GSA_NAME>@<PROJECT_ID>.iam.gserviceaccount.com" \
--role "roles/cloudsql.client" \
--quiet
# Grant a GKE workload access to Pub/Sub
gcloud projects add-iam-policy-binding <PROJECT_ID> \
--member "serviceAccount:<GSA_NAME>@<PROJECT_ID>.iam.gserviceaccount.com" \
--role "roles/pubsub.subscriber" \
--quiet
```
In all cases, the GSA must be bound to a KSA via Workload Identity (see setup
above). The pod then uses the KSA to authenticate as the GSA.
모든 파일
0개 파일gke-security 설치
스킬 파일을 다운로드하여 .claude/skills/ 디렉터리에 압축을 풀어주세요.
ZIP 다운로드저장소를 클론하고 스킬 파일을 프로젝트에 복사하세요.
git clone https://github.com/google/skills/tree/main/skills/cloud/gke-security # Copy SKILL.md to your .claude/skills/ directory
복사





집
