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.
goSignals authorization splits into two planes:
stream/event scopes, scoped to a project.The two are independent. Logging in (management plane) never grants event delivery, and a stream’s delivery token cannot administer the server.
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. |
key scope and machine tierskey is a narrow capability sitting between reg and admin, intended for an
unattended deployment that must bootstrap itself without a human:
key-scoped caller may POST /key/<issuer> to mint a new issuer signing
key, but a key takeover (force=replace, force=rotate, or ?rotate) is
rejected for a key-scope-only caller — preventing key substitution / event
forgery. Both rules hold for every ?alg=: a key-scoped caller may create an
RS256, ES256 or ML-DSA-65 key, and may not rotate or replace one.POST /key/<issuer> acts on one signature algorithm, named by ?alg=
(RS256 when absent, ES256, ML-DSA-65; anything else is a 400). A create
adds a key of that algorithm alongside the issuer’s keys of other algorithms,
and is a 409 only when a key of that algorithm that is not revoked exists.
force=rotate adds a new key of that algorithm and leaves the previous one
active; force=replace deletes only that algorithm’s keys before creating the
new one, so a plain force=replace replaces the RS256 keys and leaves ES256
and ML-DSA-65 keys in place. A key load (POST /key/<issuer> with a body)
uploads an RSA key, so its conflict check and force=replace apply to RS256
keys only. A stream never creates a signing key: create the key for the
stream’s iss and signing_alg first.key-scoped caller may GET /iat to obtain an IAT, but the minted IAT is
always reg-only: the key/admin capability does not propagate into it.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.
confirmA 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.
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.
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):
EventAuthToken.StreamIds carries
both SIDs ([txSid, rxSid]), via IssueSstpPairToken. scope=event is
sufficient for data-plane delivery and for status-read / verify; scope=stream
is required for UpdateStatus and config writes.authCtx.Eat check. Scope/stream checks always go through
HasScope / IsAuthorizedForStream, never a direct authCtx.Eat read — the
Eat is nil for OAuth/STS callers, so a bare check would silently deny them.
For a locally issued pair bearer the EAT enforces StreamIds containment; for
an OAuth/STS caller authority is the granted scope set.FindByPairId defense-in-depth at POST /sstp/{id}. The {id} on the
path is the pair’s PairId (the on-wire SSF stream_id), but the bearer is
bound to the internal SIDs, not the PairId. The handler resolves the record
via FindByPairId / GetStreamStateByPairId and authorizes the bearer against
the record’s actual txSid/rxSid for scope=event. A token minted for a
different pair therefore cannot act on this one even if it reaches the right
path.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.
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):
ValidateAuthorizationAny refuses (403) a
stream_id query parameter or path var outside the binding.stream_id: subject add/remove, subject-filter review, verify and
PUT/PATCH /stream refuse (403) a body stream outside the binding, or
other than the stream the request resolved to, so a bound token cannot
resolve one stream and act on another. A pair bearer may name either SID.StreamIds, the any
wildcard, OAuth/STS, bootstrap) are not confined by a binding and keep each
handler’s own rule.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.
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
/iatendpoint is removed.GET /iatnow requires a{key, admin, root}bearer; a missing/invalid bearer is rejected. WithI2SIG_BOOTSTRAP_TOKENunset there is no door at all — the endpoint fails closed.POST /keylikewise 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).
The goSignals CLI authorizes management calls one of two ways, detailed in the
CLI Login Guide:
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.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
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.
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.
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.
| 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) |
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 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.
| 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.
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 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:
Add Subject is treated as a statement of interest, not a directory
lookup. The server records the subject and returns 200 regardless of
whether the subject has ever been seen on the wire (defaultSubjects is
policy, not a delivery guarantee — see PRD #89).404 is feature-disabled (subject filtering is not
enabled server-wide, the endpoints are not advertised in discovery, and the
router refuses to honour them). It is a capability statement, not a
per-subject answer, and so is not a probing oracle.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 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:
I2SIG_SUBJECT_FILTERING), so
deployments that do not want the harvesting surface can disable it
entirely.Active mitigations (rate-limiting Add Subject, anomaly detection on filter growth) are out of scope.
§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.
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.
GET /token. Caller-scoped: the project scope is derived
from the caller’s AuthContext (admin/root see every project; everyone else
is confined to their own project) and is never taken from a
client-supplied query parameter. Supports composable type=IAT|STREAM and
active=true|false filters. Each row is enriched with provenance.last_redemption_ip / last_redemption_at / redemption_count and an
immediate-parent JTI (an IAT is the lineage root; a stream-client token’s
parent is the redeemed IAT; a delivery token’s parent is the issuing
stream-client token). Recording redemption is best-effort — a failed write
logs at WARN and never blocks the operation.POST /introspect (RFC 7662). Reports active, the
RFC 7662 token_type, scopes, and the additive provenance extensions. A
cross-project, unknown, expired, or revoked target reports active:false —
no existence oracle.DELETE /token/{jti} is the admin-by-identifier path (revoke a named token
you can see in the inventory); a non-admin caller acting on another project’s
token gets 403. POST /revoke is the RFC 7009 self-service path where a
token holder presents the token string; per RFC 7009 §2.2 it always
returns HTTP 200 (unknown / already-revoked / expired / unparseable /
cross-project all look identical), so token existence is never leaked.exp, retained for
I2SIG_TOKEN_RETENTION (default 30 days). A revoked-but-unexpired record
stays visible (reporting active:false) until retention lapses, keeping
revocations auditable. Mongo-only; see
configuration_properties.md.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.
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.
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.
root escalation from foreign realmsoidcRolesMatchScopes 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.
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.
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).
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.