Gaming Upload Retention: Private Object Storage with Expiring Download Links
Short answer: Keep gameplay reports and moderation evidence in private object storage, record retention as application data, and issue an expiring download link only after a fresh authorization check. The deciding constr
Short answer: Keep gameplay reports and moderation evidence in private object storage, record retention as application data, and issue an expiring download link only after a fresh authorization check. The deciding constraint is deletion: a signed URL can expire, but it cannot prove that every copy of a player's upload has reached the end of its retention period.
For a gaming service accepting screenshots, chat exports, or anti-cheat evidence, the storage decision should follow that distinction. The object store holds bytes. The application owns tenant and player authorization, retention class, legal or moderation holds, deletion state, and the audit trail.
No public objects.
This architecture decision record chooses a private bucket or equivalent private container, opaque object keys, short-lived download capability, and an asynchronous deletion worker. It does not choose a provider. Region availability, deletion semantics, recovery features, and operational evidence still need to be verified against the contract and documentation for the service under evaluation.
Retention governance starts with an upload ledger
Start with an invariant that is easy to test: knowing an object key is never sufficient to read an object. A download requires an authenticated application request, a current authorization decision for the player or moderator, and a newly issued expiring link. This keeps the game's permission model in one place instead of encoding a durable permission into a URL that can be pasted into chat or retained in browser history.
Keys aren't permissions.
The second invariant is less glamorous and more important: retention is a state machine, not a bucket setting. Each upload needs a stable record containing an opaque object key, tenant or game identifier, owner, content category, creation time, retention deadline, hold status, and deletion status. The database record is the control plane; object metadata may duplicate some fields for operations, but it should not become the only authorization or retention record.
A useful state sequence is active -> deletion_due -> deleting -> deleted. A hold prevents the first transition. A worker claims due records, requests deletion, verifies the resulting state according to the selected store's documented semantics, and only then records completion. Retries must be safe. If the worker stops after deleting bytes but before committing deleted, the next run should reconcile the absence rather than recreate the file.
There is one uncomfortable boundary: a link already issued remains a capability until it expires. Tightening a player's role or scheduling deletion does not necessarily retract that link. Keep its lifetime no longer than the product flow requires, avoid putting it in analytics or support logs, and perform authorization before every issuance. If immediate revocation is a hard requirement, route downloads through an application-controlled authorization layer rather than relying on a direct expiring link.
Capabilities leak.
Retention categories should come from product and policy owners, not from whatever default happens to exist on a bucket. A temporary avatar crop, a player-requested export, and moderation evidence can have different end conditions. I'm not sure a universal duration is defensible without the game's policy, jurisdictional obligations, and appeal workflow; those inputs are what resolve the decision.
How should SaaS object storage protect private user files with presigned download links?
Treat link creation as a privileged backend operation. The client asks for a download using the application's file identifier, never an object key. The backend loads the record in the tenant context, checks the caller's current permission, rejects a deleted or held-back item as appropriate, and asks a storage adapter for a link with a bounded expiry. The response should prevent shared caches from retaining it. Don't generate links in list endpoints: bulk issuance widens exposure and produces capabilities that may never be used.
Use an opaque, non-semantic key such as a generated identifier beneath a game or tenant partition. A key like appeals/alice-cheating-proof.png leaks meaning into logs and makes renames or account merges painful. Original filenames belong in controlled application data and in a carefully encoded download disposition when needed. Content type, size limits, and upload completion should be validated before an item becomes downloadable.
Multipart upload deserves explicit cleanup. AWS documents that uploaded parts continue to incur storage charges until the multipart upload is completed or aborted. Even if another service uses different terminology, the evaluation must answer the same operational question: what happens to an upload that the client abandons halfway through? Track the upload session, set an application deadline, and reconcile expired sessions instead of assuming partial data disappears.
The critical path can stay provider-neutral behind a narrow adapter. This Python example makes policy order visible; Storage is implemented against whichever service passes the evaluation.
from dataclasses import dataclass
from datetime import datetime, timedelta, timezone
from typing import Protocol
@dataclass(frozen=True)
class FileRecord:
file_id: str
tenant_id: str
owner_id: str
object_key: str
state: str
class Storage(Protocol):
def create_download_link(
self, object_key: str, expires_in: timedelta
) -> str: ...
class Files(Protocol):
def get_for_tenant(self, file_id: str, tenant_id: str) -> FileRecord: ...
class Authorizer(Protocol):
def can_download(self, actor_id: str, record: FileRecord) -> bool: ...
def issue_download(
*,
file_id: str,
tenant_id: str,
actor_id: str,
files: Files,
authorizer: Authorizer,
storage: Storage,
now: datetime,
) -> dict[str, str]:
record = files.get_for_tenant(file_id, tenant_id)
if record.state != "active":
raise LookupError("file is unavailable")
if not authorizer.can_download(actor_id, record):
raise PermissionError("download is not allowed")
lifetime = timedelta(minutes=5)
expires_at = now.astimezone(timezone.utc) + lifetime
return {
"url": storage.create_download_link(record.object_key, lifetime),
"expires_at": expires_at.isoformat(),
"cache_control": "no-store",
}
The now argument is injected so expiry behavior can be tested without sleeping. The five-minute value is an example product decision, not a universal recommendation; link lifetime should cover the real download path and no more. Tests should cover cross-tenant identifiers, a role removed moments before issuance, every non-active state, filename encoding in the adapter, and clocks near the expiry boundary.
Architecture comparison: choose where the bytes travel
A feature checklist starts too late. First choose who owns the download authorization and retention transitions, because that determines which storage capabilities are actually required.
| Option | Authorization boundary | Deletion control | Best fit | Main limitation |
|---|---|---|---|---|
| Private objects plus direct expiring links | Application checks once, before issuance | Application record plus store deletion controls | Large downloads where brief capability lifetime is acceptable | Permission changes cannot retract a link already issued |
| Application-proxied downloads | Application can check during each request | Application record plus store deletion controls | Immediate access revocation or response-level policy | Application carries bandwidth, latency, and availability load |
| Application-managed encrypted payloads | Application controls access to decryption material | Object deletion plus key lifecycle | Cases requiring an extra application-owned control boundary | Key operations, recovery, rotation, and incident handling add complexity |
The first option is the default decision here because it keeps bytes off the application data path while preserving a fresh check before link issuance. The catch is explicit: it is not suitable when revocation must take effect during an already authorized transfer or while a previously issued link remains valid. Use the proxy pattern then. The encryption pattern can be justified by a threat model or regulatory control, but it is a poor default when the team cannot operate key recovery and rotation with the same discipline as file retention.
Only after selecting that boundary should a team score services. Require suitable US and EU deployment locations for the game's obligations, documented private-access defaults, bounded link expiry, deletion and recovery semantics, abandoned multipart cleanup, audit evidence, concurrency quotas, object-size limits, and a tested export path. Cost belongs in the scorecard too, but model request classes, retained bytes, incomplete uploads, retrieval, and data movement from a measured workload rather than treating one headline storage rate as the answer.
Compliance labels don't settle the architecture. NIST SP 800-66 Revision 2 is specifically guidance for implementing the HIPAA Security Rule, so it is not a generic gaming requirement. It is still a useful example of why safeguards must be selected from the organization's actual risk analysis and obligations. A game handling health-related data would need qualified legal and security review; a normal screenshot workflow should not borrow a healthcare label as decoration.
Reliability operations for deletion evidence
Design the deletion worker around partial progress. Claim a bounded batch, mark each record as deleting, call the adapter, verify according to documented semantics, and persist completion. Put a ceiling on retries and alert on age, not just error count: one record stuck beyond its deletion deadline matters even if the worker successfully processes thousands of newer files. A reconciliation job should compare application state with storage state using a narrowly scoped inventory mechanism, without turning object listing into the user-facing authorization path.
Logs need identifiers, not secrets. Record the file ID, tenant ID, actor ID, decision, retention class, and state transition. Do not log signed query strings, raw upload content, or original filenames by default. Metrics should expose active bytes by retention class, overdue deletion count and age, abandoned upload sessions, link-issuance denials, and reconciliation mismatches. The audit event for a download should describe the authorization decision and issuance time; it must not preserve the capability itself. Deployment should be boring. Exercise the adapter contract against a non-production bucket or container, then run tenant-isolation and deletion tests in the release pipeline. Roll out worker changes with a small claim size, watch overdue age and reconciliation results, and increase concurrency only after quotas and retry behavior are visible. Backups and recovery settings require special attention because deleting the live object may not mean every recoverable version is gone; the accepted deletion definition must match the selected service's documented lifecycle and the organization's policy.
Test the ugly timing. Schedule deletion while an upload is completing. Remove a moderator's permission just before link issuance. Retry after the bytes are gone but the database still says deleting. Attempt a cross-tenant file ID. Advance the clock beyond expiry. These are more revealing than a happy-path upload demo.
Keep this evidence in the decision record: policy owner, accepted retention classes, hold authority, regional requirement, link lifetime rationale, deletion completion definition, recovery window, adapter contract tests, and the date the provider documentation was reviewed. Vendor behavior and contracts can change; a recorded review date makes that uncertainty actionable.
The rejected security boundary for private uploads
A public object with a random key is rejected for private player uploads because possession of the URL becomes indefinite access, application authorization is bypassed, and retention controls are harder to reason about once URLs spread into chat, tickets, or logs. Randomness reduces guessing; it does not create expiry or a current permission check.
Public delivery still has a valid use case. Use it for intentionally public, immutable game assets whose publication is approved and whose cache behavior is part of the release process. It is the wrong boundary for user documents, moderation evidence, or any upload that promises private access and deletion on a policy deadline.
The decision is therefore conditional, not a product ranking: choose private object storage with application-owned retention and short-lived direct downloads for the ordinary gaming upload path; choose an authorization proxy when immediate revocation outweighs its operational cost. Whichever boundary wins, deletion evidence is part of the feature.
References
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes โ full credit and traffic to the original publisher.