Skip to main content

Security overview

nanocosmos secures your streams in layers: encryption on every connection, authorisation for who may publish and who may watch, and tools to detect and stop misuse while a stream is live. This page shows the layers and where to set each one up.

Three pillars: prevent, detect, respond​

PillarWhat it doesFeatures
PreventOnly authorised encoders publish and only authorised viewers watchEncrypted transport, playback tokens, ingest webhooks, Guardian allow lists, roles
DetectSpot token sharing, restreaming and unauthorised embeddingGuardian and Token Guardian views in nanoStream Analytics
RespondCut off misuse immediatelyToken revocation, Guardian IP and referrer blocking

Each layer reinforces the others. Tokens stop casual link sharing; Guardian and revocation handle the attacker who gets hold of a valid token.

Prevention layer: role-based access control, secure ingest with webhooks, secure playback with tokens, secure transport (TLS), referrer allow-listing
Prevent: who may publish and who may watch.
Detection layer: analytics, Guardian, token usage analysis, pattern recognition, behavioural analysis
Detect: spot shared tokens, restreams and unknown embeds in nanoStream Analytics.
Response layer: referrer blocking, IP blocking, CIDR blocking, ASN/network blocking, token revocation
Respond: cut off misuse while the stream is live.

Encryption​

  • Playback: the nanoStream Player and the nanoStream Webcaster always connect over HTTPS/TLS. MOQ runs over QUIC, which is encrypted by design.
  • Ingest: use encrypted ingest for anything public or in production.
Ingest protocolExample endpointEncrypted
RTMPrtmp://bintu-stream.nanocosmos.de:1935/live/<STREAM_NAME>No
RTMPSrtmps://bintu-stream.nanocosmos.de:1937/live/<STREAM_NAME>Yes
SRTsrt://bintu-srt.nanocosmos.de:5000?streamid=push:<STREAM_NAME>&...Yes

See Ingest security for details.

Protect playback​

Secure playback with tokens​

With secure playback enabled for your organisation, every stream needs a valid playback token: a signed JSON Web Token (JWT) that you create on your server and hand to the player. A token can restrict playback to:

  • specific streams, a stream group, or the whole organisation
  • a time window (nbf, exp)
  • a website domain
  • up to 10 viewer IP addresses or CIDR ranges

Tokens can also carry a user ID and a tag for traceability, end active sessions on expiry (forceDisconnect), and be made revocable.

Secure playback is set for your organisation or for single streams and isn't active by default. To check, open https://dashboard.nanostream.cloud/organisation and look for Secure under Enabled Packages. If it shows Upgrade needed, contact us.

warning

Once secure playback is on, no stream in the organisation plays without a token. Test in a separate organisation so you don't affect production.

Start here: Playback tokens (JWT).

Guardian​

nanoStream Guardian is a real-time protection layer for your organisation. It blocks viewer IPs and IP ranges, blocks or allows referrer domains, and works from nanoStream Analytics or through its API. Use it alongside tokens: tokens decide who gets in, Guardian removes who shouldn't be there. See nanoStream Guardian.

Protect ingest​

Ingest and playback use separate mechanisms. Playback tokens and Guardian playback rules don't affect who can publish.

  • Webhooks: nanocosmos calls your backend when an encoder starts publishing (on_publish), at intervals while it publishes (on_publish_update), and when it stops (on_publish_done). Your backend allows or rejects the stream. This is the recommended way to authorise publishing. See Webhooks.
  • Stream names are credentials. Treat each ingest stream name like a password.
  • IP restrictions for ingest are available as a service; see Ingest security.

Protect your account and APIs​

The nanoStream Dashboard and the nanoStream REST API (also called the bintu API; hostnames and headers keep the bintu name) use role-based access control:

RoleAccessWhat the role can do
nanoAdminHighestEverything in the organisation, including user management and the API key. Only role with access to the API key.
nanoUserHighAll stream management and operations, except changes that could disrupt operations, such as deleting or stopping streams or changing critical settings. Can create playback tokens.
nanoReadOnlyLowRead-only access to stream configuration, states, metrics and alerts. Can't create playback tokens.

For API calls, prefer an expiring bintu token (X-BINTU-TOKEN) over the permanent organisation API key (X-BINTU-APIKEY), and keep both on your server. See Organisation, users & roles.

How restreaming attacks work​

The most common attack on live streams is a relay ("man in the middle"):

nanocosmos → relay server → attacker's CDN → unauthorised viewers
  1. The attacker gets a valid playback URL and token, from a legitimate session in your web app or by abusing your token backend.
  2. A relay server connects to nanocosmos with the stolen token.
  3. The relay redistributes the stream to the attacker's own site.

What this means for your setup:

  • A token without IP restriction and with a long lifetime plays from anywhere for its whole lifetime.
  • Domain (referrer) restrictions can be spoofed by a relay server.
  • IP restrictions can't be spoofed. They are the strongest per-viewer protection.

Typical signs of misuse: one token used from many IPs, traffic from cloud providers instead of residential ISPs, unknown or missing referrers, one token active in several countries, more than 2 concurrent sessions for a user-bound token, and unusually long playback durations. The best practices page shows how to find and stop these.

Next steps​

tip

Try it in the Builder Hub: with an account, create a playback token for your own stream; as a guest, watch a token being revoked and the player disconnect on our demo stream. See the Builder Hub guide. Start for Free