configuring-identity-aware-proxy-with-google-iap
Skill này làm gì
Tính năng này giúp thiết lập Google Cloud Identity-Aware Proxy (IAP). Nó cho phép bạn kiểm soát ai được truy cập ứng dụng và dịch vụ trên Google Cloud, bằng cách yêu cầu mỗi người xác định danh tính trước khi sử dụng.
Khi nào nên dùng
- ✓Khi bạn muốn bảo vệ các ứng dụng trên Google Cloud (như website và API).
- ✓Khi bạn muốn thay VPN bằng cách truy cập an toàn hơn dựa trên danh tính người dùng.
- ✓Khi cần đảm bảo chỉ những người được phép, dùng thiết bị an toàn, mới truy cập được dịch vụ của bạn.
Liên kết skill
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/configuring-identity-aware-proxy-with-google-iap/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
“Thiết lập IAP để bảo vệ ứng dụng web của tôi trên App Engine.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ hoạt động bằng cách bật IAP cho các dịch vụ của bạn, rồi xác định ai được phép truy cập, thông qua các lệnh trong terminal.
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.
Configuring Identity-Aware Proxy with Google IAP
When to Use
- When protecting Google Cloud applications (App Engine, Cloud Run, GKE, Compute Engine) with identity-based access
- When implementing context-aware access requiring device posture and location verification
- When providing secure access to internal tools without VPN or public IP exposure
- When needing per-request authentication and authorization for web applications and TCP services
- When configuring programmatic access to IAP-protected resources using service accounts
Do not use for non-HTTP applications that cannot be placed behind an HTTPS load balancer, for public-facing applications that need unauthenticated access, or when applications handle their own authentication and IAP would conflict with existing auth flows.
Prerequisites
- Google Cloud project with billing enabled
- IAP API enabled (
gcloud services enable iap.googleapis.com) - Application deployed behind HTTPS Load Balancer, App Engine, or Cloud Run
- Cloud Identity or Google Workspace for user management
- Access Context Manager API enabled for access levels
- OAuth consent screen configured for the project
Workflow
Step 1: Enable IAP on Backend Services
Configure IAP for different GCP compute platforms.
# Enable required APIs
gcloud services enable iap.googleapis.com
gcloud services enable accesscontextmanager.googleapis.com
# Create OAuth consent screen
gcloud iap oauth-brands create \
--application_title="Internal Applications" \
--support_email=security@company.com
# Create OAuth client
gcloud iap oauth-clients create \
projects/PROJECT_ID/brands/BRAND_ID \
--display_name="IAP Web Client"
# === Enable IAP on Compute Engine Backend Service ===
gcloud compute backend-services update my-backend-service \
--iap=enabled,oauth2-client-id=CLIENT_ID,oauth2-client-secret=CLIENT_SECRET \
--global
# === Enable IAP on App Engine ===
gcloud iap web enable \
--resource-type=app-engine \
--oauth2-client-id=CLIENT_ID \
--oauth2-client-secret=CLIENT_SECRET
# === Enable IAP on Cloud Run ===
# First grant IAP service account the Cloud Run Invoker role
gcloud run services add-iam-policy-binding my-service \
--member="serviceAccount:service-PROJECT_NUM@gcp-sa-iap.iam.gserviceaccount.com" \
--role="roles/run.invoker" \
--region=us-central1
# Enable IAP on the Cloud Run backend service
gcloud compute backend-services update my-cloud-run-backend \
--iap=enabled,oauth2-client-id=CLIENT_ID,oauth2-client-secret=CLIENT_SECRET \
--global
# === Enable IAP TCP Forwarding for SSH/RDP ===
# No load balancer needed - uses IAP tunnel
gcloud compute instances add-iam-policy-binding my-vm \
--member="group:developers@company.com" \
--role="roles/iap.tunnelResourceAccessor" \
--zone=us-central1-a
# SSH through IAP tunnel
gcloud compute ssh my-vm --zone=us-central1-a --tunnel-through-iap
# RDP through IAP tunnel
gcloud compute start-iap-tunnel my-windows-vm 3389 \
--local-host-port=localhost:3390 \
--zone=us-central1-a
Step 2: Configure IAM Bindings for Access Control
Grant access to specific users and groups with optional access level conditions.
# Grant basic access to a group
gcloud iap web add-iam-policy-binding \
--resource-type=backend-services \
--service=my-backend-service \
--member="group:engineering@company.com" \
--role="roles/iap.httpsResourceAccessor"
# Grant access with access level condition
gcloud iap web add-iam-policy-binding \
--resource-type=backend-services \
--service=finance-app \
--member="group:finance@company.com" \
--role="roles/iap.httpsResourceAccessor" \
--condition='expression=request.auth.access_levels.exists(x, x == "accessPolicies/POLICY_ID/accessLevels/corporate-device"),title=RequireCorporateDevice,description=Requires managed corporate device'
# Grant access only during business hours
gcloud iap web add-iam-policy-binding \
--resource-type=backend-services \
--service=admin-console \
--member="group:admins@company.com" \
--role="roles/iap.httpsResourceAccessor" \
--condition='expression=request.time.getHours("America/New_York") >= 8 && request.time.getHours("America/New_York") <= 18 && request.time.getDayOfWeek("America/New_York") >= 1 && request.time.getDayOfWeek("America/New_York") <= 5,title=BusinessHoursOnly'
# Grant access to a specific URL path
gcloud iap web add-iam-policy-binding \
--resource-type=backend-services \
--service=internal-api \
…
Câu hỏi thường gặp
Google Cloud Identity-Aware Proxy (IAP) là gì?
Đây là dịch vụ của Google Cloud đóng vai trò như cổng an ninh. Nó xác minh danh tính của mọi người cố truy cập ứng dụng của bạn trước khi cho vào.
Tôi có cần VPN để dùng IAP không?
Không, IAP là một giải pháp thay thế VPN. Nó tập trung vào danh tính người dùng hơn là mạng mà họ truy cập từ đó.
Tôi có thể dùng IAP để bảo vệ mọi loại ứng dụng không?
IAP phù hợp nhất với ứng dụng web và dịch vụ có thể đặt sau load balancer HTTPS. Nó không phù hợp với ứng dụng không dùng HTTPS hoặc đã tự quản lý xác thực theo cách xung đột.
Chi tiết
Mô tả gốc của tác giả
Configures Google Cloud Identity-Aware Proxy (IAP) via gcloud to enforce per-request identity verification on Compute Engine, App Engine, Cloud Run, and GKE, including IAM bindings, Access Context Manager access levels, session/reauth settings, and service-account programmatic access. Use when replacing VPN access with identity-based access to GCP backends or configuring context-aware, zero-trust
Độ phổ biến
- Sao GitHub
- 35k
- Vị trí xếp hạng
- #7758
- Giấy phép
- Apache-2.0
- Cập nhật
- 31/8/2026
Bình luận
- …
Thêm skill từ kho mã này
abusing-dpapi-for-credential-access
35kCung cấp cho agent AI của bạn hướng dẫn có sẵn cho một tác vụ cụ thể, giúp nó làm việc tốt hơn và nhanh hơn.
abusing-shadow-credentials-for-privesc
35kDạy agent AI của bạn viết văn bản rõ ràng và có cấu trúc tốt.
achieving-cmmc-level-2-compliance
35kGiúp agent của bạn chuẩn bị môi trường để tuân thủ CMMC Level 2. Triển khai các yêu cầu bảo mật và quản lý tài liệu cần thiết.
acquiring-disk-image-with-dd-and-dcfldd
35kGiúp agent của bạn tạo bản sao chính xác của ổ đĩa. Cách này đảm bảo không mất hay thay đổi thông tin trong quá trình điều tra.
Skill tương tự
brand-discovery
280kGiúp xác định bản sắc thương hiệu thông qua các buổi phỏng vấn có cấu trúc. Tạo hướng dẫn đầy đủ về mục đích, đối tượng và tính cách của thương hiệu.
brand-voice
280kTạo hồ sơ viết dựa trên văn bản thương hiệu thực tế. Đảm bảo nội dung và giao tiếp giữ được phong cách nhất quán và chân thực.
design-md
260kDạy agent viết, kiểm tra và xuất tệp DESIGN.md, ghi màu, phông chữ và phong cách thương hiệu theo dạng công cụ AI đọc được.