Gate shelly-manager behind Authentik passkey step-up #138

Merged
k.renner merged 1 commits from feat/shelly-manager-authentik-gate into master 2026-07-09 11:44:48 +00:00
1 Commits
Author SHA1 Message Date
k.rennerandClaude Opus 4.8 2efd54ef82 Gate shelly-manager behind Authentik passkey step-up
shelly-manager has no authentication of its own. Anything that can reach
:8080 can rewrite Shelly device config, push scripts, and read the stored
per-device AdminPassword values. Until now the only control on it was
network reachability of shelly-manager.home.renner.uno.

Put it behind Authentik using the same proxy-outpost pattern as the
vscode gate (760e187) and paperless before it:

- New proxy provider + application + dedicated outpost
  (ak-outpost-shelly-manager-gate) in mode: proxy. authorization_flow is
  passkey-stepup-authorization, the same flow vscode-gate uses, so every
  authorize requires a passkey.
- New git-owned "Shelly Managers" group (membership in the blueprint,
  k.renner only) bound to the application as the explicit allowlist.
- shelly-manager Ingress now backends the gate outpost via an ExternalName
  mirror instead of the app Service directly.
- home-assistant CNP gains a scoped ingress rule: only the
  shelly-manager-gate outpost pod may reach :8080. Matching scoped egress
  CNP added in the authentik namespace.

No skip_path_regex, deliberately. The music-assistant gate died on PWA
assets fetched with credentials:'omit' (manifest, service worker), and
paperless/vscode carve those out. shelly-manager ships neither -- wwwroot
is app.css, favicon.png and lib/ only -- so every asset is a same-origin
credentialed fetch. It is a Blazor Web app whose SignalR circuit at
/_blazor upgrades to a websocket carrying the session cookie, which the
proxy outpost forwards.

This also restores the app. It has been returning 504 through Traefik
since 760e187 merged at 01:20 today: `default-deny-ingress` has
endpointSelector {}, so its traefik -> :8080 grant, written for the
code-server sidecar, was namespace-wide and was in fact the only rule
letting Traefik reach shelly-manager, which also listens on 8080. Removing
that grant to gate vscode took shelly-manager's ingress down as collateral.
Gating it properly is the correct fix rather than re-widening the rule --
the app should not have been reachable unauthenticated in the first place.

Verified: kubectl kustomize builds clean for authentik, home-assistant and
network-policies; the rendered Ingress backends ak-outpost-shelly-manager-
gate:9000, the egress CNP is scoped to shelly-manager:8080, and the two
gate ingress rules cannot reach each other's target.

The Authentik proxy flow, the passkey login, and the SignalR circuit
through the outpost all require a browser test after apply.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-09 13:42:51 +02:00