Skip to content

fix: close gitops review findings (auth, secrets, apply safety) - #127

Open
s3lcsum wants to merge 5 commits into
mainfrom
cursor/gitops-review-fixes-4e0b
Open

fix: close gitops review findings (auth, secrets, apply safety)#127
s3lcsum wants to merge 5 commits into
mainfrom
cursor/gitops-review-fixes-4e0b

Conversation

@s3lcsum

@s3lcsum s3lcsum commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Closes the GitOps security review findings and applies them on the Portainer host.

What changed

  • Authentik webhook body mapping (event.action / client_ip), login + authorize event rules
  • n8n firewall workflows: IPv4 validation, no debug/payload echo, stable workflow IDs for in-place import
  • Traefik: OpenCode basicAuth from OPENCODE_HTPASSWD, Authentik forward-auth on n8n UI and *arr/Jellyfin, webhook rate-limit, API not insecure, metrics on localhost
  • Postgres bound to 127.0.0.1:5432
  • Mosquitto: anonymous localhost listener; password on LAN IP and Docker host-gateway (cannot bind 0.0.0.0:1883 with localhost on the same port)
  • Cloudflare tunnel moved block; Vault admin policy scoped; OAuth grants tightened

Live apply (already done)

Stacks recreated on the Portainer host. MQTT, n8n workflows, Authentik forward-auth, and Postgres bind verified.

Notes

  • OpenCode basic-auth password lives in gitignored stacks/traefik/.opencode-basic.pass (bcrypt $ doubled in traefik.env for Compose)
  • Mosquitto password file on the host must be chown 1883:1883 / mode 640
  • HA / Seerr / Calibre-Web stay on native OIDC (no authentik@docker)

Apple added 5 commits August 24, 2026 23:04
Mosquitto cannot bind 0.0.0.0:1883 together with 127.0.0.1:1883.
Keep anonymous localhost for HA/healthcheck and require a password on
the LAN IP and Docker host-gateway. Also gitignore the OpenCode
htpasswd sidecar so rsync --delete cannot wipe the live password file.
n8n 2.x import requires a workflow id; without one it fails the
NOT NULL constraint. Keep the live ids and webhook id so apply
updates the existing workflows instead of creating duplicates.
Bcrypt hashes contain $ which Docker Compose interpolates to empty,
breaking Traefik basicAuth. Document doubling every $ in the env
example and lock that in the security invariants.
The firewall workflows PUT to https://router.dominiksiejak.pl/rest, which
is now behind Authentik. n8n follows the login redirect and Authentik
returns Django CSRF 403 because the request has no Referer. Use the
router LAN IP and allowlist it for n8n SSRF protection.
n8n-gateway was a second tile for the same host (OAuth2 vs Traefik
forward-auth). RouterOS already has RADIUS. ESPHome is no longer
deployed. Remove the extra proxy/dashboard apps and the matching
forward-auth middleware.
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