# Infrastructure, security and operator integration examples

All YAML examples in `examples/149-*.yaml` through `examples/179-*.yaml` are offline-validatable with `python3 ipsonic-probe.py --validate --strict FILE`. They are templates: replace documentation-only domains (`example.com`), IPs (`192.0.2.0/24`, `2001:db8::/32`), CA locations and environment variables before live checks. All 31 have standalone downloadable pages in the static example catalog.

## Infrastructure (P0)

- **149** compares answers from two configured DNS resolvers; not authoritative AXFR/zone transfer validation.
- **150** checks MX publication, not SMTP delivery.
- **151–152** check certificate expiry boundary and hostname/SAN respectively. A single `min_valid_days` boundary is not a separate warning/critical ladder.
- **153–154** check reverse-proxy health and redirect policy.
- **155–156** demonstrate bearer authentication from environment and selected JSON-path assertions (not complete JSON Schema validation).
- **157–158** separately check IPv4 and IPv6 TCP reachability.
- **159–161** form an SSH/SMTP/IMAP TCP port matrix; TCP connect does not validate application protocol health.

## Enterprise and security (P1)

- **162** trusts a private CA from `IPSONIC_CA_BUNDLE`.
- **163** uses an explicit HTTPS proxy via `IPSONIC_HTTPS_PROXY`; raw TCP/DNS are not proxied.
- **164** checks DNSSEC record publication, **not cryptographic DNSSEC chain verification**.
- **165–166** check HSTS and Basic authentication via `IPSONIC_BASIC_PASSWORD`.
- **167** requires successful checks against two resolved backends; this is **not byte-for-byte response equality**.
- **168–169** separate staging and production ownership.
- **170** sets response-time warning/critical thresholds; this is not historical SLA reporting.

## Operator workflows (P2)

The `integrations/` directory contains deployment templates. Review paths, users, check filenames and object names before installing them. The integration files are source examples, not automatically installed by the probe.

- **171 Nagios:** `integrations/nagios/ipsonic-probe.cfg`; uses `--output nagios` and standard exit codes 0/1/2/3.
- **172 Icinga 2:** `integrations/icinga2/ipsonic-probe.conf`; CheckCommand and example Service apply rule.
- **173 Checkmk:** `integrations/checkmk/ipsonic_probe`; executable local check wrapper using `--output checkmk`.
- **174 systemd:** `integrations/systemd/ipsonic-probe.service` and `.timer`; oneshot every five minutes, logs to journal. Nonzero check results mark the oneshot unit failed; no continuously running daemon is needed.
- **175 Ansible:** `integrations/ansible/validate-checks.yml`; validates without network access.
- **176 CI/CD:** `integrations/ci/validate.sh`; validates all YAML checks offline, no pip required.
- **177–178 config diff:** `python3 ipsonic-probe.py --diff examples/177-config-diff-before.yaml examples/178-config-diff-after.yaml`.
- **179 baseline:** `python3 ipsonic-probe.py --baseline-save /tmp/ipsonic-baseline.json examples/179-baseline-workflow.yaml`, followed by `python3 ipsonic-probe.py --baseline-compare /tmp/ipsonic-baseline.json examples/179-baseline-workflow.yaml`. The baseline tracks status/assertion identity, **not** raw DNS, TLS fingerprint or HTTP header drift.

## Validation and execution

```sh
sh integrations/ci/validate.sh
python3 -m unittest discover -s tests -q
python3 ipsonic-probe.py --explain examples/149-dns-primary-secondary-consistency.yaml
python3 ipsonic-probe.py --list-checks examples --format tsv
```

Never copy secrets into YAML, CI logs, or command arguments. Set secret environment variables through your operator-approved secret mechanism.
