Files
felhom.eu/documentation/audits/end-dates-list-2026-11-11/tools/guest-dates.sh
T
admin 978666dde3
gates / gates (push) Successful in 2m2s
lists: the Clock list (70 jobs) and the End-dates list (39 things), 9 register rows, 4 decisions
Read-only review of every job on a timer and of everything that ends on a date,
with measurements from the three test boxes. Nothing ends in the next 14 days.
Register 236 -> 245 (R-1379..R-1387), pointer lines on twelve rows, D76-D79 in
STATUS.md. Part C: felhom-agent's clone address holds no token now; the other
clones wait for the operator's yes. R-1035's 4-week check moved to 2026-11-18
(operator read needed).

Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
2026-11-11 11:54:42 +01:00

31 lines
4.0 KiB
Bash

#!/bin/bash
# End-dates list 2026-11-11 — guest 9201. READ-ONLY. Prints for a certificate only subject, issuer, dates, fingerprint.
# It never prints a key or a token value. acme.json holds private keys: only its certificate fields are decoded.
set -u
h() { echo; echo "=== $* ==="; }
U() { sed -E 's#(https?://)[^/@ ]+@#\1***@#g'; }
cert() { openssl x509 -noout -subject -issuer -startdate -enddate -fingerprint -sha256 2>/dev/null | tr '\n' ' '; echo; }
h "now"; date -u +%FT%TZ
h "layout"; ls /opt/docker 2>/dev/null | tr '\n' ' '; echo; ls /opt/docker/stacks 2>/dev/null | tr '\n' ' '; echo; docker volume ls --format '{{.Name}}' | /usr/bin/grep -i -E 'felhom|traefik|cloudflare|controller' | tr '\n' ' '; echo
h "certificate files (system paths and infra stacks only)"; for f in $( { /usr/bin/grep -rlIs 'BEGIN CERTIFICATE' /etc/felhom* /etc/docker /usr/local/share/ca-certificates /etc/ssl/private 2>/dev/null; find /opt/docker -maxdepth 4 \( -name '*.pem' -o -name '*.crt' -o -name '*.cert' \) -size -200k 2>/dev/null; for v in $(docker volume ls --format '{{.Name}}' | /usr/bin/grep -i -E 'felhom|traefik|controller'); do find /var/lib/docker/volumes/$v/_data -maxdepth 3 \( -name '*.pem' -o -name '*.crt' -o -name '*.cert' \) -size -200k 2>/dev/null; done; } | sort -u); do /usr/bin/grep -qs 'BEGIN CERTIFICATE' "$f" || continue; printf '%s [mtime=%s] ' "$f" "$(date -u -r "$f" +%F)"; cert < "$f"; done
h "acme stores (certificate fields only)"; for f in $(find /opt/docker /var/lib/docker/volumes -maxdepth 5 -name 'acme*.json' 2>/dev/null); do echo "--- $f mtime=$(date -u -r "$f" +%FT%TZ)"; python3 - "$f" <<'P'
import json,sys,base64,subprocess
try: d=json.load(open(sys.argv[1]))
except Exception as e: print("unreadable:", type(e).__name__); sys.exit(0)
for res,v in (d.items() if isinstance(d,dict) else []):
for c in (v or {}).get("Certificates") or []:
pem=base64.b64decode(c.get("certificate",""))
o=subprocess.run(["openssl","x509","-noout","-subject","-issuer","-startdate","-enddate","-fingerprint","-sha256"],input=pem,capture_output=True)
print(res, (c.get("domain") or {}).get("main"), "|", o.stdout.decode().replace("\n"," "))
P
done
h "served certificates (TLS handshake to own listeners)"; ss -H -tln | awk '{print $4}' | sort -u | while read a; do p=${a##*:}; ip=${a%:*}; ip=${ip#[}; ip=${ip%]}; case "$ip" in '*'|'0.0.0.0'|'::') ip=127.0.0.1;; esac; out=$(echo | timeout 4 openssl s_client -connect "$ip:$p" 2>/dev/null | cert); [ -n "${out// /}" ] && echo "$a -> $out" || echo "$a -> no TLS"; done
h "os"; . /etc/os-release; echo "$PRETTY_NAME / $VERSION_CODENAME"; cat /etc/debian_version
h "docker"; docker version --format 'client={{.Client.Version}} server={{.Server.Version}}' 2>&1; dpkg -l docker-ce containerd.io docker-compose-plugin 2>/dev/null | awk '/^ii/{print $2,$3}'; cat /etc/felhom-controller-image 2>/dev/null
h "restic and tools inside the controller"; docker exec felhom-controller restic version 2>&1 | head -1; docker exec felhom-controller sh -c 'cat /etc/os-release | head -3; command -v rclone age docker 2>/dev/null' 2>&1 | head -8
h "images: repo tag digest created"; docker images --digests --format '{{.Repository}}:{{.Tag}} {{.Digest}} {{.CreatedAt}}' | cut -c1-200 | sort
h "apt sources"; for f in /etc/apt/sources.list /etc/apt/sources.list.d/*; do [ -f "$f" ] && { echo "--- $f"; /usr/bin/grep -v -E '^\s*(#|$)' "$f" | U; }; done
h "apt keyring files"; ls -l --time-style=long-iso /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d/ /etc/apt/keyrings/ /usr/share/keyrings/ 2>/dev/null | awk '{print $5,$6,$8}'
h "apt release files: Valid-Until"; for f in /var/lib/apt/lists/*Release; do [ -f "$f" ] && printf '%s | Date: %s | Valid-Until: %s\n' "$(basename "$f")" "$(/usr/bin/grep -m1 '^Date:' "$f" | cut -c7-)" "$(/usr/bin/grep -m1 '^Valid-Until:' "$f" | cut -c14-)"; done
h "controller data folder (top level: names and dates only)"; for v in $(docker volume ls --format '{{.Name}}' | /usr/bin/grep -i -E 'controller'); do echo "--- $v"; ls -l --time-style=long-iso /var/lib/docker/volumes/$v/_data 2>/dev/null | awk '{print $1,$5,$6,$7,$8}' | head -60; done