Production hardening
Maintainer: mati peterson <ipsonic@mailbox.org> · https://ipsonic.com/probe/
Production hardening focuses on local diagnostics, strict validation, output redaction and bounded check execution. It uses the existing Python standard library and distribution-packaged Requests and PyYAML.
Check the installation
python3 ipsonic-probe.py --self-test
Checks Python, Requests, PyYAML and the system TLS trust-store location without connecting to a network service. Returns 0 when ready, 3 otherwise.
Strict YAML validation
python3 ipsonic-probe.py --validate --strict examples/138-hello-first-tcp-ssh.yaml
Strict mode rejects unknown top-level keys and known nested keys in timeouts, request, auth, execution, connection and metadata. Typo suggestions are included where possible. It also rejects literal auth.password, auth.token and sensitive literal HTTP headers. Existing configurations remain compatible unless --strict is explicitly supplied. Strict validation is not a complete schema for all deeply nested protocol assertions.
Protect credentials
Prefer auth.token_env and auth.password_env, and inject values through the environment. Known credential values are redacted from execution error messages and JSON/monitoring output. Do not put secrets in service names, filenames, URLs, metadata, assertion strings or arbitrary YAML fields: those are not guaranteed to be redacted. Secure file permissions and avoid shell history leaks. This is defensive output filtering, not a complete secret-management system.
Total check budget
timeouts:
connect: 3
response: 5
total: 15
timeouts.total is a positive number of seconds limiting the wait for the entire logical check, including retries, delays and backends. Exceeding the deadline produces UNKNOWN (exit code 3). Important: network calls run in worker threads; a deadline returns control to the caller but cannot forcibly interrupt an already-running DNS/socket operation. Such background work may continue briefly until its underlying socket timeout. For a hard operating-system wall-clock limit, use an external supervisor such as GNU timeout or systemd.
Exit codes
0 OK, 1 WARNING, 2 CRITICAL, 3 UNKNOWN. A configuration or execution error yields UNKNOWN.
Regression suite
python3 -m unittest discover -s tests -q
The suite includes offline CLI tests, strict typo detection, secret redaction, timeout handling, DNS, TLS, proxy and monitoring behavior. Always test with real endpoints in staging before production rollout.
Provided AS IS without warranty. Validate all checks before production use.