-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Description
Problem Statement
Currently, the S3 signed URL expiration time is hardcoded to 3600 seconds (1 hour) in the S3Storage class. This creates security and operational challenges for different deployment scenarios where administrators need more granular control over asset access duration.
✅ IMPLEMENTED - This feature has been completed and is available in #8136
Proposed Solution
Add a SIGNED_URL_EXPIRATION environment variable that allows administrators to configure the signed URL expiration time without modifying code.
Technical Implementation
Configuration:
# .env or environment variables
SIGNED_URL_EXPIRATION=30 # 30 seconds for high-security deployments
# SIGNED_URL_EXPIRATION=300 # 5 minutes for balanced security
# SIGNED_URL_EXPIRATION=3600 # 1 hour (default) for convenienceBehavior:
- Default value:
3600seconds (1 hour) - maintains backward compatibility - Applies to both
generate_presigned_post()andgenerate_presigned_url()methods - Can be overridden per-request using explicit
expirationparameter - Value is read at
S3Storageinitialization
Benefits
- Security: Reduces the attack window for intercepted or leaked URLs
- Flexibility: Accommodates different security postures without code changes
- Compliance: Helps meet regulatory requirements for time-based access controls
- Backward Compatible: Existing deployments continue working with 1-hour default
- Operationally Simple: Single environment variable, no complex configuration
- Override Capability: Application code can still specify custom expiration per-request
Migration Path
No migration would be required - this is a backward-compatible enhancement:
- Existing deployments without
SIGNED_URL_EXPIRATIONcontinue using 1-hour default - New deployments can set the variable during initial configuration
- Existing deployments can add the variable at any time without disruption
Metadata
Metadata
Assignees
Labels
No labels