Matt
09/10/2025, 10:23 PMMarvin
09/10/2025, 10:23 PMMarvin
09/10/2025, 10:25 PMMatt
09/10/2025, 10:28 PMMarvin
09/10/2025, 10:28 PMMarvin
09/10/2025, 10:30 PMMatt
09/10/2025, 10:36 PMMarvin
09/10/2025, 10:36 PMMarvin
09/10/2025, 10:38 PM# Public read-only route
server {
server_name <http://ui.example.com|ui.example.com>;
# Allow GET/OPTIONS generally
location /api/ {
if ($request_method !~ ^(GET|OPTIONS)$) { return 403; }
proxy_pass <http://prefect-server>;
}
# Explicitly block known trigger endpoints (defense-in-depth)
location ~* ^/api/deployments/.+/create_flow_run$ { return 403; }
location = /api/flow_runs { if ($request_method != GET) { return 403; } }
location ~* ^/api/flow_runs/.+/set_state$ { return 403; }
location / { proxy_pass <http://prefect-server>; }
}
- Keep workers functional:
- Workers need to POST to various endpoints (claim work, update states, send logs, etc.). Give them a separate “private” route that allows POSTs, restricted by IP/VPN:
# Private route for workers/CLI
server {
server_name <http://api.internal.example.com|api.internal.example.com>;
allow 10.0.0.0/8; # your worker CIDR(s)
deny all;
location / { proxy_pass <http://prefect-server>; }
}
- Point your workers/CLI to the private route; point human users to the public read-only route.
- With an auth proxy (optional, nicer UX):
- Put OAuth2 Proxy (or Traefik ForwardAuth) in front of the API.
- Allow GET for everyone.
- Require an authorized group (e.g., “prefect-writers”) for POST to the trigger endpoints above. This keeps the UI working for viewers, while only authorized users can trigger runs.
Caveats
- The UI “Run” buttons will still appear for viewers, but requests will fail with 403 (that’s expected).
- Blocking POST globally will break workers; ensure your workers have an allowed path/host.
- There’s no server-side toggle to disable manual runs per deployment in OSS.
If you can share:
- Which proxy you’re using (NGINX, Traefik, Caddy)?
- Do your workers reach the same URL as humans, or can they use a private hostname/network?
I can tailor exact rules/middleware for your setup.Matt
09/10/2025, 10:41 PMMarvin
09/10/2025, 10:41 PMMarvin
09/10/2025, 10:41 PMssh -L 4200:localhost:4200 user@your-server
# then open <http://localhost:4200> (adjust port if needed)
- Lock down ingress with firewall/security groups (allow only specific IPs).
- Put it on a private network/VPN (WireGuard/Tailscale) and require VPN login.
If you specifically want an HTTP password prompt, you’ll need to place an auth layer in front (e.g., basic auth via NGINX/Caddy/Traefik or a zero-trust service like Cloudflare Access) since Prefect itself doesn’t provide it.
Reference: Security considerations for Prefect deployments
If you share your current hosting setup (port, how users reach it), I can suggest the simplest lock-down route for that environment.Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.
Powered by