Skip to content

An example of a bundle that creates and uses a secret scope#83

Merged
anton-107 merged 13 commits intomainfrom
anton-107/secret-scope-example
May 15, 2025
Merged

An example of a bundle that creates and uses a secret scope#83
anton-107 merged 13 commits intomainfrom
anton-107/secret-scope-example

Conversation

@anton-107
Copy link
Copy Markdown
Contributor

No description provided.

anton-107 and others added 3 commits May 15, 2025 11:53
Co-authored-by: Julia Crawford (Databricks) <julia.crawford@databricks.com>
Co-authored-by: Julia Crawford (Databricks) <julia.crawford@databricks.com>
Co-authored-by: Julia Crawford (Databricks) <julia.crawford@databricks.com>
@anton-107 anton-107 requested a review from lennartkats-db May 15, 2025 09:54
permissions:
- level: CAN_VIEW
group_name: users
- level: CAN_MANAGE
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.

Admins should have these permissions by default. Is there a reason to explicitly specify them?

Copy link
Copy Markdown
Contributor Author

@anton-107 anton-107 May 15, 2025

Choose a reason for hiding this comment

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

admins do not have MANAGE permissions by default, only the user creating the scope does

Copy link
Copy Markdown
Contributor

@shreyas-goenka shreyas-goenka May 15, 2025

Choose a reason for hiding this comment

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

Is this only limited to read permissions?:
https://arc.net/l/quote/fotmmsku

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.

I'm referring to permissions that are listed by secret scopes ACL - the only initial permission a new secret scope is getting, is that its create can MANAGE it. For other permissions to show up there, they need to be explicitly declared in the permissions section

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.

Okay, but do admins have MANAGE permission by default on the scope anyways? The docs seem to imply so.

Note: This is not blocking, an additional permissions block can't really hurt customers. I was curious about the intention though.

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.

the API doc does not say so: https://docs.databricks.com/api/workspace/secrets/createscope

only the initial_manage_principal is getting the MANAGE permission, and when created with DABS, it is always the caller

spark_python_task:
python_file: "src/example_spark_python_task.py"
parameters:
- --scope_name={{job.parameters.scope_name}}
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.

We could simplify this.

Suggested change
- --scope_name={{job.parameters.scope_name}}
- --scope_name=${resources.secret_scopes.my_secret_scope.name}

This way the secret scope name is directly interpolated and you don't have to pass that as a job parameter.

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.

I would prefer to keep it this way in the example since this seems to be more idiomatic with the jobs docs and it also documents this particular way (not quite straightforward) to achieve this result

anton-107 and others added 5 commits May 15, 2025 13:30
Co-authored-by: shreyas-goenka <88374338+shreyas-goenka@users.noreply.github.com>
Co-authored-by: shreyas-goenka <88374338+shreyas-goenka@users.noreply.github.com>
Co-authored-by: shreyas-goenka <88374338+shreyas-goenka@users.noreply.github.com>
Co-authored-by: shreyas-goenka <88374338+shreyas-goenka@users.noreply.github.com>
@anton-107 anton-107 merged commit 4c75260 into main May 15, 2025
1 check passed
@anton-107 anton-107 deleted the anton-107/secret-scope-example branch May 15, 2025 13:29
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