[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M731GSS6AWBPXQQYBSPDEV7Z":3,"skill-same:01M731GSS6AWBPXQQYBSPDEV7Z":108},{"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":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":55,"ownerHtmlUrl":56,"ownerBlogUrl":57,"ownerDescription":58,"updatedAt":59,"install":60,"resources":73},"01M731GSS6AWBPXQQYBSPDEV7Z","configuring-identity-aware-proxy-with-google-iap",null,"Configuring Google Cloud Identity-Aware Proxy (IAP) to enforce per-request identity verification for Compute Engine, App Engine, Cloud Run, and GKE services using access levels, context-aware policies, and programmatic access with service accounts.","Horonomos-laps\u002FYana-AI","Horonomos-laps","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F355299122?v=4","01M76B3QPXE88ET2SQPDPVATZT"," Horonomos-laps","01M72ZQRJPCYPSSWT4D00VJR2A",13,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fconfiguring-identity-aware-proxy-with-google-iap\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fconfiguring-identity-aware-proxy-with-google-iap\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: configuring-identity-aware-proxy-with-google-iap\ndescription: 'Configuring Google Cloud Identity-Aware Proxy (IAP) to enforce per-request\n  identity verification for Compute Engine, App Engine, Cloud Run, and GKE services\n  using access levels, context-aware policies, and programmatic access with service\n  accounts.\n\n  '\ndomain: cybersecurity\nsubdomain: zero-trust-architecture\ntags:\n- google-iap\n- identity-aware-proxy\n- gcp\n- zero-trust\n- access-context-manager\n- cloud-run\n- app-engine\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.AA-01\n- PR.AA-05\n- PR.IR-01\n- GV.PO-01\nmitre_attack:\n- T1078.004\n- T1133\n- T1021.007\nsource: https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\nsource_commit: 04450304b12645cb2b974ab96d28c0664758a88d\nnote: \"Vendored verbatim from an external Apache-2.0 security-skill library, pinned by commit. Exceeds the internal 300-line skill guideline (agent-code-constraints.md) -- kept as-is because this is vendored reference material (forensics\u002Fthreat-intel procedure), not Yana AI-authored content, and trimming would damage technical accuracy.\"\n---\n\n# Configuring Identity-Aware Proxy with Google IAP\n\n## When to Use\n\n- When protecting Google Cloud applications (App Engine, Cloud Run, GKE, Compute Engine) with identity-based access\n- When implementing context-aware access requiring device posture and location verification\n- When providing secure access to internal tools without VPN or public IP exposure\n- When needing per-request authentication and authorization for web applications and TCP services\n- When configuring programmatic access to IAP-protected resources using service accounts\n\n**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.\n\n## Prerequisites\n\n- Google Cloud project with billing enabled\n- IAP API enabled (`gcloud services enable iap.googleapis.com`)\n- Application deployed behind HTTPS Load Balancer, App Engine, or Cloud Run\n- Cloud Identity or Google Workspace for user management\n- Access Context Manager API enabled for access levels\n- OAuth consent screen configured for the project\n\n## Workflow\n\n### Step 1: Enable IAP on Backend Services\n\nConfigure IAP for different GCP compute platforms.\n\n```bash\n# Enable required APIs\ngcloud services enable iap.googleapis.com\ngcloud services enable accesscontextmanager.googleapis.com\n\n# Create OAuth consent screen\ngcloud iap oauth-brands create \\\n  --application_title=\"Internal Applications\" \\\n  --support_email=security@company.com\n\n# Create OAuth client\ngcloud iap oauth-clients create \\\n  projects\u002FPROJECT_ID\u002Fbrands\u002FBRAND_ID \\\n  --display_name=\"IAP Web Client\"\n\n# === Enable IAP on Compute Engine Backend Service ===\ngcloud compute backend-services update my-backend-service \\\n  --iap=enabled,oauth2-client-id=CLIENT_ID,oauth2-client-secret=CLIENT_SECRET \\\n  --global\n\n# === Enable IAP on App Engine ===\ngcloud iap web enable \\\n  --resource-type=app-engine \\\n  --oauth2-client-id=CLIENT_ID \\\n  --oauth2-client-secret=CLIENT_SECRET\n\n# === Enable IAP on Cloud Run ===\n# First grant IAP service account the Cloud Run Invoker role\ngcloud run services add-iam-policy-binding my-service \\\n  --member=\"serviceAccount:service-PROJECT_NUM@gcp-sa-iap.iam.gserviceaccount.com\" \\\n  --role=\"roles\u002Frun.invoker\" \\\n  --region=us-central1\n\n# Enable IAP on the Cloud Run backend service\ngcloud compute backend-services update my-cloud-run-backend \\\n  --iap=enabled,oauth2-client-id=CLIENT_ID,oauth2-client-secret=CLIENT_SECRET \\\n  --global\n\n# === Enable IAP TCP Forwarding for SSH\u002FRDP ===\n# No load balancer needed - uses IAP tunnel\ngcloud compute instances add-iam-policy-binding my-vm \\\n  --member=\"group:developers@company.com\" \\\n  --role=\"roles\u002Fiap.tunnelResourceAccessor\" \\\n  --zone=us-central1-a\n\n# SSH through IAP tunnel\ngcloud compute ssh my-vm --zone=us-central1-a --tunnel-through-iap\n\n# RDP through IAP tunnel\ngcloud compute start-iap-tunnel my-windows-vm 3389 \\\n  --local-host-port=localhost:3390 \\\n  --zone=us-central1-a\n```\n\n### Step 2: Configure IAM Bindings for Access Control\n\nGrant access to specific users and groups with optional access level conditions.\n\n```bash\n# Grant basic access to a group\ngcloud iap web add-iam-policy-binding \\\n  --resource-type=backend-services \\\n  --service=my-backend-service \\\n  --member=\"group:engineering@company.com\" \\\n  --role=\"roles\u002Fiap.httpsResourceAccessor\"\n\n# Grant access with access level condition\ngcloud iap web add-iam-policy-binding \\\n  --resource-type=backend-services \\\n  --service=finance-app \\\n  --member=\"group:finance@company.com\" \\\n  --role=\"roles\u002Fiap.httpsResourceAccessor\" \\\n  --condition='expression=request.auth.access_levels.exists(x, x == \"accessPolicies\u002FPOLICY_ID\u002FaccessLevels\u002Fcorporate-device\"),title=RequireCorporateDevice,description=Requires managed corporate device'\n\n# Grant access only during business hours\ngcloud iap web add-iam-policy-binding \\\n  --resource-type=backend-services \\\n  --service=admin-console \\\n  --member=\"group:admins@company.com\" \\\n  --role=\"roles\u002Fiap.httpsResourceAccessor\" \\\n  --condition='expression=request.time.getHours(\"America\u002FNew_York\") >= 8 && request.time.getHours(\"America\u002FNew_York\") \u003C= 18 && request.time.getDayOfWeek(\"America\u002FNew_York\") >= 1 && request.time.getDayOfWeek(\"America\u002FNew_York\") \u003C= 5,title=BusinessHoursOnly'\n\n# Grant access to a specific URL path\ngcloud iap web add-iam-policy-binding \\\n  --resource-type=backend-services \\\n  --service=internal-api \\\n  --member=\"group:api-consumers@company.com\" \\\n  --role=\"roles\u002Fiap.httpsResourceAccessor\" \\\n  --condition='expression=request.path.startsWith(\"\u002Fapi\u002Fv2\u002F\"),title=APIv2Access'\n```\n\n### Step 3: Create Access Levels with Access Context Manager\n\nDefine context-based access requirements using device attributes and network conditions.\n\n```bash\n# Create access level requiring encrypted corporate device\ncat > managed-device.yaml \u003C\u003C 'EOF'\n- devicePolicy:\n    allowedEncryptionStatuses:\n      - ENCRYPTED\n    osConstraints:\n      - osType: DESKTOP_WINDOWS\n        minimumVersion: \"10.0.19045\"\n      - osType: DESKTOP_MAC\n        minimumVersion: \"14.0\"\n      - osType: DESKTOP_CHROME_OS\n    requireScreenlock: true\n    requireAdminApproval: true\n    allowedDeviceManagementLevels:\n      - ADVANCED\nEOF\n\ngcloud access-context-manager levels create managed-device \\\n  --policy=POLICY_ID \\\n  --title=\"Managed Device\" \\\n  --basic-level-spec=managed-device.yaml\n\n# Create access level for corporate network\ncat > corp-network.yaml \u003C\u003C 'EOF'\n- ipSubnetworks:\n    - \"203.0.113.0\u002F24\"\n    - \"198.51.100.0\u002F24\"\n  regions:\n    - US\n    - GB\nEOF\n\ngcloud access-context-manager levels create corp-network \\\n  --policy=POLICY_ID \\\n  --title=\"Corporate Network\" \\\n  --basic-level-spec=corp-network.yaml\n\n# Create custom access level using CEL for complex logic\ncat > high-trust.yaml \u003C\u003C 'EOF'\nexpression: >\n  device.encryption_status == DeviceEncryptionStatus.ENCRYPTED &&\n  device.is_admin_approved_device == true &&\n  (\n    origin.ip in [\"203.0.113.0\u002F24\"] ||\n    device.os_type == OsType.DESKTOP_CHROME_OS\n  ) &&\n  request.auth.claims.hd == \"company.com\"\nEOF\n\ngcloud access-context-manager levels create high-trust \\\n  --policy=POLICY_ID \\\n  --title=\"High Trust\" \\\n  --custom-level-spec=high-trust.yaml\n```\n\n### Step 4: Configure Session Settings and Re-authentication\n\nSet session duration and re-authentication policies per application.\n\n```bash\n# Configure re-authentication for a backend service\n# Requires login every 4 hours for sensitive apps\ngcloud iap settings set \\\n  --project=PROJECT_ID \\\n  --resource-type=compute \\\n  --service=finance-app \\\n  reauthSettings.method=LOGIN \\\n  reauthSettings.maxAge=14400s \\\n  reauthSettings.policyType=MINIMUM\n\n# Configure session settings for App Engine\ngcloud iap settings set \\\n  --project=PROJECT_ID \\\n  --resource-type=app-engine \\\n  reauthSettings.method=SECURE_KEY \\\n  reauthSettings.maxAge=3600s \\\n  reauthSettings.policyType=MINIMUM\n\n# View current IAP settings\ngcloud iap settings get \\\n  --project=PROJECT_ID \\\n  --resource-type=compute \\\n  --service=finance-app\n```\n\n### Step 5: Configure Programmatic Access for Service Accounts\n\nEnable service-to-service communication through IAP-protected endpoints.\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\"\"\"Access IAP-protected resource using service account credentials.\"\"\"\n\nimport google.auth\nimport google.auth.transport.requests\nfrom google.auth import impersonated_credentials\nimport requests as req\n\nIAP_CLIENT_ID = \"YOUR_IAP_OAUTH_CLIENT_ID.apps.googleusercontent.com\"\nIAP_URL = \"https:\u002F\u002Fmy-app.company.com\u002Fapi\u002Fdata\"\n\ndef access_iap_resource():\n    # Get default credentials (works with service account key or workload identity)\n    credentials, project = google.auth.default()\n\n    # Create IAP-authenticated request\n    authed_session = google.auth.transport.requests.AuthorizedSession(\n        credentials,\n        target_audience=IAP_CLIENT_ID\n    )\n\n    # Make request to IAP-protected resource\n    response = authed_session.get(IAP_URL)\n    print(f\"Status: {response.status_code}\")\n    print(f\"Response: {response.text[:500]}\")\n\n    return response\n\nif __name__ == \"__main__\":\n    access_iap_resource()\n```\n\n### Step 6: Set Up Audit Logging and Monitoring\n\nConfigure logging for all IAP access decisions.\n\n```bash\n# Enable data access audit logs for IAP\ngcloud projects get-iam-policy PROJECT_ID --format=json > policy.json\n\n# Add IAP audit config to policy.json:\n# {\n#   \"service\": \"iap.googleapis.com\",\n#   \"auditLogConfigs\": [\n#     {\"logType\": \"ADMIN_READ\"},\n#     {\"logType\": \"DATA_READ\"},\n#     {\"logType\": \"DATA_WRITE\"}\n#   ]\n# }\n\ngcloud projects set-iam-policy PROJECT_ID policy.json\n\n# Create log-based metric for denied access\ngcloud logging metrics create iap-denied-access \\\n  --description=\"Count of IAP access denials\" \\\n  --log-filter='resource.type=\"gce_backend_service\" AND protoPayload.status.code=16'\n\n# Create alerting policy for high denial rates\ngcloud alpha monitoring policies create \\\n  --display-name=\"IAP High Denial Rate\" \\\n  --condition-display-name=\"Denied access > 50 in 5 min\" \\\n  --condition-filter='metric.type=\"logging.googleapis.com\u002Fuser\u002Fiap-denied-access\"' \\\n  --condition-threshold-value=50 \\\n  --condition-threshold-duration=300s \\\n  --notification-channels=projects\u002FPROJECT_ID\u002FnotificationChannels\u002FCHANNEL_ID\n\n# Query IAP access logs\ngcloud logging read '\n  resource.type=\"gce_backend_service\"\n  protoPayload.serviceName=\"iap.googleapis.com\"\n  timestamp >= \"2026-02-22T00:00:00Z\"\n' --project=PROJECT_ID --format='table(timestamp,protoPayload.authenticationInfo.principalEmail,protoPayload.status.code,resource.labels.backend_service_name)' --limit=50\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Identity-Aware Proxy | GCP service that intercepts web requests and TCP connections, authenticating users and evaluating access policies before proxying to backend services |\n| Backend Service | GCP load balancer component that IAP protects; can serve Compute Engine instances, GKE pods, Cloud Run services, or App Engine |\n| IAP Tunnel | Secure TCP tunnel through IAP allowing SSH, RDP, and other TCP access to VMs without public IPs or VPN |\n| OAuth Consent Screen | GCP configuration specifying the application name and support email shown to users during IAP authentication |\n| Access Level | Named condition in Access Context Manager evaluated during IAP authorization (device posture, IP, geography) |\n| Re-authentication | IAP feature requiring users to prove their identity again after a configurable session duration |\n\n## Tools & Systems\n\n- **Google Cloud IAP**: Identity-aware reverse proxy for GCP applications and TCP services\n- **Access Context Manager**: Defines access levels based on device, network, and geographic attributes\n- **gcloud CLI**: Command-line tool for configuring IAP, access levels, and IAM bindings\n- **IAP TCP Forwarding**: Tunnel-based access to VMs for SSH\u002FRDP without public IPs\n- **Cloud Audit Logs**: Immutable records of all IAP access decisions for compliance\n- **Endpoint Verification**: Chrome extension collecting device attributes for access level evaluation\n\n## Common Scenarios\n\n### Scenario: Securing 15 Internal GCP Services with IAP\n\n**Context**: An e-commerce company runs 15 internal services on GKE and Cloud Run (admin dashboards, internal APIs, monitoring tools). Currently, these services are protected only by VPN and firewall rules, creating excessive network-level access.\n\n**Approach**:\n1. Deploy all services behind an HTTPS Load Balancer with managed SSL certificates\n2. Enable IAP on each backend service with per-service OAuth clients\n3. Create IAM bindings mapping Google Groups to specific services (admin group -> admin dashboard, engineering -> monitoring)\n4. Define access levels: managed-device (encryption + screen lock), corp-network (office IP ranges)\n5. Apply managed-device access level to admin dashboard and financial tools\n6. Configure IAP TCP tunneling for SSH access to GKE nodes (replacing SSH bastion host)\n7. Set re-authentication to 4 hours for admin tools, 8 hours for monitoring\n8. Configure Cloud Audit Logs and create alerting for repeated denials\n\n**Pitfalls**: IAP adds 10-50ms latency per request; test application performance. WebSocket connections through IAP require specific backend service configuration. Service-to-service calls within GKE should bypass IAP using internal service mesh, not external IAP endpoints. Break-glass access should use a separate IAM binding without access level conditions.\n\n## Output Format\n\n```\nGoogle Cloud IAP Configuration Report\n==================================================\nProject: ecommerce-internal\nReport Date: 2026-02-23\n\nIAP-PROTECTED SERVICES:\n  Backend Services:     12\n  App Engine:            1\n  Cloud Run:             2\n  IAP TCP Tunnels:       4 (SSH access)\n  Total:                19\n\nACCESS CONTROL:\n  IAM Bindings:         34\n  With Access Levels:   18 (52.9%)\n  Access Levels:         3 (managed-device, corp-network, high-trust)\n\nSESSION POLICIES:\n  Admin tools:          4h re-auth (SECURE_KEY)\n  Sensitive apps:       4h re-auth (LOGIN)\n  General tools:        8h re-auth (LOGIN)\n\nACCESS LOGS (last 24h):\n  Total requests:       23,456\n  Authenticated:        23,289 (99.3%)\n  Denied by IAM:           112\n  Denied by access level:   55\n  Unique users:            134\n```\n","# Configuring Identity-Aware Proxy with Google IAP\n\n## When to Use\n\n- When protecting Google Cloud applications (App Engine, Cloud Run, GKE, Compute Engine) with identity-based access\n- When implementing context-aware access requiring device posture and location verification\n- When providing secure access to internal tools without VPN or public IP exposure\n- When needing per-request authentication and authorization for web applications and TCP services\n- When configuring programmatic access to IAP-protected resources using service accounts\n\n**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.\n\n## Prerequisites\n\n- Google Cloud project with billing enabled\n- IAP API enabled (`gcloud services enable iap.googleapis.com`)\n- Application deployed behind HTTPS Load Balancer, App Engine, or Cloud Run\n- Cloud Identity or Google Workspace for user management\n- Access Context Manager API enabled for access levels\n- OAuth consent screen configured for the project\n\n## Workflow\n\n### Step 1: Enable IAP on Backend Services\n\nConfigure IAP for different GCP compute platforms.\n\n```bash\n# Enable required APIs\ngcloud services enable iap.googleapis.com\ngcloud services enable accesscontextmanager.googleapis.com\n\n# Create OAuth consent screen\ngcloud iap oauth-brands create \\\n  --application_title=\"Internal Applications\" \\\n  --support_email=security@company.com\n\n# Create OAuth client\ngcloud iap oauth-clients create \\\n  projects\u002FPROJECT_ID\u002Fbrands\u002FBRAND_ID \\\n  --display_name=\"IAP Web Client\"\n\n# === Enable IAP on Compute Engine Backend Service ===\ngcloud compute backend-services update my-backend-service \\\n  --iap=enabled,oauth2-client-id=CLIENT_ID,oauth2-client-secret=CLIENT_SECRET \\\n  --global\n\n# === Enable IAP on App Engine ===\ngcloud iap web enable \\\n  --resource-type=app-engine \\\n  --oauth2-client-id=CLIENT_ID \\\n  --oauth2-client-secret=CLIENT_SECRET\n\n# === Enable IAP on Cloud Run ===\n# First grant IAP service account the Cloud Run Invoker role\ngcloud run services add-iam-policy-binding my-service \\\n  --member=\"serviceAccount:service-PROJECT_NUM@gcp-sa-iap.iam.gserviceaccount.com\" \\\n  --role=\"roles\u002Frun.invoker\" \\\n  --region=us-central1\n\n# Enable IAP on the Cloud Run backend service\ngcloud compute backend-services update my-cloud-run-backend \\\n  --iap=enabled,oauth2-client-id=CLIENT_ID,oauth2-client-secret=CLIENT_SECRET \\\n  --global\n\n# === Enable IAP TCP Forwarding for SSH\u002FRDP ===\n# No load balancer needed - uses IAP tunnel\ngcloud compute instances add-iam-policy-binding my-vm \\\n  --member=\"group:developers@company.com\" \\\n  --role=\"roles\u002Fiap.tunnelResourceAccessor\" \\\n  --zone=us-central1-a\n\n# SSH through IAP tunnel\ngcloud compute ssh my-vm --zone=us-central1-a --tunnel-through-iap\n\n# RDP through IAP tunnel\ngcloud compute start-iap-tunnel my-windows-vm 3389 \\\n  --local-host-port=localhost:3390 \\\n  --zone=us-central1-a\n```\n\n### Step 2: Configure IAM Bindings for Access Control\n\nGrant access to specific users and groups with optional access level conditions.\n\n```bash\n# Grant basic access to a group\ngcloud iap web add-iam-policy-binding \\\n  --resource-type=backend-services \\\n  --service=my-backend-service \\\n  --member=\"group:engineering@company.com\" \\\n  --role=\"roles\u002Fiap.httpsResourceAccessor\"\n\n# Grant access with access level condition\ngcloud iap web add-iam-policy-binding \\\n  --resource-type=backend-services \\\n  --service=finance-app \\\n  --member=\"group:finance@company.com\" \\\n  --role=\"roles\u002Fiap.httpsResourceAccessor\" \\\n  --condition='expression=request.auth.access_levels.exists(x, x == \"accessPolicies\u002FPOLICY_ID\u002FaccessLevels\u002Fcorporate-device\"),title=RequireCorporateDevice,description=Requires managed corporate device'\n\n# Grant access only during business hours\ngcloud iap web add-iam-policy-binding \\\n  --resource-type=backend-services \\\n  --service=admin-console \\\n  --member=\"group:admins@company.com\" \\\n  --role=\"roles\u002Fiap.httpsResourceAccessor\" \\\n  --condition='expression=request.time.getHours(\"America\u002FNew_York\") >= 8 && request.time.getHours(\"America\u002FNew_York\") \u003C= 18 && request.time.getDayOfWeek(\"America\u002FNew_York\") >= 1 && request.time.getDayOfWeek(\"America\u002FNew_York\") \u003C= 5,title=BusinessHoursOnly'\n\n# Grant access to a specific URL path\ngcloud iap web add-iam-policy-binding \\\n  --resource-type=backend-services \\\n  --service=internal-api \\\n  --member=\"group:api-consumers@company.com\" \\\n  --role=\"roles\u002Fiap.httpsResourceAccessor\" \\\n  --condition='expression=request.path.startsWith(\"\u002Fapi\u002Fv2\u002F\"),title=APIv2Access'\n```\n\n### Step 3: Create Access Levels with Access Context Manager\n\nDefine context-based access requirements using device attributes and network conditions.\n\n```bash\n# Create access level requiring encrypted corporate device\ncat > managed-device.yaml \u003C\u003C 'EOF'\n- devicePolicy:\n    allowedEncryptionStatuses:\n      - ENCRYPTED\n    osConstraints:\n      - osType: DESKTOP_WINDOWS\n        minimumVersion: \"10.0.19045\"\n      - osType: DESKTOP_MAC\n        minimumVersion: \"14.0\"\n      - osType: DESKTOP_CHROME_OS\n    requireScreenlock: true\n    requireAdminApproval: true\n    allowedDeviceManagementLevels:\n      - ADVANCED\nEOF\n\ngcloud access-context-manager levels create managed-device \\\n  --policy=POLICY_ID \\\n  --title=\"Managed Device\" \\\n  --basic-level-spec=managed-device.yaml\n\n# Create access level for corporate network\ncat > corp-network.yaml \u003C\u003C 'EOF'\n- ipSubnetworks:\n    - \"203.0.113.0\u002F24\"\n    - \"198.51.100.0\u002F24\"\n  regions:\n    - US\n    - GB\nEOF\n\ngcloud access-context-manager levels create corp-network \\\n  --policy=POLICY_ID \\\n  --title=\"Corporate Network\" \\\n  --basic-level-spec=corp-network.yaml\n\n# Create custom access level using CEL for complex logic\ncat > high-trust.yaml \u003C\u003C 'EOF'\nexpression: >\n  device.encryption_status == DeviceEncryptionStatus.ENCRYPTED &&\n  device.is_admin_approved_device == true &&\n  (\n    origin.ip in [\"203.0.113.0\u002F24\"] ||\n    device.os_type == OsType.DESKTOP_CHROME_OS\n  ) &&\n  request.auth.claims.hd == \"company.com\"\nEOF\n\ngcloud access-context-manager levels create high-trust \\\n  --policy=POLICY_ID \\\n  --title=\"High Trust\" \\\n  --custom-level-spec=high-trust.yaml\n```\n\n### Step 4: Configure Session Settings and Re-authentication\n\nSet session duration and re-authentication policies per application.\n\n```bash\n# Configure re-authentication for a backend service\n# Requires login every 4 hours for sensitive apps\ngcloud iap settings set \\\n  --project=PROJECT_ID \\\n  --resource-type=compute \\\n  --service=finance-app \\\n  reauthSettings.method=LOGIN \\\n  reauthSettings.maxAge=14400s \\\n  reauthSettings.policyType=MINIMUM\n\n# Configure session settings for App Engine\ngcloud iap settings set \\\n  --project=PROJECT_ID \\\n  --resource-type=app-engine \\\n  reauthSettings.method=SECURE_KEY \\\n  reauthSettings.maxAge=3600s \\\n  reauthSettings.policyType=MINIMUM\n\n# View current IAP settings\ngcloud iap settings get \\\n  --project=PROJECT_ID \\\n  --resource-type=compute \\\n  --service=finance-app\n```\n\n### Step 5: Configure Programmatic Access for Service Accounts\n\nEnable service-to-service communication through IAP-protected endpoints.\n\n```python\n#!\u002Fusr\u002Fbin\u002Fenv python3\n\"\"\"Access IAP-protected resource using service account credentials.\"\"\"\n\nimport google.auth\nimport google.auth.transport.requests\nfrom google.auth import impersonated_credentials\nimport requests as req\n\nIAP_CLIENT_ID = \"YOUR_IAP_OAUTH_CLIENT_ID.apps.googleusercontent.com\"\nIAP_URL = \"https:\u002F\u002Fmy-app.company.com\u002Fapi\u002Fdata\"\n\ndef access_iap_resource():\n    # Get default credentials (works with service account key or workload identity)\n    credentials, project = google.auth.default()\n\n    # Create IAP-authenticated request\n    authed_session = google.auth.transport.requests.AuthorizedSession(\n        credentials,\n        target_audience=IAP_CLIENT_ID\n    )\n\n    # Make request to IAP-protected resource\n    response = authed_session.get(IAP_URL)\n    print(f\"Status: {response.status_code}\")\n    print(f\"Response: {response.text[:500]}\")\n\n    return response\n\nif __name__ == \"__main__\":\n    access_iap_resource()\n```\n\n### Step 6: Set Up Audit Logging and Monitoring\n\nConfigure logging for all IAP access decisions.\n\n```bash\n# Enable data access audit logs for IAP\ngcloud projects get-iam-policy PROJECT_ID --format=json > policy.json\n\n# Add IAP audit config to policy.json:\n# {\n#   \"service\": \"iap.googleapis.com\",\n#   \"auditLogConfigs\": [\n#     {\"logType\": \"ADMIN_READ\"},\n#     {\"logType\": \"DATA_READ\"},\n#     {\"logType\": \"DATA_WRITE\"}\n#   ]\n# }\n\ngcloud projects set-iam-policy PROJECT_ID policy.json\n\n# Create log-based metric for denied access\ngcloud logging metrics create iap-denied-access \\\n  --description=\"Count of IAP access denials\" \\\n  --log-filter='resource.type=\"gce_backend_service\" AND protoPayload.status.code=16'\n\n# Create alerting policy for high denial rates\ngcloud alpha monitoring policies create \\\n  --display-name=\"IAP High Denial Rate\" \\\n  --condition-display-name=\"Denied access > 50 in 5 min\" \\\n  --condition-filter='metric.type=\"logging.googleapis.com\u002Fuser\u002Fiap-denied-access\"' \\\n  --condition-threshold-value=50 \\\n  --condition-threshold-duration=300s \\\n  --notification-channels=projects\u002FPROJECT_ID\u002FnotificationChannels\u002FCHANNEL_ID\n\n# Query IAP access logs\ngcloud logging read '\n  resource.type=\"gce_backend_service\"\n  protoPayload.serviceName=\"iap.googleapis.com\"\n  timestamp >= \"2026-02-22T00:00:00Z\"\n' --project=PROJECT_ID --format='table(timestamp,protoPayload.authenticationInfo.principalEmail,protoPayload.status.code,resource.labels.backend_service_name)' --limit=50\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| Identity-Aware Proxy | GCP service that intercepts web requests and TCP connections, authenticating users and evaluating access policies before proxying to backend services |\n| Backend Service | GCP load balancer component that IAP protects; can serve Compute Engine instances, GKE pods, Cloud Run services, or App Engine |\n| IAP Tunnel | Secure TCP tunnel through IAP allowing SSH, RDP, and other TCP access to VMs without public IPs or VPN |\n| OAuth Consent Screen | GCP configuration specifying the application name and support email shown to users during IAP authentication |\n| Access Level | Named condition in Access Context Manager evaluated during IAP authorization (device posture, IP, geography) |\n| Re-authentication | IAP feature requiring users to prove their identity again after a configurable session duration |\n\n## Tools & Systems\n\n- **Google Cloud IAP**: Identity-aware reverse proxy for GCP applications and TCP services\n- **Access Context Manager**: Defines access levels based on device, network, and geographic attributes\n- **gcloud CLI**: Command-line tool for configuring IAP, access levels, and IAM bindings\n- **IAP TCP Forwarding**: Tunnel-based access to VMs for SSH\u002FRDP without public IPs\n- **Cloud Audit Logs**: Immutable records of all IAP access decisions for compliance\n- **Endpoint Verification**: Chrome extension collecting device attributes for access level evaluation\n\n## Common Scenarios\n\n### Scenario: Securing 15 Internal GCP Services with IAP\n\n**Context**: An e-commerce company runs 15 internal services on GKE and Cloud Run (admin dashboards, internal APIs, monitoring tools). Currently, these services are protected only by VPN and firewall rules, creating excessive network-level access.\n\n**Approach**:\n1. Deploy all services behind an HTTPS Load Balancer with managed SSL certificates\n2. Enable IAP on each backend service with per-service OAuth clients\n3. Create IAM bindings mapping Google Groups to specific services (admin group -> admin dashboard, engineering -> monitoring)\n4. Define access levels: managed-device (encryption + screen lock), corp-network (office IP ranges)\n5. Apply managed-device access level to admin dashboard and financial tools\n6. Configure IAP TCP tunneling for SSH access to GKE nodes (replacing SSH bastion host)\n7. Set re-authentication to 4 hours for admin tools, 8 hours for monitoring\n8. Configure Cloud Audit Logs and create alerting for repeated denials\n\n**Pitfalls**: IAP adds 10-50ms latency per request; test application performance. WebSocket connections through IAP require specific backend service configuration. Service-to-service calls within GKE should bypass IAP using internal service mesh, not external IAP endpoints. Break-glass access should use a separate IAM binding without access level conditions.\n\n## Output Format\n\n```\nGoogle Cloud IAP Configuration Report\n==================================================\nProject: ecommerce-internal\nReport Date: 2026-02-23\n\nIAP-PROTECTED SERVICES:\n  Backend Services:     12\n  App Engine:            1\n  Cloud Run:             2\n  IAP TCP Tunnels:       4 (SSH access)\n  Total:                19\n\nACCESS CONTROL:\n  IAM Bindings:         34\n  With Access Levels:   18 (52.9%)\n  Access Levels:         3 (managed-device, corp-network, high-trust)\n\nSESSION POLICIES:\n  Admin tools:          4h re-auth (SECURE_KEY)\n  Sensitive apps:       4h re-auth (LOGIN)\n  General tools:        8h re-auth (LOGIN)\n\nACCESS LOGS (last 24h):\n  Total requests:       23,456\n  Authenticated:        23,289 (99.3%)\n  Denied by IAM:           112\n  Denied by access level:   55\n  Unique users:            134\n```\n",{"name":5,"note":25,"tags":26,"author":34,"domain":35,"source":36,"license":15,"version":37,"nist_csf":38,"subdomain":43,"description":44,"mitre_attack":45,"source_commit":49},"Vendored verbatim from an external Apache-2.0 security-skill library, pinned by commit. Exceeds the internal 300-line skill guideline (agent-code-constraints.md) -- kept as-is because this is vendored reference material (forensics\u002Fthreat-intel procedure), not Yana AI-authored content, and trimming would damage technical accuracy.",[27,28,29,30,31,32,33],"google-iap","identity-aware-proxy","gcp","zero-trust","access-context-manager","cloud-run","app-engine","mahipal","cybersecurity","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","1.0",[39,40,41,42],"PR.AA-01","PR.AA-05","PR.IR-01","GV.PO-01","zero-trust-architecture","Configuring Google Cloud Identity-Aware Proxy (IAP) to enforce per-request identity verification for Compute Engine, App Engine, Cloud Run, and GKE services using access levels, context-aware policies, and programmatic access with service accounts.\n",[46,47,48],"T1078.004","T1133","T1021.007","04450304b12645cb2b974ab96d28c0664758a88d","main","481dcd7dd2e288b9d627a2bd017db70e64e6c6fa",".claude\u002Fskills\u002Fconfiguring-identity-aware-proxy-with-google-iap",2,"https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI","https:\u002F\u002Fyana.vutam.link\u002F","https:\u002F\u002Fgithub.com\u002FHoronomos-laps","https:\u002F\u002Fyana.vutam.link","An open-source governed runtime & execution environment for multi-agent AI systems.","2026-11-14 13:24:09",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add Horonomos-laps\u002FYana-AI --skill configuring-identity-aware-proxy-with-google-iap",{"tool":66,"command":67},"bunx","bunx skills add Horonomos-laps\u002FYana-AI --skill configuring-identity-aware-proxy-with-google-iap",{"tool":69,"command":70},"pnpm","pnpm dlx skills add Horonomos-laps\u002FYana-AI --skill configuring-identity-aware-proxy-with-google-iap","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fconfiguring-identity-aware-proxy-with-google-iap\u002FSKILL.md",true,[74,80,84,90,94,98,104],{"path":75,"resourceType":76,"resourceTypeDesc":77,"sizeBytes":78,"sourceHtmlUrl":79},"assets\u002Ftemplate.md","ASSET","资产文件",2266,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fconfiguring-identity-aware-proxy-with-google-iap\u002Fassets\u002Ftemplate.md",{"path":81,"resourceType":81,"resourceTypeDesc":82,"sizeBytes":83,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Fapi-reference.md","REFERENCE","参考文档",1597,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fconfiguring-identity-aware-proxy-with-google-iap\u002Freferences\u002Fapi-reference.md",{"path":91,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fstandards.md",1762,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fconfiguring-identity-aware-proxy-with-google-iap\u002Freferences\u002Fstandards.md",{"path":95,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":96,"sourceHtmlUrl":97},"references\u002Fworkflows.md",2490,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fconfiguring-identity-aware-proxy-with-google-iap\u002Freferences\u002Fworkflows.md",{"path":99,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":102,"sourceHtmlUrl":103},"scripts\u002Fagent.py","SCRIPT","脚本",4547,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fconfiguring-identity-aware-proxy-with-google-iap\u002Fscripts\u002Fagent.py",{"path":105,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":106,"sourceHtmlUrl":107},"scripts\u002Fprocess.py",7875,"https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fconfiguring-identity-aware-proxy-with-google-iap\u002Fscripts\u002Fprocess.py",[109,117,124,132,140,148],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":113,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":116,"publishedAt":20},"01M735GKET5YVYKAY62W2P5YXB","openai--sentry--sentry","Use when the user asks to inspect Sentry issues or events, summarize recent production errors, or pull basic Sentry health data via the Sentry API; perform read-only queries with the bundled script and require `SENTRY_AUTH_TOKEN`.","MIT","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fopenai--sentry--sentry\u002FSKILL.md",[],[],{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":20},"01M73DCAP83T17HY7SMGK7MGFE","ito-basket-compare","Compare Itô prediction-market baskets against a user's knowledge base, portfolio notes, financial context, watchlist, or research thesis. Use for read-only basket comparison and gap analysis without investment advice or live trading.","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fito-basket-compare\u002FSKILL.md",[],[],{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":128,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":20},"01M734CYEMZFDR3KH6SW0JP8TD","implementing-network-traffic-baselining","Build network traffic baselines from NetFlow\u002FIPFIX data using Python pandas for statistical analysis, z-score anomaly detection, and hourly\u002Fdaily traffic pattern profiling","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-network-traffic-baselining\u002FSKILL.md",[],[],{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":136,"sourceHtmlUrl":137,"categories":138,"keywords":139,"publishedAt":20},"01M73ASZ6NJRJM44Z2P84NGQ3Q","detecting-evasion-techniques-in-endpoint-logs","Detects defense evasion techniques used by adversaries in endpoint logs including log tampering, timestomping, process injection, and security tool disabling. Use when investigating suspicious endpoint behavior, building detection rules for evasion tactics, or conducting threat hunting for stealthy adversary activity. Activates for requests involving evasion detection, defense evasion analysis, log tampering detection, or MITRE ATT&CK TA0005.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002Fcore\u002Fskills\u002Fdetecting-evasion-techniques-in-endpoint-logs\u002FSKILL.md",[],[],{"skillNo":141,"name":142,"nameZh":6,"description":143,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":144,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":20},"01M734AFNXD06Z78QRK0VKGT7Q","implementing-microsegmentation-with-guardicore","Implementing microsegmentation using Akamai Guardicore Segmentation to map application dependencies, create granular network policies, visualize east-west traffic flows, and enforce least-privilege communication between workloads across data centers and cloud.","https:\u002F\u002Fgithub.com\u002Fyanacuti1121\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fimplementing-microsegmentation-with-guardicore\u002FSKILL.md",[],[],{"skillNo":149,"name":150,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":151,"categories":152,"keywords":153,"publishedAt":20},"01M736TK27QMCXK0DVCH25SJN5","ramdisk-tmpfs-patterns","https:\u002F\u002Fgithub.com\u002FHoronomos-laps\u002FYana-AI\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Framdisk-tmpfs-patterns\u002FSKILL.md",[],[]]