DataSentry
Static privacy compliance and data protection auditing tool for developers.
DataSentry is a modular, offline-first static privacy scanner designed to inspect target repositories and database schemas. It automatically identifies compliance risks against key data protection laws, including Chilean Law N° 21.719, Mexican LFPDPPP, Colombian Law 1581, and Brazilian LGPD, with integration underway for EU GDPR, California CCPA/CPRA, and Canadian PIPEDA.
How It Works (Sensors)
The scanner recursively executes three specialized auditing sensors across your project directory:
1. Database Schema Analyzer
Scans database definition files (.sql) to identify unencrypted personal data fields (such as passwords, emails, health metrics, or biometrics) and verifies the existence of retention/cleanup procedures or pseudonymization mappings.
2. Source Code Analyzer
Audits source code files (.py, .js, .ts, .go, etc.) to locate security risks, including:
- Hardcoded secrets and API keys.
- Weak cryptographic algorithms (MD5, SHA1).
- Insecure communication protocols (HTTP, FTP, Telnet).
- PII leakages in application console logs.
- Implementation of endpoints related to ARCO rights (Access, Rectification, Deletion, Portability).
3. Transparency & Consent Analyzer
Scans UI templates and documentation to verify the presence of a privacy policy and detect opt-in dark patterns (such as pre-checked checkboxes).
Configuration Options
You can declaratively configure the scanner’s behavior by placing a datasentry-project.properties file in the root of your project.
Available Parameters:
| Parameter | Default Value | Description |
|---|---|---|
datasentry.projectKey | default_project | Unique identifier for your project in SafeData. |
datasentry.organization | default_org | The name of your organization. |
datasentry.sources | . | Root directory to start the scan. |
datasentry.exclusions | venv/**,**/node_modules/** | Comma-separated list of glob patterns to exclude from scanning. |
datasentry.privacyPolicyPath | PRIVACY.md | Expected path to the Privacy Policy document. |
datasentry.laws | all | Active regulations to validate against (chile-21719, mexico-lfpdppp, colombia-1581, brazil-lgpd, all). |
datasentry.log.level | INFO | Console logging detail level (DEBUG, INFO, WARN, ERROR). |
Configuration File Example:
# datasentry-project.properties
datasentry.projectKey=my_compliance_project
datasentry.organization=my_company
datasentry.sources=.
datasentry.exclusions=venv/**,**/__pycache__/**,**/node_modules/**,**/dist/**
datasentry.privacyPolicyPath=docs/privacy.md
datasentry.laws=chile-21719,mexico-lfpdppp,colombia-1581,brazil-lgpd
datasentry.log.level=INFO
How to Run the Scanner
1. Running via Python CLI
Install the dependencies and run the analysis command:
python3 main.py analyze --target /path/to/project --laws all
2. Running via Docker (Recommended)
For an isolated execution without local Python configuration, use the Docker image by mounting your code folder to /src:
# Build the local scanner image
docker build -t datasentry-scanner:local -f Dockerfile.local .
# Run the audit
docker run --rm -v "/path/to/my-code:/src" datasentry-scanner:local analyze --target /src
.privacyignore File
If you need to exclude specific files or directories from the privacy audit (e.g., test fixtures or mock databases), create a .privacyignore file in the root of your project:
# .privacyignore
tests/fixtures/mock_data.sql
src/legacy/auth_test.py