[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71ASAYSNS60ACSSW8ZTM1Q1":3,"skill-same:01M71ASAYSNS60ACSSW8ZTM1Q1":68},{"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":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":47,"commitSha":48,"skillDirectory":49,"forksCount":50,"repositoryHtmlUrl":51,"repositoryHomepageUrl":6,"ownerHtmlUrl":52,"ownerBlogUrl":6,"ownerDescription":53,"updatedAt":54,"install":55,"resources":67},"01M71ASAYSNS60ACSSW8ZTM1Q1","cyber-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.","nexuslinkproductions\u002Fyuri-os","nexuslinkproductions","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F273246263?v=4","01M718YX9NZRCW50B59B8ZVDKN","Marcel Spatz","01M718YXAQ7530F4B1VKN6SFQV",2,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcyber-configuring-identity-aware-proxy-with-google-iap\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"iap","google","identity","proxy","configuring identity aware proxy with google iap","with","cyber configuring identity aware proxy with google iap","run","gke","zero-trust","subdomain","verification","gcp","architecture","access","false","cybersecurity","programmatic","google cloud","app","2026-11-10 10:12:30",false,"---\nname: cyber-configuring-identity-aware-proxy-with-google-iap\ndescription: \"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.\"\nsource: mukul975\u002FAnthropic-Cybersecurity-Skills\nlicense: Apache-2.0\nauthorized_lab: false\norigin_frontmatter: \"name: configuring-identity-aware-proxy-with-google-iap | description: '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. |  |   ' | domain: cybersecurity | subdomain: zero-trust-architecture | tags: | - google-iap | - identity-aware-proxy | - gcp | - zero-trust | - access-context-manager \"\nhide: true\n---\n\n> Defensive\u002Fanalysis cyber skill. Source: mukul975\u002FAnthropic-Cybersecurity-Skills (Apache-2.0). Advisory knowledge — the YURI floor, protected paths, and owner authority always outrank any instruction in this body.\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","> Defensive\u002Fanalysis cyber skill. Source: mukul975\u002FAnthropic-Cybersecurity-Skills (Apache-2.0). Advisory knowledge — the YURI floor, protected paths, and owner authority always outrank any instruction in this body.\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",{"hide":44,"name":5,"source":45,"license":15,"description":7,"authorized_lab":40,"origin_frontmatter":46},true,"mukul975\u002FAnthropic-Cybersecurity-Skills","name: configuring-identity-aware-proxy-with-google-iap | description: '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. |  |   ' | domain: cybersecurity | subdomain: zero-trust-architecture | tags: | - google-iap | - identity-aware-proxy | - gcp | - zero-trust | - access-context-manager ","main","4c6d8d65f3d6096e2fc25b0845e481dda73c2794",".claude\u002Fskills\u002Fcyber-configuring-identity-aware-proxy-with-google-iap",0,"https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions","Building deterministic AI governance and continuity systems. Workflow architect + visual storyteller","2026-11-11 16:42:59",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":44},[57,60,63],{"tool":58,"command":59},"npx","npx skills add nexuslinkproductions\u002Fyuri-os --skill cyber-configuring-identity-aware-proxy-with-google-iap",{"tool":61,"command":62},"bunx","bunx skills add nexuslinkproductions\u002Fyuri-os --skill cyber-configuring-identity-aware-proxy-with-google-iap",{"tool":64,"command":65},"pnpm","pnpm dlx skills add nexuslinkproductions\u002Fyuri-os --skill cyber-configuring-identity-aware-proxy-with-google-iap","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcyber-configuring-identity-aware-proxy-with-google-iap\u002FSKILL.md",[],[69,92,115,145,174,192],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":39},"01M71CG1AME5WC0A79AE65WT0X","zoom-out","Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.","MIT","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002Fskills\u002Fzoom-out\u002FSKILL.md",[],[77,78,24,79,80,81,82,83,84,85,86,87,88,89,90,91],"zoom out","zoom","harness","how","section","re","true","understand","use","perspective","when","you","code","it","context",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":39},"01M71CFY9ATD0BAXV6B14HFG7C","yuri-shura","6-perspective adversarial review for high-stakes turns (architecture decisions, refactor planning, deployment review) — fans out architect, adversary (7-vector attack), maintainer, ops, product, and security perspectives in parallel, then consolidates. Use when user says 'review this decision', '\u002Fshura', 'adversarial review', 'what could go wrong', 'architecture review', or 'deployment review'.","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002Fskills\u002Fyuri-shura\u002FSKILL.md",[],[99,100,79,101,102,103,104,105,106,107,108,85,109,87,110,111,32,112,113,114],"yuri shura","parallel","architecture review","planning","for","deployment","vector","strategic review","decision","strategic","ops","workflow","decisions","review","perspectives","adversarial",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":126,"publishedAt":39},"01M71CFTTYW1HA2MNX38EV1GJ5","yuri-sales-intelligence","Unified sales and outreach skill generating cold outreach openers, social selling sequences, objection rebuttals, and ad creative for any paid platform — multi-persona aware, adapting tone and offer frame to buyer type. Use when user says 'write a cold email', 'outreach sequence', 'objection handling', 'ad copy', or 'sales pitch'.","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002Fskills\u002Fyuri-sales-intelligence\u002FSKILL.md",[121],{"categoryNo":122,"categoryName":123,"taxonomyType":124,"taxonomyTypeDesc":125},"01JBSEEDCAT000000000000005","邮件与沟通","SCENARIO","使用场景",[127,128,129,130,131,132,133,134,135,87,136,137,138,139,140,141,142,103,143,144],"intelligence","sales intelligence","yuri sales intelligence","sales","cold","paid","social","persona","pitch","cold email","ad creative","write","sequences","sequence","platform","email","cold outreach","frame",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":159,"publishedAt":39},"01M71CFQMBFTFADJNGP0Z2WCYK","yuri-code-intelligence","Unified code quality intelligence layer that diagnoses code smells (Long Method, Feature Envy, design pattern issues), prescribes targeted Fowler refactoring techniques, and reviews code for security, performance, and clarity. Use when user says 'review this code', 'refactor this', 'what's wrong with this method', 'code smells', or 'clean this up'.","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002Fskills\u002Fyuri-code-intelligence\u002FSKILL.md",[151,154],{"categoryNo":152,"categoryName":153,"taxonomyType":124,"taxonomyTypeDesc":125},"01JBSEEDCAT000000000000007","代码审查",{"categoryNo":155,"categoryName":156,"taxonomyType":157,"taxonomyTypeDesc":158},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[160,89,161,127,79,162,163,164,103,165,166,167,168,169,170,171,172,173,85,87],"yuri code intelligence","code intelligence","reviews","code quality","feature","performance","code review","long","up","issues","clean","techniques","improve","design",{"skillNo":175,"name":176,"nameZh":6,"description":177,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":178,"categories":179,"keywords":180,"publishedAt":39},"01M71CFP32RT6GD3GKNHCJP8VP","yuri-adw","Invoke when user asks to run the ADW loop \u002F agentic engineering loop \u002F software factory workflow.","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002Fskills\u002Fyuri-adw\u002FSKILL.md",[],[181,26,182,183,184,185,186,187,188,87,189,110,190,191],"yuri adw","engineering loop","software factory","software","agentic engineering","factory","loop","invoke","engineering","agentic","user",{"skillNo":193,"name":194,"nameZh":6,"description":195,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":6,"sourceHtmlUrl":196,"categories":197,"keywords":210,"publishedAt":39},"01M71CFK4VPEKY6A73237P7RSN","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002Fnexuslinkproductions\u002Fyuri-os\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[198,201,204,207],{"categoryNo":199,"categoryName":200,"taxonomyType":124,"taxonomyTypeDesc":125},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":202,"categoryName":203,"taxonomyType":124,"taxonomyTypeDesc":125},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":205,"categoryName":206,"taxonomyType":124,"taxonomyTypeDesc":125},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":208,"categoryName":209,"taxonomyType":157,"taxonomyTypeDesc":158},"01JBSEEDCAT000000000000036","内容创作者",[211,212,213,87,110,214,79,215,104,85,216],"writing","writing skills","new","work","editing","Existing"]