Skip to main content

Sanitized sensitive information from your database dumps

Project description


Sanitized sensitive information from your database dumps 💩

DB Sanitization


Example config

   - "ai-senitizers"
   - "some-other-lib"
   first_name: "name.first_name"
   last_name: "name.last_name"
   created: null
   modified: null
   id: null
   field: "education.field"
   school: ""
   started: "datetime.datetime"
   credits: null
   information: "string.loremipsum_preserved"
 file_file: null

Example custom sanitizers

# /sanitizers/
def sanitize_first_name(value):
	return faker.first_name()

def sanitize_last_name(value):
	return faker.last_name()

# /sanitizers/
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

  1. Custom sanitizers inside ./sanitizers
  2. Addon sanitizers (config.addons)
  3. Core sanitizers

Django Management Commands

Sanitized Dump

./ sanitized_dump -c > dump.sql

  1. Warn about unhandled fields
  2. Creates a database dump (mysqldump/pgdump)
  3. Run sanitazier

Check Sanitize Dump

./ sanitized_dump -c

  1. Returns an error code if there are unhandled database fields

Init Sanitizer

./ init_sanitizer

  1. Create configuration from current database state

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

django-sanitized-dump-0.2.1.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distribution

django_sanitized_dump-0.2.1-py2.py3-none-any.whl (9.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

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