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.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e1ac4658b0767ccfc718c735afba054172a09661988fd5bb7ffa6cc7feb56c0 |
|
MD5 | 70e6884e0bd2cf76c176889df48e4125 |
|
BLAKE2b-256 | d401f786a87912582ba34b6f79b8b2262a62c1aaea891f865382bf21d2da193b |
Close
Hashes for django_sanitized_dump-0.1.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a55a58922173dfa74f9c4f5a3928047608e2ded052003e4ab606e5f8d7c6479 |
|
MD5 | eba021df9c9357d38963aac90f65240f |
|
BLAKE2b-256 | b3e471bbcc4427b090f82c23a3024a9d223ae331a0c825980013094023ab000a |