Day 074 / Security / Local Review

Secret Leak Pattern Scanner

View source ↗Scroll to explore ↓
Secret Leak Pattern Scanner project cover
/ Overview

An offline Python CLI that flags a small set of credential-like lines without printing matched values.

NameSecret Leak Pattern Scanner

ClientIndependent daily build

IndustriesSecurity education

DateDay 074 · November 15, 2026

/ Challenge

Before sharing a configuration snippet, a reviewer needs a small signal without copying potentially sensitive values into another report. Pattern matching must also make its blind spots clear.

/ Provided services

Clear thinking.
Practical delivery.

01

Focused pattern review

Case-insensitive assignments and standalone private-key markers provide a deliberately narrow review aid.

02

Minimal diagnostics

Findings omit source values, excerpts and filenames. Input errors use a fixed message.

03

Honest limits

False positives and missed secrets are possible. Findings require local review and this tool performs no remediation.

Secret Leak Pattern Scanner feature visual
/ Solution

The standard-library CLI reads one explicit UTF-8 file capped at 64 KiB. It flags nonempty assignments to four fixed credential names and selected private-key opening markers. JSON output contains line numbers, fixed rule identifiers, a count and a scope note. It performs no network calls, credential verification or file modification. Placeholder assignments remain review findings. Other variable names, embedded JSON keys, Git history and unsupported token formats are outside scope; no matches is not a security guarantee.

/ Impact

One explicit local file

No matched values in output

Bounded UTF-8 input

Documented exit codes

Fourteen passing tests

/ Tech stack

Python standard library

Argparse, pathlib, regex and JSON provide the CLI without dependencies.

Fourteen unit tests

Tests cover marker variants, assignments, placeholders, comments, missing values, line numbers, output omission and invalid input.

Next project

CSP Builder Lite

View case study ↗