Skip to content
privacy-review logo

Privacy Review

privacy-review

Automated privacy review for git repositories. Scans for sensitive data exposure including API keys, passwords, database credentials, and tokens. Use before pushing to public repositories or sharing code. Trigger by running 'python privacy_scan.py' on a git repository.

SKILL.md

Full skill instructions

Privacy Review

Overview

Automated privacy security review for git repositories. Detects sensitive data exposure in committed files and repository configuration.

When to use:

  • Before pushing code to public repositories (GitHub, GitLab)
  • When sharing code with external parties
  • Before opening pull requests
  • Periodic security audits

Checks Performed

1. Sensitive Files in Commits

Scans git history for committed files with sensitive extensions:

  • .env, .env.local - Environment configuration
  • .pem, .p12 - Private keys and certificates
  • *_secrets.* - Secret configuration
  • *_credentials.* - API credentials

2. Secrets in Committed Code

Pattern-based scanning for sensitive patterns in source files:

  • Database URLs with credentials (postgresql://user:pass@host)
  • API keys (sk-, AKIA, Bearer)
  • Secret tokens and assignments
  • Authorization headers

3. .gitignore Protection

Verifies that .env and other sensitive files are properly ignored.

4. Local .env File

Checks if local .env exists with real credentials (not committed).

Quick Start

# Scan current directory
python privacy_scan.py

# Scan specific repository
python privacy_scan.py --repo-path /​path/​to/​repo

# Quiet mode (show only issues)
python privacy_scan.py --quiet

Report Format

The tool generates a structured report with:

======================================================================
PRIVACY REVIEW REPORT
======================================================================

📁 CHECK 1: Sensitive Files in Git
----------------------------------------------------------------------
✅ No sensitive files committed

🔍 CHECK 2: Secrets in Committed Code
----------------------------------------------------------------------
❌ FOUND potential secrets:
   - API key assignment: OPENAI_API_KEY="sk-abc123xyz..." (line 42)

🛡️  CHECK 3: .gitignore Protection
----------------------------------------------------------------------
✅ .env is protected by .gitignore

📄 CHECK 4: Local .env File
----------------------------------------------------------------------
⚠️  WARNING: .env exists with real credentials
   Status: .env file exists locally but is NOT committed

======================================================================
SUMMARY
======================================================================
❌ Found 2 privacy concern(s)

Recommendations:
  - Replace secrets with environment variable references
  - Rotate any exposed credentials
  - Ensure .env remains in .gitignore

======================================================================

Remediation Guide

Removing Secrets from History

If secrets are found in committed files:

# Remove specific file from all branches
git filter-branch --force --index-filter \
  'git rm --cached --ignore-unmatch file-with-secrets.py' HEAD

# Push cleaned history (requires force)
git push origin --force

Replacing Secrets with Environment Variables

Before:

DATABASE_URL="postgresql://user:password@host:5432/​db"
API_KEY="sk-abc123xyz..."

After:

import os

DATABASE_URL = os.getenv("DATABASE_URL")
API_KEY = os.getenv("API_KEY")

Create .env.example:

DATABASE_URL=postgresql://user:password@localhost:5432/​db
API_KEY=your-api-key-here

Common Mistakes

❌ Don't Commit

  • .env files with real credentials
  • API keys in configuration files
  • Database URLs with passwords
  • Private keys (.pem, .key)
  • Hardcoded secrets in code

✅ Do Instead

  • Use os.getenv() for configuration
  • Commit .env.example with placeholders
  • Reference secrets from environment
  • Use secret management services
  • Document required variables in README

Patterns Detected

See PATTERNS.md for complete list of sensitive patterns:

  • Database URLs with credentials
  • API keys (OpenAI, AWS, etc.)
  • Authentication tokens
  • Configuration files with extensions

Best Practices

Code Level

  • All secrets use environment variables
  • Validation at startup (fail if secrets missing)
  • No secrets in logs or print statements

Repository Level

  • .env always in .gitignore
  • Enable secret scanning in CI/​CD
  • Require review for sensitive changes
  • Audit git history periodically

Workflow Level

  • Automate pre-commit hooks for secret detection
  • Fail builds on secret detection
  • Rotate credentials regularly
  • Use short-lived tokens when possible

Troubleshooting

False Positives

The tool may flag:

  • Example values in .env.example (safe)
  • Test URLs with localhost or 127.0.0.1 (usually safe)
  • Documentation mentioning patterns (not actual secrets)

Review these manually before taking action.

Files Not Scanned

Binary files and large assets are skipped:

  • Images (.png, .jpg, .gif)
  • PDFs
  • Zip files
  • Already committed files (use git filter-branch for historical scans)

Advanced Usage

CI/​CD Integration

Add to GitHub Actions:

- name: Privacy Scan
  run: |
    python -m privacy_scan.scripts.privacy_scan --quiet

Custom Patterns

Extend privacy_scan.py with additional patterns:

# Add to patterns list in check_sensitive_patterns_in_content()
(r"custom_pattern", "Custom sensitive data"),

Ignore Specific Patterns

For files with known safe patterns (like test data):

# Modify scan_commit_for_secrets() to skip files
if "test_" in file_path.lower():
    continue

More Security skills

supabase logo
Security

supabase

Handles the full Supabase workflow from schema changes to deployment, with built-in security guardrails that catch common traps like RLS...

2.7K 308.9K
View

Comprehensive guides and best practices for Neon Serverless Postgres, covering setup, connection methods, authentication, and platform APIs.

98 216.2K
View

Guide for setting up and using Firebase Authentication. Use this skill when the user's app requires user sign-in, user management, or secure data access using auth rules.

462 163.8K
View

A skill to evaluate how secure Firestore security rules are. Use this when Firestore security rules are updated to ensure that the generated rules are extremely secure and robust.

462 127.7K
View

Official skill for integrating Firebase AI Logic (Gemini API) into web applications. Covers setup, multimodal inference, structured output, and security.

462 125.1K
View

Complete Better Auth server and client setup with database adapters, session management, plugins, and security configuration.

222 118.2K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View
cloudflare logo
Security

cloudflare

Complete Cloudflare platform integration with decision trees for compute, storage, AI, networking, security, and infrastructure-as-code.

3K 110.7K
View

Run Azure compliance and security audits with azqr plus Key Vault expiration checks. Covers best-practice assessment, resource review, policy/compliance validation, and security posture checks. WHEN: compliance scan, security audit, BEFORE running azqr (compliance cli tool), Azure best practices, Key Vault expiration check, expired certificates, expiring secrets, orphaned resources, compliance assessment.

253 103K
View
gws-gmail logo
Security

gws-gmail

Send, read, and manage Gmail messages, drafts, labels, and account settings.

31.2K 78.9K
View

Comprehensive website auditing across 230+ rules in 21 categories including SEO, performance, security, and accessibility.

94 72.3K
View
gws-shared logo
Security

gws-shared

Shared authentication, CLI syntax, and output formatting patterns for gws Google Workspace commands.

31.2K 63.4K
View

Security AI tools

StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
GeoSpy logo
Security

GeoSpy

GeoSpy: Pricing, Features, FAQs, and Alternatives for AI Teams

Free
View

Detect AI-generated voices to protect against audio fraud.

Paid
View

Ensure Your Content's Originality with AI Plagiarism Checker

Freemium
View
Img Upscaler logo
Security

Img Upscaler

Upscale images by 400% without quality loss

Freemium
View
AICheatCheck logo
Security

AICheatCheck

Accurately Detect AI-Generated Content with TheChecker.AI

Free
View
D
Security

Detect GPT

Chrome extension that detects and flags AI-generated content

Free
View