gke-workload-security
Skill này làm gì
Skill này kiểm tra và cải thiện bảo mật của các ứng dụng chạy trên Google Kubernetes Engine. Skill dành cho các đội muốn khối lượng công việc được khóa chặt và cụm được kiểm toán.
Khi nào nên dùng
- ✓Khi bạn muốn chạy một đợt kiểm toán bảo mật cho một cụm GKE.
- ✓Khi bạn cần Network Policy chặn lưu lượng giữa các pod theo mặc định.
- ✓Khi bạn muốn cô lập các pod rủi ro cao bằng GKE Sandbox hoặc áp dụng Pod Security Standards.
Liên kết skill
https://github.com/google/skills/blob/main/skills/cloud/gke-workload-security/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Kiểm toán cụm GKE của tôi xem có lỗ hổng bảo mật nào không, và thiết lập quy tắc mạng để pod chỉ giao tiếp với những gì cần thiết.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill chạy một script kiểm toán để kiểm tra Workload Identity, Network Policy, Shielded Nodes, Binary Authorization và thiết lập cụm riêng tư. Sau đó skill đề xuất các bước củng cố cho namespace và pod.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
GKE Workload Security
Routing Note: For Workload Identity KSA/GSA bindings, open
gke-workload-identity/SKILL.md. For cluster-level security flags (--database-encryption-key,--security-posture, RBAC, Shielded Nodes, Binary Authorization), opengke-platform-security/SKILL.md.
This skill provides workflows and best practices for securing GKE workloads. It covers security auditing, Identity and Access Management (Workload Identity), Network Security (Network Policies), and Node Security.
Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read Usage Attribution. 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-workload-security)"
and append agent-skills/1.0 (skill:gke-workload-security) to User-Agent headers.
Workflows
1. Security Audit
Assess the current security posture of your cluster using the provided audit script.
Prerequisites:
gcloudCLI authenticated.jqcommand-line JSON processor installed.
Capabilities:
- Checks for Workload Identity.
- Verifies Network Policy is enabled.
- Checks if Shielded Nodes are enabled.
- Checks if Binary Authorization is enabled.
- Checks for Private Cluster configuration.
Command:
scripts/audit_cluster.sh <cluster-name> <region> <project-id>
2. Configure Workload Identity
Workload Identity allows Kubernetes Service Accounts (KSAs) to impersonate Google Service Accounts (GSAs). This is the recommended method for workloads to access Google Cloud APIs.
Steps:
Create Namespace and KSA:
kubectl create namespace workload-identity-test-ns kubectl create serviceaccount <ksa-name> \ --namespace workload-identity-test-nsBind 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[workload-identity-test-ns/<ksa-name>]"Annotate KSA:
kubectl annotate serviceaccount <ksa-name> \ --namespace workload-identity-test-ns \ iam.gke.io/gcp-service-account=<gsa-name>@<project-id>.iam.gserviceaccount.comVerify Example Pod: Use existing asset
assets/workload-identity-pod.yamlto test the configuration. Update the<ksa-name>in the file first.kubectl apply -f assets/workload-identity-pod.yaml -n workload-identity-test-ns
3. Implement Network Policies
Control traffic flow between Pods using Network Policies. By default, all traffic is allowed.
Enable Network Policy Enforcement:
gcloud container clusters update <cluster-name> \
--update-addons=NetworkPolicy=ENABLED \
--region <region>
[!NOTE] If your cluster uses Dataplane V2 (
--enable-dataplane-v2), Network Policy enforcement is built-in and this step is not required (and may fail).
Apply Default Deny Policy: Isolate namespaces by denying all ingress and egress traffic by default.
Replace <target-namespace> with the namespace you want to isolate.
kubectl apply -f assets/default-deny-netpol.yaml -n <target-namespace>
4. GKE Sandbox (gVisor) Pod Isolation
Run untrusted workloads in a sandbox for extra kernel isolation. (Note:
Enabling Shielded Nodes (--enable-shielded-nodes) and GKE Sandbox
(--enable-gke-sandbox) at the cluster control plane level are platform-level
actions covered in the gke-platform-security skill.)
Run a Sandboxed Pod: Add runtimeClassName: gvisor to your Pod spec:
apiVersion: v1
kind: Pod
metadata:
name: sandboxed-pod
spec:
runtimeClassName: gvisor
containers:
- name: app
image: nginx
5. Pod Security Standards
Enforce security policies on namespaces using labels.
Enforce Restricted Profile:
kubectl label --overwrite ns <namespace> \
pod-security.kubernetes.io/enforce=restricted \
pod-security.kubernetes.io/enforce-version=latest
[!NOTE] Using
latestensures you use the policies corresponding to the cluster's current version. You can pin it to a specific version (e.g.,v1.30) to lock down the namespace to policies of a specific release.
6. Se
Câu hỏi thường gặp
Skill có bao gồm các cờ bảo mật ở mức toàn cụm không?
Không. Thiết lập mức cụm như khóa mã hóa và RBAC do skill gke-platform-security xử lý.
Kiểm toán kiểm tra những gì?
Workload Identity, Network Policy, Shielded Nodes, Binary Authorization và cấu hình cụm riêng tư.
Skill cần công cụ gì?
gcloud CLI đã đăng nhập và công cụ xử lý JSON jq.
Chi tiết
Mô tả gốc của tác giả
Audits, configures, and hardens workload-level security controls for Google Kubernetes Engine (GKE) applications and namespaces. Covers running security audits (`audit_cluster.sh`), enforcing Network Policies (default-deny and Dataplane V2 logging), isolating high-risk pods inside GKE Sandbox (`gVisor`), enforcing Pod Security Standards (`restricted` labeling) and pod securityContext, and mounting Secret Manager secrets via CSI (`SecretProviderClass`). Use when auditing workload security posture, isolating namespaces, applying pod security standards, or configuring network policies and secret
repo: google/skills
Độ phổ biến
- Sao GitHub
- 22k
- Vị trí xếp hạng
- #10304
- Giấy phép
- Apache-2.0
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
finding-google-skills
22kGiúp agent của bạn tìm hướng dẫn Google phù hợp cho việc thiết lập, như hosting, cơ sở dữ liệu, lưu trữ, đăng nhập hoặc phục vụ mô hình AI.
gcloud
22kGiúp agent của bạn viết và kiểm tra các lệnh gcloud của Google Cloud, tra cứu cú pháp chính xác trước khi chạy bất cứ thứ gì để không đoán các flag.
google-cloud-recipe-auth
22kHướng dẫn agent của bạn qua quản lý danh tính và quyền truy cập của Google Cloud, gồm cách con người và dịch vụ đăng nhập và những quyền họ nhận được.
google-cloud-recipe-onboarding
22kHướng dẫn một lập trình viên mới qua các bước đầu tiên trên Google Cloud, gồm chọn dự án, liên kết thanh toán và triển khai tài nguyên đầu tiên.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.