Automatically Copy Data Security Rules Between Data Models (including Elasticube to Live and Live to Elasticube)
Overview
Managing data access consistently across multiple data models can be time-consuming and error-prone, especially with complex row-level security (RLS) configurations. This article provides a script and step-by-step instructions to automate copying data security rules from one model to another within the same environment. It helps ensure security alignment while reducing manual work.
The script copies both the RLS rules and scopes, and works for every possible combination of source and target data model types:
- Elasticube to Live model
- Live model to Elasticube
- Elasticube to another Elasticube
- Live model to another Live model
This script utilizes Sisense REST API.
Requirements
- The names of the table(s) and column(s) used for data security in the source and target data models must match.
- Admin access to server.
- The Custom Code feature has to be enabled. To simplify the implementation, this script can be viewed and executed on the Sisense server's Custom Code's Jupyter notebook, so you don't have to install Python on your own computer. To enable Custom Code, go to the Admin tab > Feature Management > Advanced Analytics section > toggle on Custom Code.
Limitations
- This script does not merge RLS rules. All existing RLS rules will be deleted from the target data model before the RLS rules from the source data model are copied.
- Sisense doesn't currently have a built-in validation logic for table and column names when creating RLS rules via API. The script does not validate these either during the copy process. Ensure security table and column names match between the source and target data models. Refer to the Requirements section above. This limitation may be addressed in a future version of this script.
- The script only supports one target data model at a time. This limitation may be addressed in a future version of this script.
Instructions
1. Download the CopyDataSecurityRules_v1 Script
Download the script here and unzip it. The file is also attached at the bottom of this article.
2. Upload the Script to Your Server
Upload the script to this location: /opt/sisense/storage/notebooks/. You can also use any of the existing subfolders or create a new subfolder in this location, if needed.
The easiest way to upload files to your Sisense server is to use the File Management feature. In the file browser UI, open the notebooks folder, then click the Upload (Up arrow) icon at the top right corner. Click File, then select the CopyDataSecurityRules_v1 file.
3. Open the Script in Jupyter.
To open the Jupyter notebook, use this direct URL: