Files
Pulse/internal/api
rcourtman c273eebf35 Limit the addresses organization admins can connect Pulse to (#4354)
An organization's owner or admin manages that organization's
connections, availability checks and email settings, but is not the
instance operator. Those routes connect from the Pulse server itself, so
on a multi-org or hosted install the destination should not be one of
the server's own addresses.

## Rule

Requests that `RequireOrgAdmin` or `RequireOrgManager` admit without
instance authority now carry a tenant outbound policy. For those
requests:

- Proxmox VE, PBS and PMG nodes (add, update, test, cluster refresh,
endpoint overrides), the connection probe, availability checks, TrueNAS
and vCenter connections, and the email SMTP server are refused with 403
`destination_not_allowed` when the address is loopback, link-local,
unspecified, multicast or a cloud metadata address.
- A host name is refused unless every address it resolves to passes.
- Private networks stay allowed on self-hosted shared-process
organizations and provider client runtimes, where an organization's
systems live on the LAN or behind a VPN. On Pulse Cloud they are refused
as well.
- Availability checks are held to the policy whatever their observation
locations.

The TrueNAS and vCenter clients also stop following redirects to a
different host, matching the same-origin rule the Proxmox clients
already apply. An HTTP to HTTPS upgrade on the same host still follows.

Instance administrators, and therefore every single-tenant install, are
unaffected.

## Tests

- `internal/api/tenant_outbound_policy_test.go`: an organization owner
is refused on every route above and nothing reaches a loopback listener;
the instance administrator still reaches it; the private-network
decision per runtime; the policy is attached only to tenant callers.
- `internal/securityutil/tenant_outbound_test.go`,
`pkg/securityutil/outbound_destination_test.go`,
`pkg/tlsutil/redirect_policy_test.go`.
- Ran the affected `internal/api`, `configapi`, `alerting`, `truenas`,
`vmware`, `securityutil` and `tlsutil` suites.
2026-11-14 00:05:53 +00:00
..
2026-10-11 22:20:25 +01:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-08-31 19:47:01 +01:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-04-26 17:26:16 +01:00
2026-01-22 00:30:15 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-09-01 01:02:17 +01:00

Internal API Package

This directory contains the API server implementation for Pulse.

Important Note About frontend-modern/

The frontend-modern/ subdirectory that appears here is:

  • AUTO-GENERATED during builds
  • NOT the source code - just a build artifact
  • IN .gitignore - never committed
  • REQUIRED BY GO - The embed directive needs it here

Frontend Development Location

👉 Edit frontend files at: ${PULSE_REPOS_DIR}/pulse/frontend-modern/src/

Why This Structure?

Go's //go:embed directive has limitations:

  1. Cannot use ../ paths to access parent directories
  2. Cannot follow symbolic links
  3. Must embed files within the Go module

This is a known Go limitation and our structure works around it.