Open
Conversation
Introduces a three-part security audit system to detect PII leaks and configuration loopholes: 1. scripts/security_audit.py — deterministic Python scanner that checks committed files, git history, untracked surface, .gitignore coverage, and GitHub repo security settings. Supports --write-report, --check- external, --repo, --fail-on, and --json-only flags. Exits 2 on CRITICAL/HIGH, 1 on warnings, 0 on clean. 2. scripts/security_patterns.json — regex library with severity ratings for AWS/GitHub/OpenAI/Anthropic/Slack/Stripe tokens, PEM private keys, Indian PAN/Aadhaar/GSTIN/IFSC/mobile, JWT, and generic secret assignments. Each pattern supports placeholder_values to filter known-good test fixtures and allowlist_context to filter by line keywords. 3. scripts/security_allowlist.json — explicit list of intentional exposures (e.g., maintainer name/email in OSS grant application docs, placeholder PAN values in UI components and tests) with required reason strings for auditability. Uses file-globs with ** support. The scanner also reads .security/known_values.json (gitignored) to search for the user's real PAN/name/email via literal match in committed files and git history — far more reliable than regex alone. A .security/known_values.json.example template ships in the repo. .gitignore is expanded to close gaps found during initial scan: *.sqlite, *.sqlite3, *.key, *.pem, *.pfx, *.p12, secrets.json, credentials.json, .ssh/, plus the .security/ state files. A weekly scheduled task (freefile-security-audit, Mondays 08:43 local) runs the scanner, diffs against last week's report, and only notifies when new unexpected findings appear, a CRITICAL persists, or GitHub config drifts from baseline. Verification: - Dry clean run on current HEAD: 0 findings, 5 allowlisted - Planted-secret test (AWS/Anthropic/GitHub tokens + non-placeholder PAN in scripts/_test_secret_plant.py): 5 findings detected, exit 2 - Dependabot alerts + automated security updates enabled via gh api (one-time hardening action) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The backend CI job has been failing since the workflow was introduced in e52b4a2 — two pre-existing bugs surfaced on this PR's CI run: 1. pytest, pytest-asyncio, and httpx are not in requirements.txt, so `pip install -r requirements.txt` leaves them uninstalled and the subsequent `pytest tests/` step fails with "command not found". 2. Even with pytest installed, plain `pytest` invocation doesn't add the project root to sys.path, so `from backend.main import app` in tests/conftest.py fails with ModuleNotFoundError. Fixes: - Add pytest>=8.0.0, pytest-asyncio>=0.23.0, httpx>=0.27.0 to requirements.txt (consistent with playwright already being there). - Add a minimal pytest.ini with `pythonpath = .` so tests can import the backend package from the project root regardless of how pytest is invoked. Verified locally: all 39 tests pass with plain `pytest tests/`. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
Author
CI fix added (ab5e464)Pushing this PR surfaced a pre-existing CI bug introduced by e52b4a2 when the workflow was first added. Two issues:
Added:
Verified locally: all 39 tests pass with plain |
Add show-hn-post.md with the title, body, technical first comment, and pre-launch checklist for the Day 6 Show HN submission (playbook §5.3). Mark awesome-privacy #500 and awesome-fastapi #281 as CLOSED in the PR tracker; both were closed 2026-04-15. #500 was rejected for repo being too new (<16 weeks) and 0 stars — plan to resubmit at Day 14+ once metrics improve. Active monitoring narrowed to 3 PRs (#2, #663, #766).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a three-part security audit agent that scans FreeFile for PII leaks, exposed secrets, and GitHub configuration loopholes. Motivated by open-sourcing the repo and wanting continuous assurance that nothing sensitive has leaked.
What's included
1.
scripts/security_audit.py— deterministic scannergit log -Sfor known personal valuesgh api: secret scanning, push protection, Dependabot alerts + security updates, branch protection, webhooks--check-external) to search other public GitHub repos for known personal values--write-report,--check-external,--repo,--fail-on={warn,critical},--json-only2.
scripts/security_patterns.json— regex libraryEach pattern supports:
placeholder_values— exact matches to suppress (e.g., `ABCDE1234F`, `9876543210`)allowlist_context— line keywords that suppress matches (e.g., `test`, `example`, `your_`)3.
scripts/security_allowlist.json— intentional exposuresFile-glob + rule + optional value combinations that are known-intentional. Each entry requires a `reason` string for auditability. Supports recursive `**` globs.
Current allowlist covers:
4. Private config (gitignored)
5. Expanded .gitignore
Adds: `.sqlite`, `.sqlite3`, `.key`, `.pem`, `.pfx`, `.p12`, `secrets.json`, `credentials.json`, `.ssh/`, plus `.security/` state files and `.oss-metrics-history.jsonl`.
Verification performed
One-time hardening (already applied outside this PR)
Dependabot alerts + automated security updates are now enabled (were disabled before this work).
Scheduled monitoring
A weekly `freefile-security-audit` scheduled task runs Mondays at 08:43 local time:
How to use locally
Type of Change
Checklist