Skip to main content

Inventory Linux command usage across repositories

Project description

CI PyPI Python License

linuxcmdscan

Inventory and analyze all Linux commands used anywhere in a repository.

linuxcmdscan scans source code, infrastructure files, scripts, and configuration across any tech stack to detect Linux command usage, classify it by category and severity, and generate auditable reports.

It is designed for:

Security reviews

Platform audits

DevOps & SRE governance

Compliance and risk assessment

Large mono-repos and infra repos

✨ Key Features

🔍 Language-agnostic scanning

Detects Linux commands embedded in:

Shell scripts

Terraform (local-exec)

YAML / CI pipelines

Python / JS / config files

Markdown & documentation

📊 Multiple report formats

Interactive HTML report (dark mode + summary dashboard)

JSON, CSV, TXT exports

🚨 Severity mapping

critical, high, medium, low

Based on command risk profile (e.g. rm, terraform destroy)

🧠 Command registry architecture

Explicit allow-listed Linux commands

No regex blob guessing

Easy to extend and audit

🖥 Dual interface

CLI for automation & CI

Desktop UI for exploratory analysis

📦 Installation

pip install linuxcmdscan

Python 3.9+ required.

🚀 Quick Start

CLI – Scan a repository

linuxcmdscan .

CLI – Scan with full exports

linuxcmdscan . --all

This generates:

scan_report.html

scan_results.json

scan_results.csv

scan_results.txt

CLI – JSON only (CI-friendly)

linuxcmdscan scan . --json

🖥 Desktop UI

Launch the graphical interface:

linuxcmdscan --ui

UI capabilities

Folder picker

Sub-folder inclusion / exclusion

Live scan progress

Real-time log viewer

One-click Open HTML Report

Cross-platform (Windows / macOS / Linux)

📊 HTML Report Features

🌙 Dark / Light mode toggle

📈 Severity summary cards

📁 Clickable file paths

🧾 Line-level command evidence

🔍 Word-wrapped commands for readability

Designed for sharing with security, audit, and management teams.

📁 Example Findings

File Line Command Severity

terraform/main.tf 88 mkdir -p build/api Low

.github/workflows/deploy.yml 42 terraform apply Critical

scripts/cleanup.sh 12 rm -rf /tmp/* Critical

🧠 How It Works

Walks the repository (build dirs excluded by default)

Scans only text-based files

Matches commands using a command registry

Classifies each finding by:

Command name

Category (infra / filesystem / network)

Severity

Produces reports for humans and machines

No shell execution. Read-only analysis.

🔒 Safety & Trust

❌ No command execution

❌ No network calls

❌ No telemetry

✅ Deterministic scanning

✅ Fully offline-capable

Safe to run on sensitive or regulated codebases.

🧩 Extending linuxcmdscan

Add or modify command rules by extending the command registry:

CommandRule(

  name="mount",

  category="filesystem",

  severity="high",

  pattern=r"(?<!\w)mount\s+\S+"

)

No changes required elsewhere.

🧪 CI / Automation

Typical CI usage:

linuxcmdscan . --json

jq '.[] | select(.severity=="critical")' scan_results.json && exit 1

Fail builds on risky commands.

🏷 Project Status

Actively developed

Production-ready

Designed for large enterprise repositories

📄 License

MIT License

👤 Author

Created and maintained by Harsh

Focused on secure infrastructure analysis and developer tooling.

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

linuxcmdscan-1.2.2.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

linuxcmdscan-1.2.2-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file linuxcmdscan-1.2.2.tar.gz.

File metadata

  • Download URL: linuxcmdscan-1.2.2.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for linuxcmdscan-1.2.2.tar.gz
Algorithm Hash digest
SHA256 e1f4349dfc1aac6c52740c41229f93cd891930a37547738287e81c985952d13b
MD5 94bb3691ca41cd3b8b128e296021c4e2
BLAKE2b-256 3827f0cd2a3ea1c245733dca8f8f8549008f371d1bcc4fc18ae204c157d21247

See more details on using hashes here.

Provenance

The following attestation bundles were made for linuxcmdscan-1.2.2.tar.gz:

Publisher: publish.yml on harshind/linuxcmdscan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file linuxcmdscan-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: linuxcmdscan-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for linuxcmdscan-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8dba066bb93bf2bb1ee0ff692c634f97092adbd0a55bdd189092164bc1af643a
MD5 94937121e9df168eba2f8db2d9022f9c
BLAKE2b-256 536753c17c3de98525c078e615725404cca56885995d35cf97ce2184e455adf6

See more details on using hashes here.

Provenance

The following attestation bundles were made for linuxcmdscan-1.2.2-py3-none-any.whl:

Publisher: publish.yml on harshind/linuxcmdscan

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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