Add Postgres-backed query logging to Technitium #70
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Enable DNS query logging in Technitium, backed by our existing in-cluster Postgres
instead of local Sqlite, using Technitium's official "Query Logs (PostgreSQL)" app.
Plan
Provision a dedicated Postgres database + user, reusing the existing
postgresql-backuprole pattern already used by k8s-lanager/k8s-zabbix/k8s-authentik/etc., pointed at
postgresql.database.svc.cluster.local.Needs a new Bitwarden item (or field) for the dedicated app username/password,
following the same convention as
Lanager-Setup's DBUsername/DBPassword fields.Install the app via Technitium's API (verified against the real app store
metadata, not guessed):
(v1.2.1 is the current release, compatible with our Technitium 15.4.0.)
Configure the app:
JSON body:
{"enableLogging": true, "databaseName": "<db>", "connectionString": "Server=postgresql.database.svc.cluster.local; Port=5432; Username=<user>; Password=<pass>;", "maxLogDays": <retention>, "maxLogRecords": <retention>}The app auto-creates its own table/indexes on first save - no manual schema needed.
Open question - needs a decision before implementing
DNS Apps in Technitium are per-node, not synced via clustering (unlike zones/
settings). So this needs installing on the primary and, if we want logs for queries
answered directly by secondaries too (they're in the same LB pool), on each
secondary as well - all pointed at the same shared Postgres database. Decide scope
(primary only vs. primary+secondaries) before building the Ansible tasks.
Retention
Set
maxLogDays/maxLogRecordsto something bounded rather than unlimited (0/0defaults), to avoid unbounded growth in the shared Postgres instance.