Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
プライベートコンテンツのHLS配信 with CloudFront
Search
defunty
December 23, 2021
Programming
0
300
プライベートコンテンツのHLS配信 with CloudFront
LT資料(2021/12/23)
defunty
December 23, 2021
Tweet
Share
More Decks by defunty
See All by defunty
SPAでの認証方法に関するマサカリぶん投げ会場はこちらです
defunty
0
910
CSS Module・CSS in JS抗争の過去と現在
defunty
1
170
アクセシビリティ in 令和
defunty
0
28
Other Decks in Programming
See All in Programming
Inside of Swift Export
giginet
PRO
1
220
SODA - FACT BOOK(JP)
sodainc
1
9k
pnpm に provenance のダウングレード を検出する PR を出してみた
ryo_manba
1
170
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
400
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
610
Leading Effective Engineering Teams in the AI Era
addyosmani
7
670
社会人になっても趣味開発を続けたい! / traPavilion
mazrean
1
110
GC25 Recap: The Code You Reviewed is Not the Code You Built / #newt_gophercon_tour
mazrean
0
130
contribution to astral-sh/uv
shunsock
0
560
Temporal Knowledge Graphで作る! 時間変化するナレッジを扱うAI Agentの世界
po3rin
5
1k
品質ワークショップをやってみた
nealle
0
660
スマホから Youtube Shortsを見られないようにする
lemolatoon
27
34k
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
For a Future-Friendly Web
brad_frost
180
10k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
940
Practical Orchestrator
shlominoach
190
11k
Mobile First: as difficult as doing things right
swwweet
225
10k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
10
900
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.1k
A better future with KSS
kneath
239
18k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
A Tale of Four Properties
chriscoyier
161
23k
Transcript
2021/12/23 プライベートコンテンツのHLS 配信 with CloudFront
本スライドでの「プライベートコンテンツ」の定義 ↓ 個人情報を含む、第三者に公開されるべきではない情報
HLS HTTP Live Streaming. 複数ファイル(インデックスファイル・セグメントファイル)で構成 された規格。 動画ファイルをライブストリーミング用にしたもの。
S3 でシンプルな画像形式のプライベートコン テンツを配信する場合(not HLS ) S3 のパブリックアクセスブロックをON にする EC2 にS3
を制御するポリシーをアタッチする (バックエンド側でのアクセス制御) 署名付きURL の発行 (ブラウザ側でのアクセス制御)
署名付きURL 認証用パラメータのついた有効期限付きのURL 。 S3 の機能で発行できる。 AWS のSDK からも発行可能。 Aws::S3::Object#presigned_url https://docs.aws.amazon.com/sdk-for-
ruby/v3/api/Aws/S3/Object.html#presigned_url-instance_method
署名付きURL -2- 複数ファイルを取り扱うHLS では署名付きURL は適していない。 https://docs.aws.amazon.com/ja_jp/AmazonCloudFront/latest/Develo perGuide/private-content-choosing-signed-urls-cookies.html 次のような場合は、署名付き Cookie を使用します。
・複数の制限されたファイル (HLS 形式の動画のすべてのファイ ルやウェブサイトの購読者の領域にあるすべてのファイルなど) へのアクセスを提供する場合。 “ “
署名付きCookie CloudFront の機能。 S3 にはない。 AWS のSDK からも発行可能。 Aws::CloudFront::CookieSigner#signed_cookie https://docs.aws.amazon.com/sdk-for-
ruby/v3/api/Aws/CloudFront/CookieSigner.html
署名付きCookie -2- signer = Aws::CloudFront::CookieSigner.new( key_pair_id: "cf-keypair-id", private_key_path: "./unit_test_dummy_key" )
cookies = signer.signed_cookie(url, policy: policy.to_json )
CloudFront でプライベートコンテンツをHLS 形式で配信する場合 署名付き Cookie を使用して HLS コンテンツを取得してみた | DevelopersIO
↑ の記事ではルートアカウントでしか取得できない情報を使っている が、ローカルで作成した鍵情報をCloudFront に登録し、利用するのも 可。 [ アップデート] root ユーザー作業が不要に!Amazon CloudFront で署 名付き URL/Cookie 向け公開鍵を IAM ユーザー権限で管理できるよう になりました。 | DevelopersIO
None