Skip to main content

Self-hostable data sanitization app with PII detection, pseudonymization, k-anonymity, and bounded DP noise

Project description

SDSA

Secure Data Sanitization App (SDSA) is a self-hostable tool for sanitizing tabular data before it leaves a trusted environment.

It ingests CSV, delimited TXT, and single-table SQL INSERT dumps; detects likely sensitive fields; applies explicit per-column privacy policies; enforces k-anonymity; measures or enforces l-diversity for sensitive cleartext attributes; and exports a sanitized CSV with JSON and Markdown privacy reports.

SDSA upload screen showing the three-step sanitization workflow

Install

pip install sdsa
sdsa-server start

Open http://127.0.0.1:8000/.

What It Does

  • Serves a browser UI and REST API from one FastAPI application.
  • Detects likely PII such as email, phone, card number, government ID, date of birth, name, and address fields.
  • Supports retain, mask, hash, tokenize, redact, drop, numeric_bin, date_truncate, string_truncate, and dp_laplace actions.
  • Applies bounded Laplace noise to numeric columns when differential privacy is configured with explicit epsilon, lower, and upper values.
  • Tracks cumulative per-column DP epsilon for the uploaded session to prevent repeated noisy releases from being averaged.
  • Enforces k-anonymity over selected quasi-identifiers and can enforce l-diversity on sensitive cleartext attributes.
  • Provides preflight suppression estimates before processing.
  • Stores uploaded data in memory with a default 30-minute session TTL.

CLI

sdsa-server start
sdsa-server start --host 0.0.0.0 --port 8000
sdsa-server start --random-port
sdsa-server start --reload

The package includes the static frontend, so no separate web build is required.

Privacy Model

SDSA produces pseudonymized microdata with optional per-column local-DP style noise. It does not claim dataset-level (epsilon, delta) differential privacy. Linkage attacks using auxiliary data may still succeed.

k-anonymity bounds prosecutor re-identification risk to at most 1/k for the declared quasi-identifier set, subject to the limits described in each generated privacy report.

l-diversity is measured by default for cleartext non-QI attributes and can be enforced with l >= 2. Homogeneous sensitive groups appear as warnings in the report when l-diversity is measured but not enforced.

Deployment

For production, run sdsa-server start behind TLS termination and keep one SDSA process per deployment unless you replace the in-memory session store with shared infrastructure. The GitHub repository includes Docker, Compose, nginx, and CI/CD examples.

Links

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

sdsa-1.2.0.tar.gz (80.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sdsa-1.2.0-py3-none-any.whl (69.1 kB view details)

Uploaded Python 3

File details

Details for the file sdsa-1.2.0.tar.gz.

File metadata

  • Download URL: sdsa-1.2.0.tar.gz
  • Upload date:
  • Size: 80.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for sdsa-1.2.0.tar.gz
Algorithm Hash digest
SHA256 3bbfbd72ca572478bce74f991e15d75d6d1e5f5cf61882967e74cacda76bc8b7
MD5 8cf124ce7d67b27fc93007fe3e8492cc
BLAKE2b-256 0b3b342288f6f21e84da457608d3b076d7da3f49a74c0cf2324c6fb983a59fc8

See more details on using hashes here.

File details

Details for the file sdsa-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: sdsa-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 69.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for sdsa-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 05cc2365a3fa35ddd484c7a342e3245516583993ab5fadd4a79ffc5bbf20387a
MD5 bb10ea76054b1d12fbf0f42c6c0e0004
BLAKE2b-256 d09b027af8f58250f7bd4317cc6020ae91bb84261338ba1c78ffbcda5184bf7f

See more details on using hashes here.

Supported by

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