MaunPrekshak — मौन प्रेक्षक
"The Silent Observer. Nothing hides from it."
MaunPrekshak (मौन = Silent, प्रेक्षक = Observer) is a fast, privacy-first Python security toolkit designed to catch vulnerabilities, exposed credentials, and insecure code patterns right in your terminal.
⚡ Highlights
- 🔍 Dependency Vulnerabilities (SCA): Real-time CVE discovery against OSV.dev for
requirements.txt,pyproject.toml, andPipfile. - 🔑 Secrets & Credential Detection: 40+ high-precision regex detectors for AWS keys, GCP keys, GitHub tokens, Stripe keys, RSA/SSH private keys, JWTs, and database URIs with false-positive suppression.
- 🛡️ Static Code Analysis (SAST): Python AST visitor checking for
eval(),exec(),pickle.loads(),subprocess(..., shell=True),yaml.load(), insecure hashing (MD5/SHA1), and command injection. - 🎨 Rich Terminal UX: Beautiful formatted console output, severity badges, and export to JSON or Markdown.
- 🔒 100% Privacy & Local-First: Scans run entirely on your local CPU. Your source code never leaves your computer.
- 🤖 Optional AI Remediation: Plug in your own Google Gemini API key to get an instant executive summary and tailored remediation steps.
🚀 Quick Start
Installation
pip install maunprekshak
🐧 Linux (1-Line Standalone Install — No Python Required)
curl -sSL https://raw.githubusercontent.com/PramanKasliwal/maunprekshak/main/install.sh | bash
🐍 Via PyPI (Any OS)
pip install maunprekshak
# or using pipx (recommended for Ubuntu 24.04+)
pipx install maunprekshak
Basic Scan
Scan the current directory:
mp scan .
Fast Scan without AI (No API Key Required)
mp scan . --no-ai
Export Results to SARIF, JSON, or Markdown
# Export standard OASIS SARIF 2.1.0 for GitHub Code Scanning
mp scan ./my-project --output sarif --output-file results.sarif
# Export as JSON for pipelines
mp scan ./my-project --output json > report.json
# Export formatted Markdown
mp scan ./my-project --output markdown > SECURITY.md
CI/CD Mode (Exit with Non-Zero on Threshold Breach)
# Fail CI build if any CRITICAL issue is found
mp scan . --ci --fail-on critical
# Fail CI build on HIGH or CRITICAL issues
mp scan . --ci --fail-on high
🐙 GitHub Actions & Code Scanning (SARIF)
Run MaunPrekshak in your GitHub workflow and get native inline alerts in GitHub's Security ➔ Code Scanning tab:
name: Security Scan
on: [push, pull_request]
jobs:
maunprekshak:
runs-on: ubuntu-latest
permissions:
security-events: write # Needed for SARIF upload
contents: read
steps:
- uses: actions/checkout@v4
- name: Run MaunPrekshak Security Scan
uses: PramanKasliwal/maunprekshak@v0.2.0
with:
fail-on: high
output: sarif
sarif-file: results.sarif
- name: Upload to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: results.sarif
🪝 Pre-Commit Hook
Prevent secrets, leaked API keys, and AST flaws from ever reaching Git. Add to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/PramanKasliwal/maunprekshak
rev: v0.2.0
hooks:
- id: maunprekshak
args: ["--fail-on", "high"]
⚙️ Configuration File (.maunprekshak.toml)
Generate a starter configuration file with:
mp init
Or customize .maunprekshak.toml (or [tool.maunprekshak] in pyproject.toml):
[scanner]
# Directories to exclude from scans
exclude = ["tests", "fixtures", ".venv", "node_modules"]
# Default CI failure threshold: "critical", "high", "medium", or "low"
fail_on = "high"
# Disable Gemini AI remediation (fully offline)
no_ai = false
# Ignore specific SAST check IDs
ignore_rules = ["MP010"]
🖥️ Sample Console Output
╭──────────────────────────────────────────────────────────────────────────────╮
│ Risk Level: HIGH (Score: 78) │
╰──────────────────────────────────────────────────────────────────────────────╯
┌──────────────────────────────────────────────────────────────────────────────┐
│ Scan Summary │
├──────────────┬──────────┬─────────┬────────┬───────┬────────────────────────┤
│ Module │ CRITICAL │ HIGH │ MEDIUM │ LOW │ Total │
├──────────────┼──────────┼─────────┼────────┼───────┼────────────────────────┤
│ Dependencies │ 1 │ 2 │ 0 │ 0 │ 3 vulnerabilities │
│ Secrets │ 1 │ 1 │ 0 │ 0 │ 2 exposed credentials │
│ SAST │ 0 │ 3 │ 4 │ 1 │ 8 insecure patterns │
└──────────────┴──────────┴─────────┴────────┴───────┴────────────────────────┘
Top Findings:
[CRITICAL] CVE-2023-32681 — requests==2.25.1 (Fixed in 2.31.0)
[HIGH] AWS Access Key ID exposed in config.py:12
[HIGH] MP004: subprocess.run() called with shell=True in deploy.py:45
📖 CLI Command Reference
| Option | Default | Description |
|---|---|---|
path |
. |
Directory or project path to scan |
--only |
all |
Restrict scan to: deps, secrets, or sast |
--output |
console |
Output format: console, json, markdown |
--output-file |
stdout |
Write report directly to a file |
--ci |
false |
Compact machine-readable summary + exit code |
--fail-on |
critical |
Threshold: critical, high, medium, low |
--no-ai |
false |
Skip AI summary generation (instant execution) |
--exclude |
None |
Comma-separated directories to exclude |
🤖 Bringing Your Own Gemini AI Key (Optional)
If you'd like AI-generated remediation summaries, set your Gemini API key in your environment or a .env file:
export GEMINI_API_KEY="AIzaSy..."
mp scan .
Get a free API key at Google AI Studio.
🤝 Contributing
We welcome community contributions! Please read our CONTRIBUTING.md to get started.
- Found a bug or missing a secret pattern? Open an Issue.
- Want to contribute a new SAST check? PRs are warmly welcomed!
🔒 Security Policy
We take security vulnerabilities seriously. Please review our SECURITY.md for details on supported versions and how to responsibly report vulnerabilities privately.
📄 License
Distributed under the MIT License. See LICENSE for details.
In ancient Sanskrit, मौन (Maun) signifies the all-knowing silence, and प्रेक्षक (Prekshak) is the ever-vigilant observer. MaunPrekshak protects your code quietly, thoroughly, and without compromise.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file maunprekshak-0.2.0.tar.gz.
File metadata
- Download URL: maunprekshak-0.2.0.tar.gz
- Upload date:
- Size: 28.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2017c9339851a52d46a930983eeac33c99724379e7b1eaf217590a00513b0de1
|
|
| MD5 |
2a2ba8ff9f5c6f191e6263f9213b2796
|
|
| BLAKE2b-256 |
01957ff4fd67323dc95d084d58c93cad6345ac6123d20b27b90d4815655777c8
|
File details
Details for the file maunprekshak-0.2.0-py3-none-any.whl.
File metadata
- Download URL: maunprekshak-0.2.0-py3-none-any.whl
- Upload date:
- Size: 23.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3be4e8e5830f01d8de1108d26694bc630be9ae664c689f38faee9d1623bca4e7
|
|
| MD5 |
1e154bd17690f784060dd61a9c731869
|
|
| BLAKE2b-256 |
3f0c16fb36edce434dba030baba6cfdc59ef961a758579bf8c9f4dadfc00d37f
|