Independent architecture study
Checking access before video leaves
Secure Media Delivery at the Edge
A valid playback link can still be copied and abused. This independent architecture study separates fast token checks at the edge from slower abuse investigation and signing-key deployment, keeping remote security lookups outside the video request path.
An independent architecture study based on public AWS guidance. A design exercise, not a client engagement.

- Workload
- Protected premium video manifests and segments
- Constraint
- Check every request without a remote authentication round trip
- Approach
- Local signature validation, asynchronous investigation and controlled key publication
- <1 msEdge authentication overheadDesign target. The study’s token-validation target, not a measured playback improvement or a complete request-latency guarantee.
What makes this difficult
A signature does not prevent sharing
A copied token remains cryptographically valid until it expires, so signature checks need a separate response to suspected sharing and compromised sessions.
The edge cannot query everything
CloudFront Functions cannot call Secrets Manager or DynamoDB over the network, so keys must be published and revocation enforcement needs an explicit mechanism.
Rotation can interrupt paying viewers
Retiring a signing key before legitimate tokens expire can stop active playback, making publication order and the overlap period part of the availability design.
Follow a protected video request
A viewer passes edge controls before receiving content, while investigation and key publication run separately from the playback request.
- 01
Issue a scoped playback token
The application backend retrieves its signing key and issues a playback token after its access checks. Content scope and expiry constrain where and when that token works.
Illustrative example Illustrative example: an authorised viewer receives a token for the requested content.
- 02
Reject unsuitable requests at the edge
WAF applies its configured rules before token validation. The edge function then checks the signature, content scope and time claims using keys already published with it.
Illustrative example Illustrative example: an expired token is rejected before the cache is consulted.
- 03
Allow the content request to continue
A valid token allows the request to reach the cache. Only an eligible cache miss needs an origin fetch, keeping authentication independent of remote key stores.
Illustrative example Illustrative example: an authorised segment request is served from cache.
- 04
Investigate a suspected shared token
An abuse alert reaches the response workflow through EventBridge. The workflow queries collected evidence to identify offending addresses before changing access controls or recording the incident.
Illustrative example Illustrative example: the workflow retrieves evidence for a suspected shared session.
- 05
Block addresses and record the session
The workflow updates WAF with offending addresses and records the revoked session. The registry is an audit record here, because this edge function cannot query DynamoDB.
Illustrative example Illustrative example: listed addresses are blocked and the session is recorded for follow-up.
- 06
Publish keys before changing issuance
The rotation workflow stores a candidate key and publishes overlapping validation keys. Issuance changes only after deployment checks, with the retiring key retained for outstanding valid tokens.
Illustrative example Illustrative example: tokens signed during the transition remain verifiable.
- Request
- Data
- Later, queued
- Control
The hard part
Move keys before requests arrive
Local token validation works because its signing material arrives through deployment, not a request-time lookup. The workflow publishes overlapping keys before the issuer switches, then retires the old key after the required validity window. The supplied write-up leaves log ingestion and distinct-address detection incomplete; those integrations need implementation before automatic abuse response can be claimed.
Why this design
Validate locally at the edge
- Chosen
- Use CloudFront Functions for signature and claim checks with published signing keys.
- Because
- The token check can complete without calling a remote authentication service for every video request.
- Cost
- The restricted runtime makes key publication and any additional revocation mechanism explicit deployment responsibilities.
- Reconsider when
- Use a different validation architecture when every request requires remote session state or more complex business logic.
Keep blocking claims precise
- Chosen
- Use WAF for address blocking and DynamoDB to record session revocation decisions.
- Because
- The supplied function cannot read DynamoDB directly, so recording a session alone does not enforce its revocation at the edge.
- Cost
- An attacker using another address may retain access until expiry unless a supported session enforcement mechanism is added.
- Reconsider when
- Add and test session-level enforcement when address blocking cannot meet the content protection requirement.
Overlap keys during rotation
- Chosen
- Publish validation support before switching the issuer and retain the retiring key for the required token lifetime.
- Because
- Active viewers may still hold legitimate tokens signed before the key change.
- Cost
- The transition temporarily accepts multiple signing keys and requires deployment verification and rollback procedures.
- Reconsider when
- Emergency compromise response may require immediate retirement even when that forces legitimate viewers to obtain new tokens.
Cost and operating assumptions
Per-request validation
Function invocations scale with protected manifest and segment requests, including requests that fail token checks.
Edge protection
WAF request evaluations, configured rules and the web ACL add charges separately from video transfer and caching.
Security evidence
Log transport, ingestion, retention and investigation queries depend on event volume and the detection implementation selected.
Security workflows
Key storage, publication, workflow executions and registry writes contribute according to rotation frequency and incident activity.
Assumptions behind the numbers
The supplied estimates mix request volumes and contain inconsistent arithmetic, so no event total is reused; pricing depends on usage, region and options, including the missing log and detection integrations.
How it stays reliable
Verify the deployed key set
Test tokens against the published function before changing issuance, and retain a rollback path if publication or validation fails.
Keep the origin protected
Restrict direct origin access so a viewer cannot bypass the edge checks by requesting the underlying content endpoint.
Make blocking repeatable
Handle repeated alerts and concurrent WAF updates safely, record outcomes and alert on failed enforcement or unexpected block rates.
Test detection before automation
Implement log delivery and per-session aggregation explicitly, then assess false positives and propagation before treating automatic blocking as operational.
When this is a poor fit. A poor fit when immediate session revocation requires remote state on every request and the team cannot implement a supported enforcement mechanism outside this local validation pattern.