Sanitized sensitive information from your database dumps
Project description
django-sanitized-dump
Sanitized sensitive information from your database dumps 💩
DB Sanitization
Configuration
Example config
config:
addons:
- "ai-senitizers"
- "some-other-lib"
strategy:
user:
first_name: "name.first_name"
last_name: "name.last_name"
education:
created: null
modified: null
id: null
field: "education.field"
school: "education.school"
started: "datetime.datetime"
credits: null
information: "string.loremipsum_preserved"
file_file: null
Example custom sanitizers
# /sanitizers/name.py
def sanitize_first_name(value):
return faker.first_name()
def sanitize_last_name(value):
return faker.last_name()
# /sanitizers/education.py
def sanitize_field(value):""
return "Some field"
def sanitize_schoo(value):
return "My school"
Validating sanitizer return value
Note: This should not be done in the initial implementation of the sanitizer but is up to the sanitizer funtions. This is just a nice to have but not of a high priority.
Check that the returned value is of the same type as the argument value passed to the sanitizer. For instance, if a MySQL DATETIME value is passed to the sanitizer, a MySQL DATETIME value shoud be returned as well.
Configuration method resolution order
- Custom sanitizers inside ./sanitizers
- Addon sanitizers (
config.addons
) - Core sanitizers
Django Management Commands
Sanitized Dump
./manage.py sanitized_dump -c > dump.sql
- Warn about unhandled fields
- Creates a database dump (
mysqldump
/pgdump
) - Run sanitazier
Check Sanitize Dump
./manage.py sanitized_dump -c
- Returns an error code if there are unhandled database fields
Init Sanitizer
./manage.py init_sanitizer
- Create configuration from current database state
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-sanitized-dump-0.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc93f7b12c916ff5c9e3826af0eb44947cf853654b88a5dba8faeaaa1bf9eb95 |
|
MD5 | ab982f7e1c4643d792cf2c4013eb3d10 |
|
BLAKE2b-256 | f41b3ba7b04d9c2daa8ba306f76a022ca16212c6488f8af4b177a9613c62aca5 |
Close
Hashes for django_sanitized_dump-0.2.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58b2d9d5db52966d9e469adf4b3ff10c598e983e388634ddeca3637bc14b2bee |
|
MD5 | c846b2ad1a5844a613c937b906a2a46f |
|
BLAKE2b-256 | 468e2b959853341e64bafa21a25af00be692178239cd49450ccd1bfc7e1603e0 |