Skip to content

feat(iap): add external app load balancer, backend service, and managed certificate modules- #202 - #6632

Open
scott-nag wants to merge 6 commits into
GoogleCloudPlatform:developfrom
nagconsulting:remote-desktop-2
Open

scott-nag wants to merge 6 commits into
GoogleCloudPlatform:developfrom
nagconsulting:remote-desktop-2

Conversation

@scott-nag

@scott-nag scott-nag commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Remote desktops through an HTTPS load balancer behind IAP

This lets users reach the noVNC remote desktops (#6141) in a browser at an HTTPS hostname, signed in through Identity-Aware Proxy. No SSH tunnel is needed, and the existing SSH access still works alongside it.

Changes

  • desktop-broker, novnc-runtime, novnc-desktop:
    • New optional inputs iap_backend_service and iap_listen_port. When they're set, the broker also listens on TCP for the load balancer.
    • On that port, each request must carry an IAP assertion: ES256, minted for that backend service, and checked against aud and iss. The broker maps it to the user's OS Login account, and OS Login decides access, as it does over SSH.
    • It also refuses cross-site websocket upgrades.
  • New network/iap-backend-service: a backend service behind IAP, with a zonal NEG of the desktop hosts, a health check, and IAP members.
  • New network/ext-app-lb: the front end of a global external Application Load Balancer: address, certificate, URL map, and host routes to backend services defined elsewhere. TLS 1.2 is the minimum by default. It's the external counterpart of int-app-lb.
  • New network/managed-certificate: a Certificate Manager certificate authorised by DNS (wildcards supported), with a certificate map for ext-app-lb.
  • New example: community/examples/remote-desktop/hpc-slurm-remote-desktop-iap.yaml, a Slurm cluster with a login-node desktop and a visualization VM desktop, each at its own hostname.

Testing

  • The example deployed end to end with per-host certificates, and with a wildcard certificate from managed-certificate. Both desktops were reachable through IAP, and SSH access kept working.
  • Checked against the live deployment:
    • TLS 1.0 and 1.1 are refused.
    • Forged or unsigned requests sent from inside the VPC get a 401.
    • Cross-site websocket attempts are refused.
  • The broker unit tests pass (140), as do the pre-commit hooks.
  • make tests: TestInitUserConfig_ExistingIsGoogler (pkg/config) fails, but it also fails on an unmodified develop deployment.

Known limitation: ext-app-lb can't switch an existing load balancer from Compute Engine certificates to a certificate_map in place. The Google provider clears the proxy's certificates before setting the map, which the API rejects, so the load balancer has to be recreated. This is documented in the module README.

Cloud-Docs: none (adds community modules and one community blueprint; no public docs page changes required)

Pin IAP assertions to ES256, rate-limit key refetches, allow 60s clock skew, refuse cross-site websocket upgrades, require TLS 1.2 in ext-app-lb, pin cryptography (quoting pip specifiers so the pin installs), split the labels locals, and correct the docs on port reachability and the backend service lookup. Validate the OAuth client pair, and take the example's firewall port from the desktop runtime.
@scott-nag
scott-nag requested a review from a team as a code owner November 4, 2026 12:44
@github-actions github-actions Bot added the external PR from external contributor label Nov 4, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a secure, browser-based access method for remote desktops within a Slurm cluster environment. By leveraging Google Cloud's Identity-Aware Proxy (IAP) and an external Application Load Balancer, users can now access their desktops via HTTPS hostnames. The changes include new infrastructure modules for managing backend services, load balancers, and managed certificates, as well as significant updates to the desktop broker to handle IAP assertion verification and enhanced security checks for websocket connections.

Highlights

  • IAP-Secured Remote Desktops: Added support for accessing noVNC remote desktops via an HTTPS load balancer protected by Identity-Aware Proxy (IAP), eliminating the need for SSH tunnels.
  • New Network Modules: Introduced three new network modules: iap-backend-service for backend configuration, ext-app-lb for the global Application Load Balancer, and managed-certificate for DNS-authorized SSL certificates.
  • Broker Enhancements: Updated the desktop broker to support an optional TCP listener that verifies IAP assertions, maps them to OS Login accounts, and enforces origin checks for websockets.
  • New Example Blueprint: Added hpc-slurm-remote-desktop-iap.yaml, an example blueprint demonstrating a Slurm cluster with IAP-secured browser-based desktop access.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@scott-nag

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new blueprint and several supporting modules ("ext-app-lb", "iap-backend-service", and "managed-certificate") to enable browser-based Linux desktops on a Slurm cluster via an HTTPS load balancer behind Identity-Aware Proxy (IAP). It also updates the internal "desktop-broker" to support a TCP listener and verify signed IAP assertions. The review feedback suggests enhancing error handling in "iap.py" when parsing the service account token from the metadata server, and refactoring the "google_compute_network_endpoint" resource in "iap-backend-service/main.tf" to use "for_each" instead of "count" to prevent resource disruption during list reordering.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new blueprint (hpc-slurm-remote-desktop-iap.yaml) and three supporting network modules (ext-app-lb, iap-backend-service, and managed-certificate) to enable browser-based Linux desktops on a Slurm cluster reached via an HTTPS load balancer behind Identity-Aware Proxy (IAP). It also updates the desktop-broker and novnc modules to support TCP listening, verify signed IAP assertions, map Google accounts to OS Login accounts, and enforce cross-site websocket origin checks. The review feedback highlights opportunities to improve the robustness of the Python broker code, specifically by wrapping metadata token retrieval in a try...except block to handle parsing errors gracefully, and catching AttributeError when parsing JWKs. Additionally, a potential Terraform plan-time crash is addressed by suggesting the use of try() when accessing the computed dns_resource_record list in the managed certificate outputs.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for accessing remote desktops on a Slurm cluster via an HTTPS load balancer behind Identity-Aware Proxy (IAP). It adds new modules for a global external Application Load Balancer (ext-app-lb), an IAP backend service (iap-backend-service), and a Google-managed certificate (managed-certificate), along with a new example blueprint. The desktop-broker is updated to support a TCP listener, verify signed IAP assertions, map Google accounts to OS Login accounts, and enforce same-site websocket origin checks. The review feedback recommends improving robustness by rate-limiting metadata server refetches for unknown OS Login subjects to prevent potential DoS, and wrapping metadata token retrieval in a try-except block to handle parsing errors gracefully.

# Conflicts:
#	llms-full.txt
#	llms.txt
#	skills/cluster-blueprint-assistant/references/catalog.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external PR from external contributor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants