Commit graph iac/ansible/roles/monitoring/templates/alert-rules.yaml.j2
Author SHA1 Message Date
56dd0255dc
monitoring: watch peers, devices, accounts and logins
All checks were successful
deploy / ansible (push) Successful in 8m12s
Monitoring covered availability only: a new WireGuard peer, a machine
on the private network, an extra account or key, or a login from
outside the VPN would have gone unnoticed.

security-metrics runs every minute on both hosts and exports what it
finds for node_exporter: WireGuard peers and where they connect from,
addresses answering a ping sweep of the VPC, login accounts, sudo and
docker members, listening ports, containers with host-level access,
and fingerprints of the account, sudoers, sshd, WireGuard and
authorized_keys files. Each item is compared with a baseline in the
role defaults and host_vars and exported with known="true|false", so a
deliberate change has to update the baseline with it. On ops it also
counts Forgejo users, keys and runners.

Grafana gets a Security dashboard and an alert group for anything
unknown, a changed access file, an SSH login from outside WireGuard,
failed-login bursts on SSH, Forgejo, Grafana and the asxp.io admin, a
new container, and for logs or the collector itself going quiet, which
would otherwise blind the rest.

It never reads `wg show dump`, which prints preshared keys.

Assisted-by: Claude:fable-5-2
2026-11-15 21:59:16 +04:00
cf142c6e3b
xmpp_cert_sync: push asxp.io and xmpp.asxp.io as separate files
Some checks failed
deploy / ansible (push) Failing after 59s
Traefik never requests a certificate for a name it already holds one
for, so the XMPP certificate came out without asxp.io, the XMPP domain
itself. ejabberd picks the matching certificate file per domain, so push
two: the site's asxp.io certificate and xmpp.asxp.io + conference.
The receiver takes the name from the SSH command (asxp.io or a
subdomain), checks the certificate matches it, and retires the
hand-made server.pem once both files are in place.

A second probe on 5223 sends SNI asxp.io, as clients do, and the
outdated-certificate alert compares each served certificate with its
source in acme.json.

Assisted-by: Claude:opus-5-5
2026-11-13 08:26:08 +04:00
5e009c4a47
xmpp_cert_sync: renew the XMPP certificate through Traefik
All checks were successful
deploy / ansible (push) Successful in 7m22s
The ejabberd certificate (asxp.io, conference., xmpp.) was issued by
hand and expires 2027-01-28 with nothing renewing it. Traefik now
obtains it alongside the sites' certificates, through a router that
only exists to request it, and a systemd path unit on ops pushes it to
services whenever acme.json changes, with a daily run as fallback.

The push uses its own SSH key, accepted from ops' VPC address only and
forced to xmpp-cert-install, which checks the certificate is valid for
another day and matches its key before replacing server.pem and
reloading ejabberd.

Two alerts: the sync hasn't succeeded for two days, or ejabberd serves
an older certificate than Traefik holds for six hours. The existing
expiry alert already covers port 5223.

Assisted-by: Claude:opus-5-5
2026-11-13 08:16:00 +04:00
e20f5a7d07
ansible: monitoring with Prometheus, Loki and Grafana
All checks were successful
deploy / ansible (push) Successful in 7m23s
Nothing watched the servers: tonight's asxpio crash loop was found by
hand. On asxpio-ops, Prometheus (30 days), Loki (14 days) and Grafana
at gf.asxp.io (WireGuard only), with blackbox_exporter probing every
service from outside and postgres_exporter. On both hosts node_exporter
and cAdvisor on the VPC address, and Alloy shipping container logs, the
journal and Traefik's access log to Loki over the VPC.

Traefik and Forgejo expose their metrics; restic and the bucket replica
record their last success for node_exporter. Dashboards: an overview as
home, plus hosts, containers, Traefik, probes, Postgres and logs.
Alerts by email to me@asxp.io: host or service down, certificate under
14 days, disk or memory nearly full, a container restart-looping,
Postgres down, backup or replica stale.

Assisted-by: Claude:opus-5-5
2026-11-13 04:59:11 +04:00