Skip to main content

Seesec DPDP Act 2023 Compliance Scanner — audit AWS, code, and files for DPDP violations

Project description

Seesec DPDP Scanner

🛡️ India's first DPDP Act 2023 compliance scanner — audit AWS accounts, source code, and files for DPDP violations.

Tests Checks Python License

Built by Seesec Infotech Pvt. Ltd. 🇮🇳


⚡ Quick Start

# Install
pip install seesec-dpdp-scanner

# Scan your AWS account (scans ALL regions by default)
aws sso login --profile your-profile
dpdp aws --profile your-profile -o report.html

# Scan only a specific region
dpdp aws --profile your-profile --region ap-south-1

# Scan files for PII leakage (Aadhaar, PAN, credit cards...)
dpdp pii /path/to/logs -o pii-report.html

# Scan source code for hardcoded secrets & crypto misuse
dpdp code /path/to/repo -o code-report.html

# Encrypt sensitive data (DPDP-compliant AES-256-GCM)
dpdp crypto encrypt --data "1234-5678-9012" --key-id alias/my-kms-key

🔍 What It Scans — 59 AWS Checks

# See all checks
dpdp aws --list-checks

AWS Account (dpdp aws) — Scans ALL Regions by Default

Family Checks DPDP Section
🔐 Encryption (ENC) S3, RDS, DynamoDB, EBS, SQS, SNS, KMS, Redshift, ElastiCache, S3 versioning, MFA Delete, Account S3 Block Sec 8(5), Rule 6(1)(a)
👤 IAM (IAM) Root MFA, password policy, user MFA, stale keys, wildcard policies, unused roles, RDS IAM auth Sec 8(5), Rule 6(1)(b)
📋 Logging (LOG) CloudTrail, CloudWatch, VPC Flow Logs, S3 access logs, API Gateway, SSM Session Manager Sec 8(5), Rule 6(1)(c-d)
🌍 Data Residency (RES) S3/RDS/Lambda in Indian regions Sec 16
🚨 Breach Readiness (BRE) GuardDuty, Security Hub, Macie, SNS incident alerting Sec 8(6)
🔑 Secrets (SEC) Lambda env secrets, Secrets Manager rotation, ECR image scanning, ECS task secrets, EC2 user data Sec 8(5)
🌐 Network (NET) Security group DB ports, ELB TLS 1.2+, CloudFront HTTPS, ACM cert expiry, WAF on ALBs, CloudFront WAF Sec 8(5)
🗑️ Retention (RET) S3 lifecycle, RDS backups, RDS deletion protection, RDS Multi-AZ, DynamoDB PITR, S3 Object Lock Sec 8(7)
⚙️ Config (CFG) AWS Config recording, IAM Access Analyzer, Organizations SCPs Sec 8(5), Sec 16

Smart scanning: Global services (IAM, S3, CloudFront) are scanned once. Regional services are scanned per-region.

PII Scanner (dpdp pii)

Detects Indian PII with checksum validation to minimize false positives:

  • Aadhaar (Verhoeff checksum) · PAN (4th-char type validation)
  • Credit Cards (Luhn algorithm) · Indian Mobiles · Emails
  • Passports · Voter ID · GSTIN · UPI IDs · DOB patterns

Code Scanner (dpdp code)

18 static analysis rules detecting:

  • Hardcoded passwords, API keys, AWS keys, connection strings
  • Crypto misuse (ECB mode, DES/RC4, MD5/SHA1, static IVs)
  • PII in log statements, URL parameters, and exception messages
  • Disabled SSL verification

Crypto Toolkit (dpdp crypto)

  • Encrypt/Decrypt: AES-256-GCM with KMS Envelope Encryption
  • Blind Indexing: HMAC-SHA256 for searching encrypted fields
  • Format Validation: Verify DPDP ciphertext structure

📊 Output Formats

Format Command Use Case
Terminal dpdp aws Interactive use
HTML dpdp aws -o report.html Share with management
JSON dpdp aws -o report.json CI/CD pipelines
SARIF dpdp aws -o report.sarif GitHub Code Scanning
CSV dpdp aws -o report.csv Spreadsheets / Excel

🛡️ Authentication

The scanner uses boto3 and supports all standard AWS credential methods:

# Option 1: AWS SSO (recommended for enterprises)
aws sso login --profile my-profile
dpdp aws --profile my-profile

# Option 2: Environment Variables (for CI/CD)
export AWS_ACCESS_KEY_ID="..."
export AWS_SECRET_ACCESS_KEY="..."
dpdp aws

# Option 3: IAM Instance Roles (for EC2/ECS)
# No configuration needed — boto3 detects it automatically
dpdp aws

🔇 Suppressing False Positives

Create a .dpdpignore file in your project root:

# Ignore AWS-managed CloudFormation buckets
DPDP-ENC-001:cf-templates-*
DPDP-ENC-002:cf-templates-*

# Ignore a specific check entirely
DPDP-RES-001

# Ignore all checks for a test resource
*:my-test-bucket

🏗️ Multi-Region Scanning

# Default: scans ALL enabled AWS regions, in parallel
dpdp aws

# Scan only Mumbai
dpdp aws --region ap-south-1

# Multi-family filter (Prowler-style)
dpdp aws --checks ENC,IAM,LOG

# Severity filter
dpdp aws --severity critical,high

# Crank parallelism for big accounts
dpdp aws --workers 16

# Quiet mode for CI (one-line summary)
dpdp aws --quiet -o report.sarif

📊 Track Remediation Progress (Baseline Diff)

# First scan — save as baseline
dpdp aws --save-baseline baseline.json

# Future scans — only show NEW findings vs baseline
dpdp aws --baseline baseline.json

📦 Export Multiple Formats At Once

# Dump JSON, HTML, SARIF, CSV in one go
dpdp aws --output-dir ./reports

🚀 CI/CD Integration

GitHub Actions

- name: DPDP Compliance Scan
  run: |
    pip install seesec-dpdp-scanner
    dpdp aws -o dpdp-report.sarif
    
- name: Upload SARIF
  uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: dpdp-report.sarif

Exit codes: 0 = no violations, 1 = violations found.

🧪 Development

git clone https://github.com/seesec-infotech/dpdp-scanner
cd dpdp-scanner
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest tests/ -v

⚖️ Scope: What This Tool Does (and Does Not) Check

The DPDP Scanner is a technical posture tool. It checks AWS infrastructure, source code, and files. It cannot evaluate organisational, legal, or runtime obligations on its own. Use it alongside the manual checklist below.

Covered ✅ Manual / Out of Scope ❌
Sec 8(5) Security safeguards (encryption, IAM, network, secrets) Sec 5 Privacy notice content (legal review)
Sec 16 Data residency (region, SCPs) Sec 6, 7 Consent UX (granular, withdrawable, recorded)
Sec 8(6) Breach detection readiness (GuardDuty, Macie, SNS) Sec 8(2) Written processor agreements with vendors
Sec 8(7) Erasure capability (S3 lifecycle, RDS backups) Sec 8(6) The 72-hr breach notification process
PII leakage in logs and source code Sec 8(9) Grievance officer published on website
DPDP-compliant crypto helpers Sec 9 Verifiable parental consent for children
Sec 10 DPIA, audit, DPO (Significant Data Fiduciaries)
Sec 11–13 DSAR SLAs (access / correction / erasure)

If you're a Significant Data Fiduciary under Sec 10, you'll also need governance documentation, a DPIA, and a DPO — those live outside this tool.

📜 License

Apache 2.0 — see LICENSE


Made with ❤️ in India by Seesec Infotech

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

seesec_dpdp_scanner-0.4.0.tar.gz (123.4 kB view details)

Uploaded Source

Built Distribution

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

seesec_dpdp_scanner-0.4.0-py3-none-any.whl (110.0 kB view details)

Uploaded Python 3

File details

Details for the file seesec_dpdp_scanner-0.4.0.tar.gz.

File metadata

  • Download URL: seesec_dpdp_scanner-0.4.0.tar.gz
  • Upload date:
  • Size: 123.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for seesec_dpdp_scanner-0.4.0.tar.gz
Algorithm Hash digest
SHA256 99d86c925b397fc6c199c583719137facbd7b283633529a05e141e0e6389ba17
MD5 74baee44e3ec829c884b7d1133ef1a59
BLAKE2b-256 bd27213bc91b3c24c8fe2568c63bb11a88f2e90ddc07aedc04c765fca064ba8c

See more details on using hashes here.

File details

Details for the file seesec_dpdp_scanner-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for seesec_dpdp_scanner-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 078fdac6d45f6146d576ec71daae442371bb00b7243cab1b16a92a98ddce7830
MD5 46d3f82785b679f163eaf12558bffb0b
BLAKE2b-256 0b1549a81580c7fb0bece15daffa2aaaa026a5a9c798169aad006be09e4cb4b0

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