Skip to content

fix(observability): seven-day ACME leaves are not expiring certificates (#136) - #718

Merged
Gerrrt merged 1 commit into
mainfrom
gerrrt/tier-ca-expiry-rule-136
Sep 29, 2026
Merged

Gerrrt merged 1 commit into
mainfrom
gerrrt/tier-ca-expiry-rule-136

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Sep 29, 2026

Copy link
Copy Markdown
Owner

What changed

  • renewal: acme on the ntfy probe target. TlsCertificateExpiringSoon (30 days) and TlsCertificateExpiryImminent (7 days) now select renewal!="acme". Targets without the label are unaffected.
  • New TlsAcmeRenewalStalled, critical. It fires when an ACME leaf has under 36 hours left for 30 minutes.
  • promtool cases: a healthy leaf at five days fires nothing, and the same leaf at 30 hours fires only the new rule.
  • Docs: rule counts move from 102 to 103, and the blackbox.rules.yaml row mentions the exception.

Why

Enabling the ntfy probe in Gerrrt/HomeLab#715 paged urgent within ten minutes: "🔴 ntfy's certificate has 7 days left", on a leaf Caddy had just issued. Every sensitive-tier leaf comes from step-ca with a seven-day lifetime (ADR-0037), so it is always inside both estate thresholds. The page would have repeated every 4 hours for good.

Caddy renews a seven-day leaf at about a third of its lifetime, around 56 hours left. A healthy leaf therefore never reads below about 2.3 days, and under 36 hours means roughly 20 hours of failed renewals. The rule is critical because the first leaf it watches is ntfy's own. If that lapses, the in-house alert path goes with it, and only urgent's ntfy.sh copy still reaches a phone.

Blast radius

  • prometheus: one rule added and two narrowed. Every existing target lacks renewal, so renewal!="acme" matches them exactly as before.

  • Deploy: git pull --ff-only && make reload on prometheus. The target label is hot-reloaded by file_sd.

  • No change to network segmentation or firewall rules

  • No new port published to a VLAN that could not already reach the service

  • No credential added outside secrets/*.sops.yaml

Verification

  • Rules: make validate passes: promtool check and test on all 11 rule files, plus the new cases.

  • Docs: check_docs.py agrees (103 Prometheus + 18 Loki rules).

  • make validate passes

  • Deployed: needs the pull and reload on prometheus

  • Docs updated

Refs #136

🤖 Generated with Claude Code

…es (#136)

Enabling the ntfy probe (#715) paged `urgent` within ten minutes:
"ntfy's certificate has 7 days left", on a leaf Caddy had just issued.
Every sensitive-tier leaf is seven days from step-ca (ADR-0037), so it is
always inside TlsCertificateExpiryImminent's 7-day threshold and the
30-day one. It would have repeated every 4h indefinitely. The comment in
#712 that said the 30-day warning "should never fire here" was wrong.

- The ntfy target gains `renewal: acme`. Both existing expiry rules
  select renewal!="acme", which is a no-op for every target that lacks
  the label.
- New TlsAcmeRenewalStalled, critical, fires when an ACME leaf has under
  36h left for 30m. Caddy renews at a third of the lifetime, about 56h,
  so this means about 20h of failed renewals. Critical so it reaches
  urgent's ntfy.sh copy: when that leaf lapses the in-house path goes too.
- promtool cases: a healthy leaf at five days fires nothing; the same
  leaf at 30h fires only the new rule.
- Rule counts in the docs move from 102 to 103.

Refs #136

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gerrrt
Gerrrt merged commit 7b54b2c into main Sep 29, 2026
7 checks passed
@Gerrrt
Gerrrt deleted the gerrrt/tier-ca-expiry-rule-136 branch September 29, 2026 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant