Files
pulse/internal/api
rcourtman c021e9fc33 Require an instance admin to replace instance credentials; check embedded IPv4 in webhook guard (#3013)
## Check embedded IPv4 destinations in the webhook SSRF guard

The notification webhook client refuses private and special-use
addresses at dial time, but it matched each address exactly as given.
An IPv6 transition address carries an IPv4 destination inside it, so
64:ff9b::a9fe:a9fe looked like a public address while a NAT64 gateway
delivered it to 169.254.169.254. The audit webhook and the shared
restricted client already decode these forms through
pkg/securityutil.EmbeddedIPv4Candidates; the notification guard had its
own range check and did not.

isPrivateIP now also judges every IPv4 destination embedded in NAT64,
6to4, Teredo, IPv4-compatible and ISATAP addresses, so URL validation
and the dial-time guard both refuse them.

Contract-Neutral: Closes an address-decoding gap in the existing webhook
private-address guard; no new configuration or API surface.

## Require an instance admin to replace instance credentials

POST /api/security/regenerate-token and a forced POST
/api/security/quick-setup replace the instance's own credentials: the
whole API token inventory and, for quick setup, the administrator login.
Their session check was ensureAdminSession, which on an org-scoped
request admits anyone who can manage that organization. An organization
owner who named their organization in the request could therefore mint
a full-access default-organization token or set a new administrator
password, and take the instance over.

Session callers of both routes now also need instance administrator
privileges: a session that is not org-scoped and belongs to the
configured administrator or an RBAC admin grant, the rule
RequirePlatformAdmin and the security status capabilities already use.
Token callers keep the instance-wide token check added earlier, and
first-run setup, the bootstrap token and the recovery token are
unchanged.

Contract-Neutral: Narrows two instance-credential routes to the
instance-administrator rule the status capabilities already advertise;
no new API surface.
2026-10-17 02:50:13 +01:00
..
2026-10-11 22:20:25 +01:00
2026-10-11 22:20:25 +01:00
2026-10-11 22:20:25 +01:00
2026-10-11 22:20:25 +01:00
2026-10-11 22:20:25 +01:00
2026-08-31 19:47:01 +01:00
2026-04-26 17:26:16 +01:00
…
2026-10-11 22:20:25 +01: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.