i2goSignals

goSignals

GoSignals Security Model

Shared Signals Framework and GoSignals

The current model is based on the OpenID SSF specification, which enables clients to register to receive events. The client may be given an Initial Access Token (IAT) which permits registration. When successful, the client receives a permanent token used to retrieve events and manage its stream. Of particular note, the SSF endpoints use a common endpoint with no direct stream identifier; instead, the stream identifier is typically encoded in the access token.

Management plane vs data plane

goSignals authorization splits into two planes:

The two are independent. Logging in (management plane) never grants event delivery, and a stream’s delivery token cannot administer the server.

Authorization scopes

The server recognises a small set of scopes (roles claim or OAuth scope claim; root matches everything):

Scope Constant Capability
event ScopeEventDelivery Deliver / receive events on a stream (data plane).
stream ScopeStreamMgmt Manage a stream’s own configuration (data plane / self-service).
reg ScopeRegister Register a client using an IAT. Capped at stream+event — a reg caller cannot self-grant admin.
key ScopeKey Create a new issuer signing key, and obtain a reg-only IAT. Create-only: denied key takeover. No stream/event capability.
admin ScopeStreamAdmin Full project administration (management plane).
root ScopeRoot Superset; matches every scope check.

The key scope and machine tiers

key is a narrow capability sitting between reg and admin, intended for an unattended deployment that must bootstrap itself without a human:

This is the machine tier ladder: a bootstrap identity (key) seeds an issuer key and a reg IAT; the reg IAT registers a client that caps at stream+event; admin clients are provisioned out of band, not through the registration door.

Stranding signing transmitters: confirm

A key change that an admin/root caller is allowed to make can still leave signing transmitters with nothing to sign with. A suspend (POST /key/<issuer>/status with "status": "suspended", with or without a kid) or a replace (POST /key/<issuer>?force=replace, as a create or as a key load) is checked against the issuer’s keys as they would be after the change. When a signing transmitter (any push, poll or SSTP pair transmitter not in Forward mode) whose iss is the issuer and whose status is not disabled would lose the only active key for its signing_alg (RS256 when empty), the request is refused with 409 Conflict and nothing changes. The body is JSON:

{"error": "suspending key https://issuer.example would leave no active signing key for RS256, ...",
 "streams": [{"stream_id": "...", "description": "...", "signing_alg": "RS256"}]}

Resending the same request with ?confirm=true (e.g. ?force=replace&confirm=true) makes the change; any other confirm value counts as absent. The streams then pause and disable at runtime until a key is configured. An algorithm that has no active key before the change is not counted: the stream checks already report those streams.

A revoke, a reactivate ("status": "active"), a rotate (force=rotate or ?rotate) and a create that deletes nothing are never refused. A revoke is the response to a leaked key and never waits on a confirmation; the normal way to retire a key is to rotate first, so the old key’s streams are covered before it is suspended or revoked.

Foreign-server provisioning (endpoint → scope)

Provisioning a foreign SSF transmitter is a privileged, management-plane operation and requires admin (root rides free). See ADR 0009.

Endpoint Required scope
POST/GET/PUT/DELETE /server, GET /server (list) admin (root free) — reg/stream are rejected.
POST /stream without tx_alias stream (base reg/stream/admin gate) — the SCIM-receiver / unattended-IAT-bootstrap local-only path, unchanged.
POST /stream with tx_alias admin (root free) — resolves a stored foreign-server credential and provisions a stream remotely.

The /server endpoints stay distinct from /stream (they are not folded into stream creation) so a foreign transmitter’s credential keeps an independent lifecycle, which goSignalsAdmin’s console depends on.

SSTP pair authorization

An SSTP pair is one bidirectional relationship with two internal stream IDs per node — txSid (outbound) and rxSid (inbound). Its authorization model differs from a single-direction push/poll stream in three ways (PRD #154 Q9.1, Q19, Q38, Q42):

OAuth supersedes the static pair-bearer (migration path). When the peer’s stored Server alias carries an OAuth Client Config, that OAuth credential is intended to supersede the static per-pair bearer on the outbound (client) side — giving operators a migration path off static bearers without an SSTP-specific code change. The enforcement stance — actively rejecting a static bearer once OAuth is configured — is deferred to the bearer-rotation work in GH #152 (Q38); today the static SstpMethod.AuthorizationHeader is used when present.

Which stream a request acts on

Governing rule: a stream-bound token operates only on its bound streams. A local token with non-empty StreamIds may act only on those streams, however the stream is named (#303):

AuthContext.StreamId is the stream the request names: the stream_id query parameter, then the path var. For backwards compatibility, when the request names none, a local token binding exactly one stream supplies it, so a stream requestor can, for example, check a transmitter’s status without repeating its SID. The fallback yields only the token’s own stream, so it never widens authorization; a pair bearer (two SIDs), the any wildcard and unbound callers get no fallback. With no parameter, a single-stream token now resolves where it used to get 403 at GET/POST /status, GET /stream (including rotate-on-GET) and DELETE /stream, and 400 at admin GET /state. Poll (/poll/{id}) and push (/events/{id}) always name the stream on the path.

The bootstrap secret

I2SIG_BOOTSTRAP_TOKEN is a shared secret. On the server, a bearer that constant-time-equals the configured value is synthesized into a key-scope context before any JWT validation runs. When the variable is unset, the bootstrap path is closed and no bootstrap bearer is ever accepted (fail closed). The bootstrap secret is an app-layer authorization mechanism: it is orthogonal to transport-layer identity (TLS / SPIFFE mTLS) and coexists with it.

[!IMPORTANT] The anonymous /iat endpoint is removed. GET /iat now requires a {key, admin, root} bearer; a missing/invalid bearer is rejected. With I2SIG_BOOTSTRAP_TOKEN unset there is no door at all — the endpoint fails closed. POST /key likewise requires {key, admin, root}.

The advertised public client for the interactive CLI login is named by I2SIG_CLI_CLIENT_ID (default gosignals-cli) in the server’s RFC 9728 Protected Resource Metadata, which also advertises the supported scopes (including key).

GoSignals Command Line

The goSignals CLI authorizes management calls one of two ways, detailed in the CLI Login Guide:

  1. Delegated OAuth login — add server <alias> connects to a server (connect-only, no credential minted) and caches its advertised OAuth authorization servers; login <alias> then runs a browser PKCE (or device-code) flow and stores a per-realm session in credentials.json. Subsequent management calls present that session’s access token, silently refreshing it as needed.
  2. Non-interactive bootstrap — for CI/automation, I2SIG_BOOTSTRAP_TOKEN (or a configured --token/--client-secret/--iat) authorizes create key / create iat directly.
goSignals> add server gs1 https://goSignals1:8888
goSignals> login gs1

Docker Compose Set Up

In the demo scenario, there are 2 SCIM servers configured to run as replicas with synchronization carried out via goSignals. Both SCIM servers in the cluster use goSignals1:8888 as the common events server, so an event issued by one is received by the replica for synchronization.

The SCIM servers need an issuer key and an IAT to auto-register. The scimSsfSetup service runs the goSignals CLI unattended using the bootstrap secret (I2SIG_BOOTSTRAP_TOKEN, injected by compose). The key-scope secret authorizes create key + create iat without any anonymous endpoint (config/scim/scripts/auto-reg.gosignals):

add server gosignals1 https://goSignals1:8888
add server gosignals2 https://goSignals2:8889
create iat gosignals1 --output=/scim/iat-gosignals1.jwt
create bundle --output=/scim/spire-bundle.pem
create key gosignals1 cluster.scim.example.com --alg=RS256 --file=/scim/cluster-scim-issuer.pem
exit

When complete, the setup script distributes the minted issuer key and IAT to the scim_cluster1 / scim_cluster2 data directories; on startup those services auto-register with goSignals1. The six compose variants (base / dev / cluster / cluster-dev / spiffe / spiffe-dev) all wire the bootstrap secret the same way; see the CLI Login Guide for the full matrix.

Limitations

The current goSignals command line only knows about streams that is has configured to facilitate a demo. At present the show server command only shows the locally known information and streams. For example, you might choose to create a push receiver on goSignals2 and a push publisher on goSignals1 using the create push connection command. If you specify the same audience as the SCIM cluster, you will find that goSignals1 starts automatically forwarding events to goSignals2. You can monitor the events by creating a poll publisher on goSignals2 and then using the poll command to display incoming events to the command line utility.

SPIFFE/SPIRE Mutual TLS

As part of a defense-in-depth strategy, i2goSignals supports SPIFFE (Secure Production Identity Framework for Everyone) for cryptographic workload identity, implemented via SPIRE and the go-spiffe library. SPIFFE augments the existing HMAC and OAuth2 mechanisms; deployments without SPIRE continue to operate unchanged.

What SPIFFE Replaces

Concern Without SPIFFE With SPIFFE
Inter-cluster wake-up calls HMAC shared secret (I2SIG_CLUSTER_INTERNAL_TOKEN) X.509-SVID mutual TLS; HMAC retained as fallback
SSF stream management (outbound) OAuth2 CC or static token SPIFFE mTLS (if SpiffeConfig set on server record)
MongoDB connections Username/password X.509-SVID client certificate (opt-in via I2SIG_SPIFFE_MONGO_ENABLED)

How It Works

Each node requests its SVID (a short-lived X.509 certificate with a SPIFFE URI SAN) from the local SPIRE agent via the Workload API. The go-spiffe library watches for rotations automatically; no restarts are required when SVIDs expire.

Inter-cluster communication (WakeTransmitter): When SPIFFE_ENDPOINT_SOCKET is set, the event router builds an mTLS HTTP transport for outbound wake-up calls using the node’s SVID. The receiving WakeTransmitter handler checks whether the TLS connection carries a peer certificate. If the certificate is a valid SVID belonging to the cluster trust domain (I2SIG_SPIFFE_TRUST_DOMAIN), the request is accepted without an HMAC token. If no certificate is presented, the existing HMAC path is used. This allows a phased rollout.

SSF stream management (oauthClient): Setting SpiffeConfig on a Server database record causes GetClientForServer() to build a SPIFFE mTLS client. The remote server’s SPIFFE ID or trust domain is used to authorize the peer. If the SPIRE agent is unavailable, the function falls through to OAuth2 or static token auth.

MongoDB mTLS: When I2SIG_SPIFFE_MONGO_ENABLED=true and SPIFFE_ENDPOINT_SOCKET is set, the MongoDB driver is configured to use the node’s SVID as the client certificate. MongoDB must be configured with the SPIRE CA bundle as the trusted root. Falls back to password auth if SPIRE is unavailable.

SPIRE Federation

SPIRE federation extends the trust model across organizational boundaries, enabling SPIFFE mTLS for SSF streams that cross domain boundaries. See docs/spiffe_support_plan.md and config/spire/registration/register.sh for setup instructions.

Environment Variables

Variable Default Description
SPIFFE_ENDPOINT_SOCKET (unset) SPIRE agent socket path. Enables all SPIFFE features.
I2SIG_SPIFFE_TRUST_DOMAIN cluster.i2gosignals.internal Trust domain for cluster peer verification.
I2SIG_SPIFFE_MONGO_ENABLED false Enable SPIFFE mTLS for MongoDB.

See docs/configuration_properties.md for full details.

SSF §9 Subject Filtering Security Posture

The OpenID Shared Signals Framework §9 raises three security concerns about the subject-filtering endpoints. goSignals’ posture is summarised below; the removal-grace mitigation that addresses §9.3 is implemented by the PRD #97 work and is described in CONTEXT.md (“Removal grace period”), with the env var and per-stream override in configuration_properties.md and the storage shape in adr/0003-split-subject-filter-storage.md.

§9.1 Subject Probing

§9.1 warns that a receiver can use Add Subject as an oracle to test whether a subject is known to the transmitter — a 404 subject not found response is the attacker’s signal. goSignals offers no such oracle:

§9.1 on the Relay Path

When a downstream receiver Adds or Removes a subject on a PASSTHRU or HYBRID stream, goSignals relays the change to the upstream transmitter. That upstream may have its own §9.1 mitigation and may answer 404 (or any other 4xx/5xx). goSignals logs the upstream response at WARN and returns success to the downstream receiver — surfacing the upstream status verbatim would re-create the §9.1 oracle goSignals itself does not expose. The local filter write (for HYBRID) and the receiver’s expression of interest are authoritative; the upstream subscription is best-effort. The receiver’s request is never failed by an upstream’s §9.1 posture.

§9.2 Information Harvesting

§9.2 warns that an attacker who has compromised a receiver can harvest events by registering subjects of interest and waiting for delivery. goSignals does not solve this — it is a property of the receiver’s authorization model — but its design contains the blast radius:

Active mitigations (rate-limiting Add Subject, anomaly detection on filter growth) are out of scope.

§9.3 Malicious Subject Removal

§9.3 — instant blinding by a malicious or coerced subject removal — is addressed by the removal-grace mechanism described in CONTEXT.md (“Removal grace period”). A removal stamps the affected filter entry with enforceAt = now + grace; delivery continues for the grace window so a hostile removal cannot blind a receiver instantly. The grace defaults to zero (no behaviour change unless the operator opts in); the I2SIG_SUBJECT_REMOVAL_GRACE server-wide default and per-stream override are documented in configuration_properties.md, and the storage shape (sparse enforce_at index, lazy-purge lifecycle) is in adr/0003-split-subject-filter-storage.md.

Token administration

The server tracks the management-plane tokens it issues (IATs and stream/client tokens) so an operator can inventory, introspect, and revoke them. The CLI surface is documented in gosignals_tool.md; the durable decisions are recorded in ADR 0007 and ADR 0008.

Inbound bearer-token validation (OAuth audience + algorithm allow-list)

goSignals accepts two kinds of bearer token on its management and SSF endpoints: locally issued tokens minted by this cluster (project IATs, ADMIN tokens — HMAC-signed against the cluster’s own key) and external OIDC tokens issued by a third-party IdP and validated against the discovery URLs in I2SIG_AUTH_OAUTH_SERVERS. The hardening below (issue #144) applies to the external path only — validateOAuthToken in internal/authUtil/auth_token.go. Locally issued tokens are unaffected.

External tokens are subject to three controls.

1. Audience enforcement

When I2SIG_AUTH_OAUTH_AUDIENCE is set, an external token whose aud claim does not contain that value is rejected (jwt.WithAudience). This stops a token minted for some other relying party in the same IdP from being replayed against goSignals (the token-substitution / confused-deputy case).

When the variable is unset, audience is not checked and a one-time WARN is logged:

OAuth audience validation is DISABLED (I2SIG_AUTH_OAUTH_AUDIENCE unset);
external OIDC tokens are accepted without an aud check

This fail-open-with-warning default preserves existing deployments that configured I2SIG_AUTH_OAUTH_SERVERS without an audience. Operators running external OIDC in production should set I2SIG_AUTH_OAUTH_AUDIENCE to the value their IdP stamps for goSignals; leaving it unset is a known-weaker posture, not a supported steady state.

2. Signing-algorithm allow-list (algorithm-confusion defense)

External OIDC tokens are restricted to asymmetric signing algorithms — RS256/384/512, PS256/384/512, ES256/384/512 — and symmetric HMAC (HS*) is rejected (jwt.WithValidMethods). The security property is excluding HS*, which closes the classic JWT algorithm-confusion attack (an attacker re-signing a token with HS256 using the IdP’s public key as the HMAC secret). Allowing the full asymmetric set, rather than pinning a single variant, avoids breaking legitimate non-Keycloak IdPs that sign with ECDSA or RSA-PSS.

This is defense-in-depth: the JWKS keyfunc already rejects HS256 (it returns an *rsa.PublicKey, so HMAC verification fails on key type), but WithValidMethods rejects the algorithm before the keyfunc runs and so closes the gap even for a JWKS that omits the alg parameter.

3. No bare-root escalation from foreign realms

oidcRolesMatchScopes requires an external token’s realm role to match the specific accepted scope name. A foreign-realm role literally named root (authSupport.ScopeRoot) no longer confers cluster-wide privilege — a third-party-administered IdP must not be able to escalate into goSignals simply by defining a role with a privileged-sounding name. The root super-power remains intentional and unchanged for goSignals’ own locally issued tokens (EventAuthToken.IsScopeMatch).

The environment variables are catalogued in configuration_properties.md; the decision record is ADR 0012.

SET signature verification (algorithm allow-list)

goSet.Parse is the only verify-and-accept path for inbound SETs (goSet.Peek is the explicitly unverified counterpart — see ADR-0066 §D3). Parse restricts the accepted alg to goSet.AllowedAlgs(), currently RS256, ES256 and ML-DSA-65, via jwt.WithValidMethods.

The property is the same one §2 above buys for bearer tokens, and for the same reason: the allow-list is checked before the JWKS is consulted, so a SET carrying alg: none, or one HMAC-signed with the issuer’s public RSA modulus, is refused without any key handling at all. AllowedAlgs is the single place a new SET signature algorithm becomes acceptable.

Peek is deliberately unaffected. Push receivers read iss/aud from an unverified token so a wrong-issuer SET returns invalid_issuer rather than a generic error from a JWKS miss; its result is never an accepted token.

Transport security floor

Every tls.Config the project builds states MinVersion: tls.VersionTLS12 explicitly. Left unset, crypto/tls permits TLS 1.0 on the server side, and the omission is invisible at the call site — so a source-scan guard test in pkg/tlsSupport fails the build when a new tls.Config literal omits it.

Key exchange is post-quantum by default. Go has negotiated the X25519MLKEM768 hybrid since 1.24, and goSignals gets it by not constraining CurvePreferences — an invariant held by omission, which is exactly the kind a well-meaning “let’s pin the curve list” change breaks silently. CurvePreferences is therefore written in exactly one place, tlsSupport.Harden, which every TLS config in pkg/tlsSupport and pkg/oauthClient routes through; the guard test enforces both halves. I2SIG_TLS_PQ_KEM=MLKEM1024 widens the offered set to include standalone ML-KEM-1024 (see configuration_properties.md).

Admin UI Issues

The current command line stores local state and tokens in a local configuration file. The use of tokens for stream management is influenced by the SSF specification itself. When building the admin UI, we need to implement more traditional access control and API design so we can do things like list all streams.


(C)2026 Independent Identity Inc.