Repository navigation
[Bastion] Fix native-client token authentication across tenants - #10429
Open
Patrick W. Healy (phealy) wants to merge 2 commits into
Open
Patrick W. Healy (phealy) wants to merge 2 commits into
Patrick W. Healy (phealy) wants to merge 2 commits into
Conversation
Scope native-client tokens to the subscription in the resolved Bastion ARM ID. Surface connection authentication failures and close failed clients promptly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The extension version and release history must be updated so users can receive the fix.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Scopes Bastion native-client authentication to the Bastion subscription and improves failure handling.
Changes:
- Acquires tokens using the Bastion ARM ID’s subscription.
- Improves HTTP errors and client cleanup.
- Adds cross-tenant authentication regression tests.
| File | Description |
|---|---|
custom.py |
Scopes tunnel and gateway RDP credentials. |
developer_sku_helper.py |
Scopes Developer SKU tokens and handles HTTP failures. |
tunnel.py |
Scopes tunnel tokens and improves cleanup/errors. |
test_bastion_auth.py |
Adds authentication regression coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
microsoft-github-policy-service
Bot
requested review from
Yu Chen (jsntcy),
Ethan Yang (necusjz) and
Yong Zhang (yonzhan)
October 5, 2026 15:05
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collaborator
|
Bastion |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Bastion native-client connections can obtain an Azure token from the default subscription's tenant even when the Bastion ARM ID selects a subscription in another tenant. Authentication failures then appear as SSH/RDP timeouts.
Scope token acquisition to the subscription parsed from the resolved Bastion ARM ID for tunnels, Developer SKU connection discovery, and gateway RDP. Check credentials before starting tunnel workers, report HTTP authentication failures clearly, close failed client connections, and remove token-bearing debug output. Target VM IDs do not override the Bastion authentication context.
Bump Bastion to patch release 1.4.4 and add the corresponding HISTORY.rst entry. Leave src/index.json to the publish pipeline.
Validation:
azdev style bastion: Pylint and Flake8 passed.python scripts/ci/test_index.py -q: passed (9 tests, 2 skipped).git diff --check: passed.AAD SSH certificate acquisition is a separate flow and is not changed here.
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az network bastion ssh,az network bastion rdp,az network bastion tunnelGeneral Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install azdevrequired)For new extensions:
N/A: this modifies an existing extension.
About Extension Publish
There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update
src/index.jsonautomatically.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json.