Skip to main content

Harden (OSS Core)

Minimal open‑source subset of Harden. It only provides:

  • analyze — static risk report
  • lock — deterministic dependency lock
  • generate — Dockerfile‑only + SBOM

No runtime loop, no deploy/export, no enterprise features.

Enterprise Edition

The Enterprise Edition extends Harden with:

  • Runtime profiling + policy tightening
  • Deployment artifacts (K8s, CI/CD, auth, etc.)
  • Enterprise buyer workflows and reporting

If you need those capabilities, request access to the Enterprise Edition.

Installation

pip install -e .

Or run directly:

python3 -m harden [command]

Commands

analyze

harden analyze <path>

Produces:

  • Terminal report
  • JSON report at <path>/.harden/state/harden-report.json

Highlights:

  • Framework + entrypoint detection
  • Entry command inference (best‑effort) — shown in terminal and JSON report
  • Python version detection
  • Secrets scanning (regex + entropy)
  • Dependency listing (requirements/pyproject/bare imports)
  • OSV CVE checks with severity
  • AI usage + external services detection
  • Risk score (0–100)

lock

harden lock <path> [--strategy auto|uv|pip-compile|pip-freeze]

Produces:

  • <path>/requirements.lock
  • <path>/build_report.json

If no manifest exists, lock infers dependencies from imports and writes .harden/state/requirements.inferred.txt as the lock input.

generate

harden generate <path> [--fail-on-critical]

Produces:

  • <path>/.harden/Dockerfile
  • <path>/.harden/sbom.json
  • <path>/.dockerignore (only if missing)

Behavior:

  • Uses requirements.lock when present (preferred)
  • Falls back to requirements.txt
  • If only pyproject.toml exists, installs the project (pip install .)

--fail-on-critical exits non‑zero if critical CVEs are detected.

OSV Cache Behavior

OSV responses are cached at: <path>/.harden/state/osv_cache.json

Default TTL: 24 hours. Override with:

export HARDEN_OSV_CACHE_TTL_SECONDS=0   # disable cache

Risk Scoring (high‑level)

  • Critical secrets: +20 each
  • Hardcoded AI keys: +25 each
  • Critical CVEs: +15 each
  • High‑severity issues: +8–10 each
  • Unpinned dependencies: +2 each

Risk levels:

  • 0–24: LOW
  • 25–49: MEDIUM
  • 50–74: HIGH
  • 75+: CRITICAL

Project Structure (OSS)

harden/
├── __init__.py
├── __main__.py
├── cli.py
├── locker.py
├── pipeline.py
├── analyzer/
│   ├── models.py
│   ├── detector.py
│   ├── secrets.py
│   ├── dependencies.py
│   ├── ai_usage.py
│   └── report.py
└── generators/
    ├── dockerfile.py
    └── sbom.py

Requirements

  • Python 3.8+
  • click >= 8.0.0
  • pyyaml >= 6.0
  • rich >= 13.0.0

License

Apache-2.0. See LICENSE.

Metadata

Release files for harden 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for harden 0.1.4
File Size Uploaded Provenance Actions
harden-0.1.4.tar.gz 117.3 kB With provenance Details for harden-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for harden 0.1.4
File Interpreter ABI Platform Actions
harden-0.1.4-py3-none-any.whl Python 3 none any Details for harden-0.1.4-py3-none-any.whl

Total release size: 181.2 kB

Release files / harden-0.1.4.tar.gz

Download URL harden-0.1.4.tar.gz
Size 117.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d1c7c3b3afa083ff7373768e3735eaf371aa4054180d0369ae148a9c9a5e4a89
BLAKE2b-256 checksum
How to use checksums
5fa5a8e42d87467f8d6d13b8b50e60dca1c635e0c223bd954cf7409e8f857ebf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 28, 2026.

Transparency log

Release files / harden-0.1.4-py3-none-any.whl

Download URL harden-0.1.4-py3-none-any.whl
Size 63.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1714d23954334cb50908b455073f55f6f6ec45da32a87be9b06b162caec78ae4
BLAKE2b-256 checksum
How to use checksums
e9eb715e92f67607c41098671ac0f565a814fa3c6c11f9ce5c27f6795b4c6467
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 28, 2026.

Transparency log

Security for harden 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for harden-0.1.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page