Extensible Python CLI to run performance/security/configuration checks. One file = one check. Dynamic discovery of checks & providers. Facts collected per tech (no targets).
pip install -e .
auditx run --format tableFrom repo root, useful to test without pip install.
Wrapper — uses local virtualenv automatically
- macOS / Linux
./auditx run --format table ./auditx docs --output checks.md ./auditx docs --tech linux --output linux-checks.md # optional filter ./auditx docs --include hostname --exclude slowqueries ./auditx docs --format table ./auditx facts --format json # collects all providers by default
Option A — Inline PYTHONPATH (recommended)
- macOS / Linux
PYTHONPATH=src python3 -m auditx.cli run --format table PYTHONPATH=src python3 -m auditx.cli docs --output checks.md
- Windows (PowerShell)
$env:PYTHONPATH="src"; python -m auditx.cli run --format table $env:PYTHONPATH="src"; python -m auditx.cli docs --output checks.md
Tip: Running
python3 src/auditx/cli.py ...directly raisesImportError: attempted relative import with no known parent packagebecause the package context is missing. Always invoke the CLI viapython -m auditx.cliwithPYTHONPATH=srcwhen working from the repository.
Color: Table output is colorized by default. Add
--no-colorto disable ANSI styles (for CI/logs) or--colorto force color when piping.
Option B — Export PYTHONPATH once per shell
- macOS / Linux
export PYTHONPATH=src python3 -m auditx.cli run --format table python3 -m auditx.cli docs --output checks.md - Windows (PowerShell)
$env:PYTHONPATH="src" python -m auditx.cli run --format table python -m auditx.cli docs --output checks.md
Optional: local virtualenv
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt # extras: -r requirements-mysql.txt / -r requirements-zabbix.txt
python3 src/auditx/cli.py run --format tableConfiguration files are loaded in the following order (later entries override earlier ones):
~/.auditx/*.yamlconfig/*.yamlrelative to the current working directory- Direct file references provided via
AUDITX_CONFIG_DIR(either a directory containing YAML files or a YAML file path) - Explicit
--config path.yamloptions provided on the CLI (can be repeated; merged last)
Copy config/auditx.yaml.default or rely on the built-in template and place your customized YAML under one of the directories above (for global usage, prefer ~/.auditx). You can override any value with env AUDITX__..., --vars-file path.yml, or --set key=value. Secrets support ${env:VAR} and ${file:/path}.
mysql:
host: db1.example.com
user: auditor
password: ${env:MYSQL_AUDITOR_PASS}
database: appdb
zabbix:
api_url: https://zabbix.example.com/api_jsonrpc.php
api_token: "" # optional; overrides username/password when provided
username: auditor
password: ${env:ZABBIX_PASS}
unsupported_item_threshold_minutes: 60 # adjust to change the unsupported item check window
linux:
method: localAll .yaml / .yml files you create in config/ are merged in lexicographic order.
If you run the CLI without any configuration files, it will guide you through an interactive setup (only when running in a TTY).
Tip: Every CLI command (
run,facts,docs) accepts one or more--config path.yamloptions. These files are resolved after the standard search paths, making it easy to target ad-hoc configurations without moving them intoconfig/or~/.auditx/.
Providers under auditx/providers/*.py (or external plugins via entry point auditx.providers) are
auto-discovered at runtime; they register facts per tech. Facts are cached in-memory and optionally
persisted with --facts-cache (+ TTL via --facts-ttl).
- Code style: black + ruff, type hints, mypy (strict)
- Tests: pytest