The Cyral Django wrapper allows your Django applications to insert the current user's identity and group information into each database query. When the Cyral sidecar receives a database query, it uses this identity information to apply access policies and to log the user's data activities. Optionally, you can use the wrapper to supply your application's name to be recorded in query logs.
Add the Cyral wrapper to your Django application
Install cyral-django-wrapper by running:
In your settings.py, add cyral_django_wrapper to the list of installed apps:
Finally, in your application call set_user_identity at an appropriate location. For example:
(Optional.) Somewhere in your application, call cyral_django_wrapper.set_service_name to set the service name. This can be used to annotate queries and attribute them to a specific project. For example:
Configuration
In your settings.py, set a CYRAL_DJANGO_WRAPPER dictionary with configuration values. Available options are: