Skip to main content

Policy Weaver for Microsoft Fabric

Project description

Policy Weaver icon

License Test Publish Commits Package version


Policy Weaver: synchronizes data access policies across platforms

A Python-based accelerator designed to automate the synchronization of security policies from different source catalogs with OneLake Security roles. While mirroring is only synchronizing the data, Policy Weaver is adding the missing piece which is mirroring data access policies to ensure consistent security across data platforms.

:rocket: Features

  • Microsoft Fabric Support: Direct integration with Fabric Mirrored Databases/Catalogs and OneLake Security.
  • Runs anywhere: It can be run within Fabric Notebook or from anywhere with a Python runtime.
  • Effective Policies: Resolves effective read privileges automatically, traversing nested groups and roles as required.
  • Pluggable Framework: Supports Azure Databricks and Snowflake policies, with more connectors planned.
  • Secure: Can use Azure Key Vault to securely manage sensitive information like Service Principal credentials and API tokens.

:pushpin: Note: Row-level and column-level security extraction will be implemented in the next version, once these features become available in OneLake Security.

:clipboard: Prerequisites

Before installing and running this solution, ensure you have:

:pushpin: Note: Every source catalog has additional pre-requisites

:hammer_and_wrench: Installation

Make sure your Python version is greater or equal than 3.11. Then, install the library:

$ pip install policy-weaver

:thread: Databricks specific setup

Azure Databricks Configuration

We assume you have an Entra ID integrated Unity Catalog in your Azure Databricks workspace. To set up Entra ID SCIM for Unity Catalog, please follow the steps in Configure Entra ID SCIM for Unity Catalog. We also assume you already have a mirrored catalog in Microsoft Fabric. If not, please follow the steps in Create a mirrored catalog in Microsoft Fabric.

To allow Policy Weaver to read the Unity Catalog metadata and access policies, you need to assign the following roles to your Azure Service Principal:

  1. Go to the Account Admin Console (https://accounts.azuredatabricks.net/) :arrow_right: User Management :arrow_right: Add your Azure Service Principal.
  2. Click on the Service Principal and go to the Roles tab :arrow_right: Assign the role "Account Admin"
  3. Go to the "Credentials & Secrets" tab :arrow_right: Generate an OAuth Secret. Save the secret, you will need it in your config.yaml file as the account_api_token.

Update your Configuration file

Download this config.yaml file template and update it based on your environment.

For Databricks specifically, you will need to provide:

Run the Weaver!

This is all the code you need. Just make sure Policy Weaver can access your YAML configuration file.

#import the PolicyWeaver library
from policyweaver.weaver import WeaverAgent
from policyweaver.plugins.databricks.model import DatabricksSourceMap

#Load config
config = DatabricksSourceMap.from_yaml("path_to_your_config.yaml")

#run the PolicyWeaver
await WeaverAgent.run(config)

All done! You can now check your Microsoft Fabric Mirrored Azure Databricks catalog´s new policies.

:raising_hand: Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

:scroll: License

This project is licensed under the MIT License - see the LICENSE file for details.

:shield: Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

policy_weaver-0.2.8.tar.gz (41.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

policy_weaver-0.2.8-py3-none-any.whl (49.2 kB view details)

Uploaded Python 3

File details

Details for the file policy_weaver-0.2.8.tar.gz.

File metadata

  • Download URL: policy_weaver-0.2.8.tar.gz
  • Upload date:
  • Size: 41.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for policy_weaver-0.2.8.tar.gz
Algorithm Hash digest
SHA256 0221cf6e51284bcd70ae77c7fb9deeee631aefadd120976682afc70f73951e5a
MD5 e7f14f5373598b9de52d2fe594c90a93
BLAKE2b-256 6afb282f958e1ba34ced7071fc2ee3de5b1d728315bc527f90587e39112b07b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for policy_weaver-0.2.8.tar.gz:

Publisher: python-publish.yml on microsoft/Policy-Weaver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file policy_weaver-0.2.8-py3-none-any.whl.

File metadata

  • Download URL: policy_weaver-0.2.8-py3-none-any.whl
  • Upload date:
  • Size: 49.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for policy_weaver-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 0853d866fcce822a18ececf41ea2de86f28a926fba00617c9ac80c93174c78af
MD5 2b9125622626e5e40284f69b251755b9
BLAKE2b-256 34ff60fb21dca8ff8000be075d9bf37cf87bea8ebd96f2de766424f734211909

See more details on using hashes here.

Provenance

The following attestation bundles were made for policy_weaver-0.2.8-py3-none-any.whl:

Publisher: python-publish.yml on microsoft/Policy-Weaver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page