Join our Newsletter — 33% off our NHI Course
Home› Guides› Identity-Aware Proxy Guide: Context-Aware Access to Apps and…
Guide Cloud Security

Identity-Aware Proxy Guide: Context-Aware Access to Apps and VMs Without Bastions

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 8 November 2026 14 min read
On this page

Google Cloud Identity-Aware Proxy (IAP) can replace VPNs and bastion hosts with per-request identity checks, but only if nothing can reach the backend except through IAP and the application verifies what IAP tells it. Teams turn IAP on in front of an internal tool, then leave a firewall rule that lets any VM in the VPC reach the backend port, keep the Cloud Run run.app URL open, or trust an x-goog-authenticated-user-email header an attacker can forge once IAP is bypassed. This guide covers IAP for HTTPS applications and IAP TCP forwarding for SSH, RDP and other ports, including on-premises targets through tunnel destination groups. It explains the IAM roles, context-aware access with access levels, reauthentication, programmatic access by service accounts, signed header verification and logging. It is for Google Cloud platform engineers and security architects replacing bastions or VPN access. For the general zero trust access model, read the ZTNA Guide first.

This is an independent guide from NHI Mgmt Group, based on Google Cloud's public documentation as of November 2026. It is not sponsored or reviewed by Google. Product features change, so confirm settings against Google Cloud's current documentation.

Key takeaways

  • IAP is only as strong as the bypass paths you close. Restrict backend firewall rules to load balancer traffic, disable or restrict Cloud Run default URLs, and remember that code on the same VM can always reach the port.
  • Verify the signed JWT, not the email header. Applications should validate x-goog-iap-jwt-assertion (ES256, iss https://cloud.google.com/iap, the correct aud) and use its sub and email claims.
  • TCP forwarding replaces bastions. Allow ingress only from 35.235.240.0/20 on the ports you need, remove external IPs, and grant roles/iap.tunnelResourceAccessor per instance or with destination.port conditions.
  • Context comes from access levels. Bind roles/iap.httpsResourceAccessor with a condition on request.auth.access_levels; device-based levels need a Chrome Enterprise Premium licence.
  • Owners and Editors still matter. Owner can change IAP access policies and use TCP forwarding; Editor can switch IAP off. Use IAP Policy Admin for policy management and alert on IAP setting changes.

How identity and access work in Identity-Aware Proxy

IAP sits in Google's serving path. For each request it authenticates the user, then checks IAM on the IAP-secured resource before the request reaches your backend.

Resource typeHow IAP is attachedMain bypass path to close
App EngineIAP enabled on the app, service or versionIngress settings that expose the app another way
Cloud RunDirectly on the service (covers all ingress paths) or through a load balancer with a serverless backendThe default run.app URL when IAP is only on the load balancer; Google does not recommend enabling IAP on both
Compute Engine and GKEBackend service of an external or internal HTTP(S) load balancerFirewall rules allowing other VMs or the internet to reach the backend port directly
VMs over TCP (SSH, RDP, other ports)IAP TCP forwarding from Google's range 35.235.240.0/20 (IPv6 2600:2d00:1:7::/64)External IPs or broad firewall rules left in place
On-premises or other cloud hosts over TCPTunnel destination groups reached over Cloud VPN or Cloud InterconnectDirect routes into the private network that bypass IAP

Authentication sources

  • Browser users: Google accounts, Workforce Identity Federation or Identity Platform (for customer-facing apps). IAP stores a session cookie after sign-in.
  • OAuth client: enabling IAP creates an OAuth 2.0 client ID and secret. Deleting them breaks IAP, so protect them from cleanup scripts.
  • Programmatic callers: service accounts present an OIDC ID token or a signed service account JWT; user accounts from desktop apps use a desktop OAuth client. Programmatic user access works only with Google identities, not Identity Platform or Workforce Identity Federation.

What IAP does not do

IAP authorises requests to supported entry points. It does not inspect traffic between VMs inside the project, does not authorise actions inside the application, and does not replace application-level authorisation. A user with httpsResourceAccessor reaches the whole application unless IAM conditions restrict host or path.

Admin roles and privileged access

RoleRole IDGrantsNotes
IAP-Secured Web App Userroles/iap.httpsResourceAccessorAccess to IAP-secured HTTPS resourcesGrant per backend service or Cloud Run service rather than project-wide
IAP-Secured Tunnel Userroles/iap.tunnelResourceAccessoriap.tunnelInstances.accessViaIAP and iap.tunnelDestGroups.accessViaIAPGrant per instance or destination group; tags are not supported for granting it
IAP Policy Adminroles/iap.adminManage IAP access policies, including destination group IAMUse instead of Owner for policy management
Tunnel destination group editoriap.tunnelDestGroupEditorCreate and change destination groups (which CIDRs and FQDNs are reachable)Effectively network reachability control; keep to the network team
Ownerroles/ownerSame policy rights as IAP Policy Admin, and can use TCP forwardingDoes not by itself grant web app access
Editorroles/editorCan turn IAP on or off; cannot modify access policiesTurning IAP off on a resource with open backends exposes it

Securing SSH and RDP through IAP

  • Tunnel permission is not login permission: IAP decides who can open the tunnel; the VM still authenticates the user. Combine IAP with OS Login so SSH access is also tied to IAM, rather than metadata SSH keys. Without OS Login, gcloud compute ssh needs metadata-writing permissions such as compute.instances.setMetadata, which are powerful in their own right. See the SSH Key Management Guide.
  • Restrict by port and target: use IAM conditions on destination.ip and destination.port, for example allowing only port 22 for Linux operators and 3389 for Windows administrators. See the Remote Desktop (RDP) Security Guide.
  • Force the tunnel: gcloud compute ssh --tunnel-through-iap forces IAP, and VMs without an external IP use it automatically. --internal-ip bypasses IAP and should fail by design if firewalls are right.
  • Session limits: IAP disconnects TCP sessions after one hour of inactivity and may rate-limit bulk transfer; it is not a file transfer channel.
  • Make access just-in-time: grant tunnel roles with time-bound IAM conditions or through an approval workflow rather than permanently. See the JIT Access Guide.

Integrations, API tokens and service accounts

Context-aware access

  • Access levels: created in Access Context Manager in the organisation's access policy (use the organisation-level policy, and confirm current options with Google). Levels can test IP ranges and, with Chrome Enterprise Premium, device attributes such as management state or encryption.
  • Binding: add a conditional binding of roles/iap.httpsResourceAccessor with a condition such as "accessPolicies/ORG_NUMBER/accessLevels/corp_devices" in request.auth.access_levels, optionally combined with host or path checks. One condition per binding; gcloud supports only project-level conditional bindings, so use the console or API for app-level ones.
  • Public bindings: bindings to allUsers or allAuthenticatedUsers cannot carry conditions, so a path-scoped "public" area has to be handled differently.
  • Reauthentication: reauthSettings in IapSettings forces periodic reauthentication with maxAge (minimum 300 seconds) and a method of LOGIN, ENROLLED_SECOND_FACTORS or SECURE_KEY. MINIMUM policy type merges with parent settings, taking the shorter duration and stronger method. It applies to browser flows only: service accounts and IAP-TCP are exempt, as are Workforce Identity Federation and external identities.

Service accounts calling IAP-protected apps

MethodAudienceRequired roleSecurity notes
OIDC ID tokenOAuth client ID of the IAP resourceroles/iam.serviceAccountOpenIdTokenCreator when impersonating another accountToken must carry an email claim; client ID must be allowlisted for programmatic access
Service account JWTResource URL, exact or with /*roles/iam.serviceAccountTokenCreator, granted on the target service account, not the projectLifetime up to 3600 seconds; sign through the IAM Credentials signJwt API instead of a local key file
User ID token from desktop appAllowlisted desktop OAuth clientUser holds httpsResourceAccessorRefresh tokens cannot satisfy access level policies; full reauthentication required

Tokens go in Authorization: Bearer, or in Proxy-Authorization: Bearer when the application needs its own Authorization header; IAP strips Proxy-Authorization before forwarding. Prefer keyless signing and workload identity; a downloaded service account key that can mint IAP tokens is a portable credential for every app it can reach (ATT&CK T1550.001 Application Access Token). See the Google Cloud Service Account Keys Security Guide.

Verifying signed headers in the application

  1. Read x-goog-iap-jwt-assertion and reject requests without it.
  2. Check the header algorithm is ES256 and the kid matches a key from https://www.gstatic.com/iap/verify/public_key-jwk; cache and refresh keys, because IAP rotates them.
  3. Check iss equals https://cloud.google.com/iap, exp and iat within 30 seconds of skew, and aud equals the exact value for your backend, for example /projects/PROJECT_NUMBER/global/backendServices/SERVICE_ID or /projects/PROJECT_NUMBER/locations/REGION/services/SERVICE_NAME.
  4. Use the token's sub and email claims as the identity, never the unsigned x-goog-authenticated-user-* headers.

Google's stated reason for this check is defence against IAP being disabled, misconfigured firewalls and access from inside the project. See the JWT Security Guide.

Logging and detection

EventWhere it appearsDetection use
IAP access policy changedAdmin Activity: IdentityAwareProxyAdminService.SetIamPolicyNew principal granted app or tunnel access
IAP settings or reauth changedData Access: UpdateIapSettingsReauthentication relaxed or access settings altered
Destination groups created or changedData Access: CreateTunnelDestGroup, UpdateTunnelDestGroup, DeleteTunnelDestGroupNew on-premises ranges made reachable
Access decisionsIAP Data Access logs: authorizationInfo.granted, requestMetadata.callerIp, requestAttributesDenied bursts, access from unusual IPs, access levels met
IAP turned off or backend changedAdmin Activity on the backend service or Cloud Run serviceExposure window if backends are open
Firewall rules opening backend portsAdmin Activity on compute.firewallsNew bypass path; source ranges other than LB and IAP ranges
  • Enable Data Access logs for IAP: access decisions and most configuration reads and writes are Data Access, which is off by default in Google Cloud. Query with protoPayload.serviceName="iap.googleapis.com". See the Google Cloud Audit Logs and Log Sinks Guide.
  • Access levels in logs: logs list only the levels a user met, not the ones that blocked them, so compare against the resource's required levels during investigations.
  • Relevant ATT&CK techniques: T1133 External Remote Services (IAP tunnels as the remote access path), T1021.004 SSH and T1021.001 Remote Desktop Protocol for what happens after the tunnel, T1078.004 Cloud Accounts for stolen identities used through IAP.

Metrics that show it is working

  • Bastion and VPN retirement: number of VMs with external IPs or bastion hosts remaining in scope (trend to zero).
  • Bypass exposure: firewall rules allowing backend or admin ports from sources other than the load balancer or 35.235.240.0/20 (target zero).
  • Signed header adoption: percentage of IAP-protected applications that validate the JWT.
  • Standing tunnel access: principals with permanent project-level tunnelResourceAccessor (trend down).
  • Context coverage: percentage of sensitive apps with an access level condition and reauthentication policy.

Hardening baseline

  • Close every bypass: backend firewall rules allow only the load balancer health check and proxy ranges; admin ports allow only 35.235.240.0/20; Cloud Run services fronted by a load balancer use ingress set to internal and load balancer traffic, or have IAP enabled directly on the service.
  • Remove external IPs: enforce with the constraints/compute.vmExternalIpAccess organisation policy. See the Google Cloud Organization Policy Guide.
  • Grant narrowly: web access per backend or service, tunnel access per instance or destination group with port conditions, never to allAuthenticatedUsers.
  • Use OS Login for SSH targets and Windows credentials management for RDP targets behind IAP.
  • Context and reauth: access levels for sensitive apps, reauthentication with ENROLLED_SECOND_FACTORS or SECURE_KEY for administrative and confidential apps.
  • Validate signed headers in every application, with the audience pinned.
  • Policy ownership: IAP Policy Admin for a small group, Owner and Editor removed from production projects where possible.
  • Logging: IAP Data Access logs on, routed to the central sink, with alerts on policy and destination group changes.

Phased rollout: replacing a bastion

  1. Inventory: list bastions, VPN groups and VMs with external IPs; record who connects to what, on which ports.
  2. Prepare targets: enable OS Login, add the firewall rule from 35.235.240.0/20 on required ports, and keep the bastion running in parallel.
  3. Grant and pilot: give a pilot group tunnelResourceAccessor on specific instances with port conditions; test gcloud compute ssh --tunnel-through-iap and start-iap-tunnel for RDP.
  4. Add context: add an access level condition for managed devices or corporate IP ranges and confirm denials appear in logs.
  5. Cut over: remove external IPs and the bastion's firewall rules, then decommission the bastion. For on-premises hosts, create destination groups and advertise 35.235.240.0/20 on the Cloud Router so return traffic uses VPN or Interconnect.
  6. Roll back: restore the bastion firewall rule from change records; IAP grants can stay in place while you fix issues.

Decision guidance

  • IAP vs a third-party ZTNA: IAP is native for Google Cloud resources and hybrid hosts reachable over Interconnect or VPN, with IAM as the policy engine. A multi-cloud estate with many non-Google targets may prefer a provider-neutral ZTNA broker; the bypass and header verification lessons apply to both.
  • IAP on Cloud Run directly vs via load balancer: direct IAP covers all ingress paths with less configuration; a load balancer adds Cloud Armor, custom domains and multi-backend routing but requires closing the default URL.
  • Small vs large estates: a small team can grant tunnel access per project with port conditions; large estates should manage grants per instance or destination group through infrastructure as code and approval workflows.

Framework mapping

Control areaNIST SP 800-53 Rev 5NIST CSF 2.0CIS Controls v8.1ISO/IEC 27001:2022 Annex A
Per-request authorisation to apps and VMsAC-3, AC-6PR.AA-056 Access Control ManagementA.5.15 Access control, A.8.3 Information access restriction
Remote administrative access via TCP forwardingAC-17PR.AA-0512 Network Infrastructure ManagementA.6.7 Remote working, A.8.2 Privileged access rights
Authentication, reauthentication, sessionsIA-2, IA-11, AC-12PR.AA-036 Access Control ManagementA.8.5 Secure authentication
Closing bypass pathsSC-7PR.IR-0112 Network Infrastructure ManagementA.8.20 Networks security
IAP audit loggingAU-2, AU-6DE.CM-098 Audit Log ManagementA.8.15 Logging

Common misconfigurations

  • Open backend firewall: IAP on the load balancer while a rule allows 0.0.0.0/0 or the whole VPC to the backend port. Any VM in the network, or the internet, reaches the app without IAP (ATT&CK T1190 Exploit Public-Facing Application becomes possible against an app you thought was private).
  • Trusting unsigned headers: applications that read x-goog-authenticated-user-email accept forged identities as soon as a bypass exists.
  • Project-wide tunnel access: granting tunnelResourceAccessor at project level with no port condition gives every holder SSH and RDP to every VM in the project.
  • Default Cloud Run URL left open: IAP on the load balancer while the run.app URL accepts all traffic.
  • Bastion kept "just in case": the old path stays reachable and unmonitored after IAP goes live.
  • Deleting the IAP OAuth client: cleanup of "unused" OAuth clients breaks IAP; an unplanned disable may then expose backends that were never closed.

Practitioner checklist

  • Restrict backend firewall rules to load balancer ranges and admin ports to 35.235.240.0/20.
  • Remove external IPs from VMs and enforce it with organisation policy.
  • Grant httpsResourceAccessor per backend and tunnelResourceAccessor per instance or destination group with port conditions.
  • Add access level conditions and reauthentication for sensitive and administrative apps.
  • Validate x-goog-iap-jwt-assertion in every application with a pinned audience.
  • Use OS Login with IAP for SSH and keyless token signing for service accounts.
  • Close the Cloud Run default URL or enable IAP directly on the service.
  • Use IAP Policy Admin instead of Owner for policy management.
  • Enable IAP Data Access logs and alert on policy, settings and destination group changes.
  • Decommission bastions and VPN routes once IAP is live.

Standards and references

Related NHI Mgmt Group resources: ZTNA Guide · Compute Engine Security Guide · Cloud Run and Cloud Functions Security Guide · Google Cloud IAM and Service Accounts Guide · Privileged Access Workstations Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 8 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.