Skip to content

Add authentication documentation for Guacamole workspace service#4605

Open
Copilot wants to merge 8 commits intomainfrom
copilot/fix-ddf4bc13-2211-4725-a0a9-0b520ced7307
Open

Add authentication documentation for Guacamole workspace service#4605
Copilot wants to merge 8 commits intomainfrom
copilot/fix-ddf4bc13-2211-4725-a0a9-0b520ced7307

Conversation

Copy link
Contributor

Copilot AI commented Jun 26, 2025

Summary

This PR adds detailed documentation explaining how authentication to VMs works through the Guacamole workspace service in Azure TRE. The documentation clarifies the authentication flow for both internal and external users, addressing a gap in understanding how VM access is secured and managed.

Changes Made

Main User Documentation (docs/tre-templates/workspace-services/guacamole.md)

Added a new section "Authentication to VMs via Apache Guacamole in Azure TRE" that explains:

  • Initial Authentication: OIDC authentication via Azure Entra ID through OAuth2 Proxy
  • Token Validation: Role validation ensuring users have required claims (WorkspaceOwner, WorkspaceResearcher, or AirlockManager)
  • VM Discovery: How the extension queries the TRE API to fetch accessible VMs
  • Credential Injection: Transparent injection of VM credentials from Azure Key Vault without user exposure
  • Secure Access: Support for both internal and external users regardless of native Azure AD login capability

Technical Documentation (templates/workspace_services/guacamole/guacamole-server/guacamole-auth-azure/readme.md)

Enhanced the TRE Authorization extension section with:

  • Detailed Authentication Flow: Step-by-step technical process from token reception to credential injection
  • Security Features: Zero-trust access model, API-mediated authorization, and credential rotation capabilities
  • Implementation Details: Specific API endpoints, Key Vault secret naming patterns, and managed identity usage

Why This Matters

This documentation is particularly valuable for:

  • External Users: Understanding how guest users can securely access VMs without Azure AD accounts on the VM OS
  • TRE Administrators: Clear overview of the security model and authentication flow
  • Developers: Technical implementation details for extension development and troubleshooting

Authentication Flow Summary

User → OIDC/OAuth2 Proxy → Guacamole Extension → Token Validation → TRE API → VM List
                                                                              ↓
User Connects to VM ← Credential Injection ← Azure Key Vault ← TRE API ← VM Selection

All VM credentials are managed centrally in Azure Key Vault and never exposed to end users, enabling secure access for users who may not have direct VM accounts or Azure AD login capability.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

…e service

Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
@marrobi
Copy link
Member

marrobi commented Jun 26, 2025

@copilot please remove the readme file and include all the docs in the actual docs.

Copilot AI changed the title [WIP] Document how authentication to VMs works in the Guacamole workspace service Add comprehensive authentication documentation for Guacamole workspace service Jun 26, 2025
Copilot AI requested a review from marrobi June 26, 2025 12:38
…adme

Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jun 26, 2025

@copilot please remove the readme file and include all the docs in the actual docs.

Done! I've consolidated all the authentication documentation into the main docs file (docs/tre-templates/workspace-services/guacamole.md) and removed the separate readme file. The documentation now includes both the high-level authentication overview and detailed technical implementation details in one place. (6f4e85d)

@marrobi
Copy link
Member

marrobi commented Jun 26, 2025

@copilot pease do nto make claims about what it does, purely document how it works. Do not include any versions etc that may change over time. Include an intro to the guacamole workspace service at the top of the page.

…on info, and add service intro

Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jun 26, 2025

@copilot pease do nto make claims about what it does, purely document how it works. Do not include any versions etc that may change over time. Include an intro to the guacamole workspace service at th...

Updated the documentation to focus on how the authentication works rather than making claims about capabilities, removed the OAuth2 Proxy version reference, and added a proper introduction to the Guacamole workspace service at the top of the page. (a8186a8)

Copy link
Member

@marrobi marrobi left a comment

Choose a reason for hiding this comment

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

LGTM

@marrobi marrobi requested review from SvenAelterman and jonnyry June 26, 2025 13:03
@marrobi marrobi marked this pull request as ready for review June 26, 2025 13:03
@marrobi
Copy link
Member

marrobi commented Jun 26, 2025

@copilot fix the linting.

/github/workspace/docs/tre-templates/workspace-services/guacamole.md:31:27 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]

Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jun 26, 2025

@copilot fix the linting.

/github/workspace/docs/tre-templates/workspace-services/guacamole.md:31:27 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
...

Fixed the trailing spaces linting error on line 31. (f7b8e1c)

Copilot AI requested a review from marrobi June 26, 2025 13:22
@marrobi
Copy link
Member

marrobi commented Jun 27, 2025

@copilot fix the build issue.

Copy link
Contributor Author

Copilot AI commented Jun 27, 2025

@copilot fix the build issue.

I've tested the documentation build locally and it's working correctly with both mkdocs build and mkdocs build --strict. Could you provide more details about the specific build error you're seeing? For example:

  • Is this a GitHub Actions workflow failure?
  • What's the exact error message?
  • Which build step is failing?

This will help me identify and fix the specific issue.

@github-actions
Copy link

Unit Test Results

15 tests   15 ✅  1s ⏱️
 4 suites   0 💤
 4 files     0 ❌

Results for commit a2067b7.

@marrobi
Copy link
Member

marrobi commented Jun 27, 2025

@copilot fix this linting

/github/workspace/docs/tre-templates/workspace-services/guacamole.md:18:1 MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 3]
/github/workspace/docs/tre-templates/workspace-services/guacamole.md:19:1 MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 3]
/github/workspace/docs/tre-templates/workspace-services/guacamole.md:20:1 MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 3]
/github/workspace/docs/tre-templates/workspace-services/guacamole.md:21:1 MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 3]

Co-authored-by: marrobi <17089773+marrobi@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jun 27, 2025

@copilot fix this linting

/github/workspace/docs/tre-templates/workspace-services/guacamole.md:18:1 MD007/ul-indent Unordered list indentation [Expected: 2; Actual: 3]
...

Fixed the MD007 unordered list indentation issues on lines 18-21 by changing from 3-space to 2-space indentation as required by the linting configuration. (a8cec1e)

@microsoft microsoft deleted a comment from BryanBryan-stack Jun 27, 2025
@marrobi
Copy link
Member

marrobi commented Jun 27, 2025

/test-force-approve

Docs

@github-actions
Copy link

🤖 pr-bot 🤖

✅ Marking tests as complete (for commit 54f77eb)

(in response to this comment from @marrobi)

Copy link
Member

@marrobi marrobi left a comment

Choose a reason for hiding this comment

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

LGTM

@marrobi marrobi changed the title Add comprehensive authentication documentation for Guacamole workspace service Add authentication documentation for Guacamole workspace service Jun 30, 2025
Copy link
Collaborator

@jonnyry jonnyry left a comment

Choose a reason for hiding this comment

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

LGTM

@marrobi marrobi requested a review from a team as a code owner February 12, 2026 08:50
@marrobi marrobi requested a review from Copilot March 10, 2026 09:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Guacamole workspace service documentation by expanding the authentication/authorization explanation and adding an architecture diagram, alongside a patch bump for the Guacamole server runtime image tag.

Changes:

  • Expand docs/tre-templates/workspace-services/guacamole.md with a detailed auth flow description.
  • Add a Draw.io architecture diagram for Guacamole authentication.
  • Bump the Guacamole server docker image tag version (0.9.50.9.6).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
templates/workspace_services/guacamole/guacamole-server/guacamole-auth-azure/readme.md Removes an internal README (content appears intended to be consolidated into central docs).
templates/workspace_services/guacamole/guacamole-server/docker/version.txt Bumps the runtime image version tag used for the Guacamole server build/publish.
docs/tre-templates/workspace-services/images/guacamole-auth-architecture.drawio Adds an auth architecture diagram for the Guacamole service.
docs/tre-templates/workspace-services/guacamole.md Adds narrative documentation for the Guacamole service authentication flow; removes the configuration properties table.
Comments suppressed due to low confidence (1)

docs/tre-templates/workspace-services/guacamole.md:48

  • This doc update removes the "Guacamole Workspace Service Configuration" section (including the table of guac_disable_copy, guac_disable_paste, guac_enable_drive, etc.). Those properties are still supported by the template schema/porter parameters, so without this section it’s hard for operators to discover what can be configured. Please restore the configuration documentation here or add a clear link to the authoritative schema/parameters docs.
## Prerequisites

- [A base workspace bundle installed](../workspaces/base.md)


- **Initial Authentication**: Users authenticate to Guacamole using OIDC (OpenID Connect) via Azure Entra ID (Azure AD) mediated by OAuth2 Proxy.

- **Token Validation**: The Guacamole extension receives and validates an OIDC token from the OAuth2 Proxy extension after the user has authenticated via Azure Entra ID, ensuring workspace roles are present in the token.
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The "Token Validation" bullet is currently a bit inaccurate: the custom Guacamole auth provider reads the JWT access token from the X-Forwarded-Access-Token header (and username from X-Forwarded-Preferred-Username) which are set by oauth2-proxy when --pass-access-token/--pass-user-headers are enabled. Consider rewording this to avoid implying there is an "OAuth2 Proxy extension" inside Guacamole and to distinguish access token vs ID token.

Suggested change
- **Token Validation**: The Guacamole extension receives and validates an OIDC token from the OAuth2 Proxy extension after the user has authenticated via Azure Entra ID, ensuring workspace roles are present in the token.
- **Token Validation**: A custom Guacamole authorization extension reads the JWT access token from the `X-Forwarded-Access-Token` header and the username from `X-Forwarded-Preferred-Username`, as set by oauth2-proxy (with `--pass-access-token` and `--pass-user-headers` enabled), and validates that the token includes the required workspace roles.

Copilot uses AI. Check for mistakes.
<mxCell id="container_label" value="&lt;b&gt;Azure Linux Web App&lt;/b&gt;&lt;br&gt;(Docker Container)" style="text;html=1;fontSize=14;fontStyle=0;align=left;verticalAlign=top;whiteSpace=wrap;fillColor=none;strokeColor=none;fontColor=#333333;" parent="1" vertex="1">
<mxGeometry x="310" y="125" width="250" height="40" as="geometry"/>
</mxCell>
<mxCell id="oauth2proxy" value="&lt;b&gt;OAuth2 Proxy&lt;/b&gt;&lt;br&gt;(v7.13.0)&lt;br&gt;&lt;br&gt;Port 8085 (external)&lt;br&gt;&lt;hr&gt;&lt;font style=&quot;font-size:10px&quot;&gt;• OIDC provider&lt;br&gt;• Session cookies&lt;br&gt;• Token forwarding&lt;br&gt;• skip-provider-button&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#1BA1E2;fontColor=#ffffff;strokeColor=#006EAF;fontSize=12;arcSize=10;" parent="1" vertex="1">
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The diagram labels OAuth2 Proxy as v7.13.0, but the Guacamole docker image build currently downloads oauth2-proxy v7.7.1. Please update the diagram version (or update the build) so the architecture doc reflects what’s actually deployed.

Suggested change
<mxCell id="oauth2proxy" value="&lt;b&gt;OAuth2 Proxy&lt;/b&gt;&lt;br&gt;(v7.13.0)&lt;br&gt;&lt;br&gt;Port 8085 (external)&lt;br&gt;&lt;hr&gt;&lt;font style=&quot;font-size:10px&quot;&gt;• OIDC provider&lt;br&gt;• Session cookies&lt;br&gt;• Token forwarding&lt;br&gt;• skip-provider-button&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#1BA1E2;fontColor=#ffffff;strokeColor=#006EAF;fontSize=12;arcSize=10;" parent="1" vertex="1">
<mxCell id="oauth2proxy" value="&lt;b&gt;OAuth2 Proxy&lt;/b&gt;&lt;br&gt;(v7.7.1)&lt;br&gt;&lt;br&gt;Port 8085 (external)&lt;br&gt;&lt;hr&gt;&lt;font style=&quot;font-size:10px&quot;&gt;• OIDC provider&lt;br&gt;• Session cookies&lt;br&gt;• Token forwarding&lt;br&gt;• skip-provider-button&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#1BA1E2;fontColor=#ffffff;strokeColor=#006EAF;fontSize=12;arcSize=10;" parent="1" vertex="1">

Copilot uses AI. Check for mistakes.
<mxCell id="keyvault" value="&lt;b&gt;Azure Key Vault&lt;/b&gt;&lt;br&gt;&lt;hr&gt;&lt;font style=&quot;font-size:10px&quot;&gt;Stores:&lt;br&gt;• workspace-client-id&lt;br&gt;• workspace-client-secret&lt;br&gt;• {hostname}-admin-credentials&lt;br&gt;&lt;br&gt;Access via Managed Identity&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#00BCF2;fontColor=#ffffff;strokeColor=#0078D4;fontSize=12;arcSize=10;" parent="1" vertex="1">
<mxGeometry x="1060" y="430" width="200" height="150" as="geometry"/>
</mxCell>
<mxCell id="vm" value="&lt;b&gt;Workspace VM&lt;/b&gt;&lt;br&gt;(User Resource)&lt;br&gt;&lt;hr&gt;&lt;font style=&quot;font-size:10px&quot;&gt;• RDP port 3389&lt;br&gt;• Inside workspace VNet&lt;br&gt;• ignore-cert = true&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#767676;fontColor=#ffffff;strokeColor=#4D4D4D;fontSize=12;arcSize=10;" parent="1" vertex="1">
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The architecture diagram documents the RDP connection to the Workspace VM with ignore-cert = true, which disables certificate validation for the Guacamole RDP connection. With ignore-cert enabled, an attacker with access to the workspace network could perform a man-in-the-middle attack by impersonating the VM’s RDP service and capture injected credentials or tamper with the remote session. Update the Guacamole connection configuration to enforce proper TLS certificate validation for RDP (i.e., do not use ignore-cert = true) and use valid, trusted certificates on the VMs instead of disabling checks.

Suggested change
<mxCell id="vm" value="&lt;b&gt;Workspace VM&lt;/b&gt;&lt;br&gt;(User Resource)&lt;br&gt;&lt;hr&gt;&lt;font style=&quot;font-size:10px&quot;&gt;• RDP port 3389&lt;br&gt;• Inside workspace VNet&lt;br&gt;• ignore-cert = true&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#767676;fontColor=#ffffff;strokeColor=#4D4D4D;fontSize=12;arcSize=10;" parent="1" vertex="1">
<mxCell id="vm" value="&lt;b&gt;Workspace VM&lt;/b&gt;&lt;br&gt;(User Resource)&lt;br&gt;&lt;hr&gt;&lt;font style=&quot;font-size:10px&quot;&gt;• RDP port 3389&lt;br&gt;• Inside workspace VNet&lt;br&gt;• TLS cert validation enforced&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#767676;fontColor=#ffffff;strokeColor=#4D4D4D;fontSize=12;arcSize=10;" parent="1" vertex="1">

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants