What's the best practice for sharing videos hosted on Amazon S3 using presigned URLs?

0

We're considering using presigned URLs to share videos hosted on Amazon S3. What's the best way to do that while still securely managing the endpoints?

There are two use cases that present a potential security problem for us:

  • If the user is streaming a video, the video starts off with an incomplete byte-range request of 0- to download the whole file. Then, if the user jumps ahead in the video, and the client hasn't yet received the bytes for that part of the file, another request to the same URL with a byte range starting from the part of the video the user has jumped to.
  • If a download is paused halfway through the download natively in the browser and the user resumes the download after the initial request has expired, another byte-range request for the remainder of the content will be made.

To support either of these use cases with a presigned URL, we'd need to keep the signing valid for the duration of the download, which is a concern from a security perspective.

Is there a best practice for handling this?

AWS
Paul_A
질문됨 7년 전1158회 조회
1개 답변
0
수락된 답변

Consider using Amazon CloudFront, which has enhanced singed URL features like custom policies. You can use the custom policies to restrict access to only the source IP address or address range, allowing you to more securely set a longer duration before the signed URL expires.

For more information, see Creating a signed URL using a custom policy in the Amazon CloudFront developer guide.

Note: Creating a signed URL using a custom policy in Amazon CloudFront is also great way to manage formats such as HLS/HDS because you can use wildcard characters.

profile pictureAWS
전문가
답변함 7년 전
profile picture
전문가
검토됨 일 년 전
  • Is there a way to use a custom policy to sign the hls url in CloudFront and only sign the initial cloudfront url and not each individual underlying url in s3?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠