fix(remote): ignore polluted host attributes; audit surfaces them
Some checks failed
ci / build-test (push) Has been cancelled
ci / docker-build (push) Has been cancelled
ci / web (push) Has been cancelled
Desktop App / Build Linux (amd64) (push) Has been cancelled
Desktop App / Attach to Release (push) Has been cancelled

resolveProxmoxHostSlug trusted attributes.host verbatim, so a value polluted
with prose — lxc:teddycloud carried host="hubris (confirmed via pct config…)" —
became a slug that never resolved, leaving its checks 'down' despite a correct
`hosts` edge. Treat an attribute containing whitespace/parens as invalid and
fall back to the canonical hosts edge.

The audit now reports `polluted_attrs` — entities whose routing-critical
attributes carry prose — so this class is visible instead of a silent
resolution failure.
This commit is contained in:
2026-07-29 19:45:12 +02:00
parent fb6b6f9160
commit 6487032461
2 changed files with 16 additions and 0 deletions

View File

@@ -88,6 +88,14 @@ func Report(ctx context.Context, pool *db.Pool) ([]Finding, Summary) {
AND src.state NOT IN ('destroyed','deprecated')
AND tgt.state IN ('destroyed','deprecated')`,
},
{
Finding{Category: "polluted_attrs", Severity: "warning",
Evidence: "routing-critical attributes carrying prose (breaks resolution) — e.g. host='hubris (confirmed via pct…')",
SuggestedRunbook: "knowledge-graph-audit"},
`SELECT slug || ': host=' || (attributes->>'host') FROM entities
WHERE attributes->>'host' IS NOT NULL
AND (attributes->>'host') ~ '[ (]'`,
},
}
findings := make([]Finding, 0, len(specs))