PolicyInfo
laktory.models.resources.databricks.PolicyInfo
¤
Bases: PolicyInfoBase
Databricks attribute-based access control (ABAC) policy
Row filter, column mask, grant or deny policy defined on a catalog, schema
or table and applied to the securables it contains, based on governed
tags and the user identity. Policies can also be declared directly on
Catalog, Schema and Table with their policies field.
A policy referencing a governed tag created in the same deployment may
fail with Unknown tag policy key while the new TagPolicy propagates;
deploying again resolves it.
Examples:
import io
from laktory import models
policy_yaml = '''
name: mask_pii
on_securable_type: SCHEMA
on_securable_fullname: dev.finance
policy_type: POLICY_TYPE_COLUMN_MASK
for_securable_type: TABLE
to_principals:
- account users
except_principals:
- role-finance-admins
match_columns:
- condition: hasTag('pii')
alias: pii_col
column_mask:
function_name: dev.finance.mask_string
on_column: pii_col
'''
policy = models.resources.databricks.PolicyInfo.model_validate_yaml(
io.StringIO(policy_yaml)
)
References
| BASE | DESCRIPTION |
|---|---|
column_mask
|
Options for column mask policies. Valid only if
TYPE:
|
comment
|
Optional description of the policy
TYPE:
|
deny
|
Options for deny policies. Valid only if
TYPE:
|
except_principals
|
Optional list of user or group names that should be excluded from the policy
TYPE:
|
for_securable_type
|
Type of securables that the policy should take effect on. Required on create and optional on update. Possible values are:
TYPE:
|
grant
|
Options for grant policies. Valid only if
TYPE:
|
match_columns
|
Optional list of condition expressions used to match table columns. Only valid when
TYPE:
|
name
|
Name of the policy
TYPE:
|
on_securable_fullname
|
Full name of the securable on which the policy is defined. Set automatically when declared in the policies of a catalog, schema or table.
TYPE:
|
on_securable_type
|
Type of the securable on which the policy is defined. Set automatically when declared in the policies of a catalog, schema or table.
TYPE:
|
policy_type
|
Type of the policy
TYPE:
|
provider_config
|
Configure the provider for management through account provider
TYPE:
|
row_filter
|
Options for row filter policies. Valid only if
TYPE:
|
to_principals
|
List of user or group names that the policy applies to. Required on create and optional on update
TYPE:
|
when_condition
|
Optional condition when the policy should take effect
TYPE:
|
laktory.models.resources.databricks.policyinfo.PolicyInfoColumnMask
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
function_name
|
The fully qualified name of the row filter function. The function is called on each row of the target table. It should return a boolean value indicating whether the row should be visible to the user. Required on create and update
TYPE:
|
on_column
|
The alias of the column to be masked. The alias must refer to one of matched columns. The values of the column is passed to the column mask function as the first argument. Required on create and update
TYPE:
|
using
|
Optional list of column aliases or constant literals to be passed as arguments to the row filter function. The type of each column should match the positional argument of the row filter function
TYPE:
|
laktory.models.resources.databricks.policyinfo.PolicyInfoColumnMaskUsing
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
alias
|
Optional alias of the matched column
TYPE:
|
constant
|
A constant literal
TYPE:
|
function_arg_expression
|
An expression evaluated at query time. Wraps per-request expression variants (e.g., tag introspection) so new variants can be added without extending the FunctionArgument oneof
TYPE:
|
laktory.models.resources.databricks.policyinfo.PolicyInfoColumnMaskUsingFunctionArgExpression
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
tag_introspection
|
An expression that introspects tags at query time
TYPE:
|
laktory.models.resources.databricks.policyinfo.PolicyInfoColumnMaskUsingFunctionArgExpressionTagIntrospection
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
column_tag_value
|
Extracts the value of a column-level tag
TYPE:
|
tag_value
|
Extracts the value of a securable-level tag
TYPE:
|
laktory.models.resources.databricks.policyinfo.PolicyInfoColumnMaskUsingFunctionArgExpressionTagIntrospectionColumnTagValue
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
column_alias
|
The alias from MATCH COLUMNS that identifies the column
TYPE:
|
tag_key
|
1024 matches the max_length on FunctionArgument.constant above
TYPE:
|
laktory.models.resources.databricks.policyinfo.PolicyInfoColumnMaskUsingFunctionArgExpressionTagIntrospectionTagValue
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
tag_key
|
1024 matches the max_length on FunctionArgument.constant above
TYPE:
|
laktory.models.resources.databricks.policyinfo.PolicyInfoDeny
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
privileges
|
List of privileges to grant. When any of these privileges are requested, the policy will grant access if the principal and condition match. Required on create and update
TYPE:
|
laktory.models.resources.databricks.policyinfo.PolicyInfoGrant
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
privileges
|
List of privileges to grant. When any of these privileges are requested, the policy will grant access if the principal and condition match. Required on create and update
TYPE:
|
laktory.models.resources.databricks.policyinfo.PolicyInfoMatchColumns
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
alias
|
Optional alias of the matched column
TYPE:
|
condition
|
The condition expression used to match a table column
TYPE:
|
laktory.models.resources.databricks.policyinfo.PolicyInfoProviderConfig
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
workspace_id
|
Workspace ID which the resource belongs to. This workspace must be part of the account which the provider is configured with
TYPE:
|
laktory.models.resources.databricks.policyinfo.PolicyInfoRowFilter
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
function_name
|
The fully qualified name of the row filter function. The function is called on each row of the target table. It should return a boolean value indicating whether the row should be visible to the user. Required on create and update
TYPE:
|
using
|
Optional list of column aliases or constant literals to be passed as arguments to the row filter function. The type of each column should match the positional argument of the row filter function
TYPE:
|
laktory.models.resources.databricks.policyinfo.PolicyInfoRowFilterUsing
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
alias
|
Optional alias of the matched column
TYPE:
|
constant
|
A constant literal
TYPE:
|
function_arg_expression
|
An expression evaluated at query time. Wraps per-request expression variants (e.g., tag introspection) so new variants can be added without extending the FunctionArgument oneof
TYPE:
|
laktory.models.resources.databricks.policyinfo.PolicyInfoRowFilterUsingFunctionArgExpression
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
tag_introspection
|
An expression that introspects tags at query time
TYPE:
|
laktory.models.resources.databricks.policyinfo.PolicyInfoRowFilterUsingFunctionArgExpressionTagIntrospection
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
column_tag_value
|
Extracts the value of a column-level tag
TYPE:
|
tag_value
|
Extracts the value of a securable-level tag
TYPE:
|
laktory.models.resources.databricks.policyinfo.PolicyInfoRowFilterUsingFunctionArgExpressionTagIntrospectionColumnTagValue
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
column_alias
|
The alias from MATCH COLUMNS that identifies the column
TYPE:
|
tag_key
|
1024 matches the max_length on FunctionArgument.constant above
TYPE:
|
laktory.models.resources.databricks.policyinfo.PolicyInfoRowFilterUsingFunctionArgExpressionTagIntrospectionTagValue
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
tag_key
|
1024 matches the max_length on FunctionArgument.constant above
TYPE:
|