Skip to content

bundle: warn when state_path uses /Workspace/Shared and add telemetry for state path scope#5428

Draft
shreyas-goenka wants to merge 5 commits into
mainfrom
ticklish-munching-bear
Draft

bundle: warn when state_path uses /Workspace/Shared and add telemetry for state path scope#5428
shreyas-goenka wants to merge 5 commits into
mainfrom
ticklish-munching-bear

Conversation

@shreyas-goenka
Copy link
Copy Markdown
Contributor

@shreyas-goenka shreyas-goenka commented Jun 3, 2026

Summary

Detects when a workspace path grants broader access than the bundle's top-level permissions section declares, and surfaces it in both validate and deploy — plus telemetry for the static signals.

Two kinds of detection

Static (config-only), in ValidateWorkspacePermissions — warns when a path is in /Workspace/Shared (so all workspace users can read/write) but the permissions section doesn't grant users: CAN_MANAGE:

  1. root_path scope exceeds declared permissions
  2. state_path scope exceeds declared permissions (suppressed when root_path is also shared)

Storing state_path outside root_path is informational only (recorded as telemetry, no warning).

Live ACL comparison (any path, not just /Shared) — compares the actual workspace folder ACL against the declared permissions via WorkspacePathPermissions.Compare, warning when the folder grants a principal more access than the bundle declares:

  • bundle validate: already done by ValidateFolderPermissions (issues a GetPermissions call per path).
  • bundle deploy (new): done without adding latency. ApplyWorkspaceRootPermissions already calls SetPermissions on each path prefix (root_path and, when separate, state_path); we reuse that response's ACL for the comparison instead of issuing a separate GetPermissions. Because the Set replaces the direct ACL with the declared set, any principal still showing higher access is inherited from a parent folder — the broader access that persists after deploy.

Telemetry (BundleDeployExperimental)

  • state_path_scope_exceeds_permissions — state_path's effective access is broader than declared
  • state_path_is_shared — state_path uses /Workspace/Shared
  • state_path_outside_root_path — state_path is outside root_path (informational)

… for state path scope

Extends ValidateSharedRootPermissions to also warn when workspace.state_path
is under /Workspace/Shared but workspace.root_path is not, since the existing
root-path warning would not cover that case.

Adds two telemetry fields to BundleDeployExperimental:
- state_path_is_shared: state_path is under /Workspace/Shared
- state_path_outside_root_path: state_path is not nested under root_path,
  meaning it may carry a broader permission scope than the rest of the bundle.

Co-authored-by: Shreyas Goenka <shreyas.goenka@databricks.com>
…cePermissions

Replaces ValidateSharedRootPermissions with a single, clearly documented
ValidateWorkspacePermissions mutator that covers three distinct static checks:

1. workspace.root_path in /Workspace/Shared without users CAN_MANAGE
2. workspace.state_path in /Workspace/Shared (when root_path is not) without
   users CAN_MANAGE — deployment state separately exposed to all workspace users
3. workspace.state_path outside workspace.root_path — state stored in a separate
   folder with an independently managed permission scope

Cases 2 and 3 suppress each other when they would produce redundant warnings
for the same misconfiguration (state_path in Shared and outside root_path).

Co-authored-by: Shreyas Goenka <shreyas.goenka@databricks.com>
…red permissions

The original goal was to statically detect when workspace.state_path grants
broader access than the top-level permissions section declares. The prior
fields captured raw facts (path is shared, path is outside root) but not this
mismatch signal itself.

Reworks validation so each warning is backed by a named, reusable predicate,
and emits those predicates as telemetry:

- StatePathScopeExceedsPermissions: state_path is in /Workspace/Shared (all
  users can read/write) but permissions do not grant users CAN_MANAGE — the
  effective scope exceeds the declared one. This is the new telemetry field.
- RootPathScopeExceedsPermissions: same check for root_path, now backing the
  existing root warning.

Co-authored-by: Shreyas Goenka <shreyas.goenka@databricks.com>
…y only

Storing workspace.state_path outside workspace.root_path is a valid
configuration, not a misconfiguration, so it should not produce a warning.
ValidateWorkspacePermissions now warns only when a path's effective access
exceeds the declared permissions (cases 1 and 2). The StatePathOutsideRootPath
predicate and its telemetry field remain as an informational signal.

Co-authored-by: Shreyas Goenka <shreyas.goenka@databricks.com>
@eng-dev-ecosystem-bot
Copy link
Copy Markdown
Collaborator

eng-dev-ecosystem-bot commented Jun 3, 2026

Commit: e7e9e83

Run: 26938714016

…he bundle's

ValidateFolderPermissions already compares the live workspace ACL against the
declared permissions, but it only runs during `bundle validate`. This brings the
same check to `bundle deploy` without adding any API latency: ApplyWorkspaceRoot-
Permissions already calls SetPermissions on each workspace path prefix (root_path
and, when separate, state_path), and the response carries the resulting ACL.

Reusing that response, we compare against the declared permissions. Because the
Set replaces the folder's direct ACL with the declared set, any principal still
showing higher access is inherited from a parent folder — the broader access that
actually persists after deploy, which is the scope mismatch worth surfacing.

No extra GetPermissions round trip is made. The check is skipped for /Workspace/
Shared paths, consistent with the existing behavior.

Co-authored-by: Shreyas Goenka <shreyas.goenka@databricks.com>
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.

2 participants