Skip to content

Block the SSH tunnel when extensions.allowed forbids Remote - SSH - #2290

Closed
rclarey wants to merge 3 commits into
mainfrom
check-allowed-extensions
Closed

rclarey wants to merge 3 commits into
mainfrom
check-allowed-extensions

Conversation

@rclarey

@rclarey rclarey commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Changes

Starting a tunnel needs the host's Remote - SSH extension (ms-vscode-remote.remote-ssh, or anysphere.remote-ssh in Cursor). When the extensions.allowed policy blocks it, the connect fails late and confusingly. Check the setting up front and show a modal error with a shortcut to the setting instead.

The check follows VS Code's precedence: an extension ID rule beats a publisher rule (including the microsoft special case), which beats the * wildcard.

Tests

unit tests added

Starting a tunnel needs the host's Remote - SSH extension
(ms-vscode-remote.remote-ssh, or anysphere.remote-ssh in Cursor). When the
`extensions.allowed` policy blocks it, the connect fails late and
confusingly. Check the setting up front and show a modal error with a
shortcut to the setting instead.

The check follows VS Code's precedence: an extension ID rule beats a
publisher rule (including the `microsoft` special case), which beats the
`*` wildcard.

Co-authored-by: Isaac <no-reply@databricks.com>
@rclarey
rclarey deployed to test-trigger-is November 5, 2026 14:12 — with GitHub Actions Active
@rclarey
rclarey deployed to test-trigger-is November 5, 2026 14:13 — with GitHub Actions Active
@rclarey
rclarey deployed to test-trigger-is November 5, 2026 14:13 — with GitHub Actions Active
@rugpanov

rugpanov commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Integration tests ✅ passed for 8785e0d2.
View run

@rclarey
rclarey deployed to test-trigger-is November 11, 2026 14:25 — with GitHub Actions Active
@rclarey
rclarey deployed to test-trigger-is November 11, 2026 14:27 — with GitHub Actions Active
@rclarey
rclarey deployed to test-trigger-is November 11, 2026 14:27 — with GitHub Actions Active
@rugpanov

rugpanov commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Integration tests ✅ passed for d099dc84.
View run

extensionId,
};
}
return {allowed: allowedExtensions["*"] !== false, extensionId};

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.

If allowedExtensions is missing "*" as a key, allowed will be true but VS Code blocks extension.
E.g. extensions.allowed: {"databricks": true, "github": true} - VS Code would block the installation in this case, but checkSshExtensionAllowed would return true.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@louis-johnston-db The default setting is true, so when no "*" key exists every extension is allowed unless explicitly disabled. In your example {"databricks": true, "github": true} is equivalent to {"*": true}

…lues

Lowercase the setting's keys so lookups are case-insensitive, as VS Code
does. Treat null and arrays as allow-all instead of crashing on null and
accidentally matching on arrays.

Co-authored-by: Isaac <no-reply@databricks.com>
@rclarey
rclarey deployed to test-trigger-is November 12, 2026 12:49 — with GitHub Actions Active
@rclarey
rclarey deployed to test-trigger-is November 12, 2026 12:50 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/vscode

Inputs:

  • PR number: 2290
  • Commit SHA: 0a7bd89ce92bdd83bf2218cb9b329faef33872e7

Checks will be approved automatically on success.

@rclarey
rclarey deployed to test-trigger-is November 12, 2026 12:51 — with GitHub Actions Active
@rugpanov

rugpanov commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Integration tests ✅ passed for 0a7bd89c.
View run

rclarey added a commit that referenced this pull request Nov 12, 2026
…lues

Port of 0a7bd89 from #2290. Lowercase the setting's keys so lookups are
case-insensitive, as VS Code does, and treat null and arrays as
allow-all.

Co-authored-by: Isaac <no-reply@databricks.com>
rclarey added a commit that referenced this pull request Nov 12, 2026
…SH (#2299)

## Changes

Port of #2290 to the 3.0 release branch


Starting a tunnel needs the host's Remote - SSH extension
(ms-vscode-remote.remote-ssh, or anysphere.remote-ssh in Cursor). When
the extensions.allowed policy blocks it, the connect fails late and
confusingly. Check the setting up front and show a modal error with a
shortcut to the setting instead.

The check follows VS Code's precedence: an extension ID rule beats a
publisher rule (including the microsoft special case), which beats the *
wildcard.

## Tests

unit tests added

---------

Co-authored-by: Isaac <no-reply@databricks.com>
@rclarey
rclarey enabled auto-merge (squash) November 12, 2026 14:47
@rclarey rclarey closed this Nov 16, 2026
auto-merge was automatically disabled November 16, 2026 15:15

Pull request was closed

This branch was successfully deployed

1 active deployment
test-trigger-is — 0a7bd89c Deployed Nov 12, 2026 by rclarey via Trigger Tests #2522
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.

3 participants