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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
defunty
December 23, 2021
Programming
0
330
プライベートコンテンツのHLS配信 with CloudFront
LT資料(2021/12/23)
defunty
December 23, 2021
Tweet
Share
More Decks by defunty
See All by defunty
SPAでの認証方法に関するマサカリぶん投げ会場はこちらです
defunty
0
1k
CSS Module・CSS in JS抗争の過去と現在
defunty
1
180
アクセシビリティ in 令和
defunty
0
31
Other Decks in Programming
See All in Programming
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
120
CSC307 Lecture 07
javiergs
PRO
1
560
ノイジーネイバー問題を解決する 公平なキューイング
occhi
0
120
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.9k
組織で育むオブザーバビリティ
ryota_hnk
0
190
15年目のiOSアプリを1から作り直す技術
teakun
0
430
朝日新聞のデジタル版を支えるGoバックエンド ー価値ある情報をいち早く確実にお届けするために
junkiishida
1
190
2025年の活動の振り返り
hideg
0
110
Railsの気持ちを考えながらコントローラとビューを整頓する/tidying-rails-controllers-and-views-as-rails-think
moro
4
260
SourceGeneratorのススメ
htkym
0
600
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
1.8k
Best-Practices-for-Cortex-Analyst-and-AI-Agent
ryotaroikeda
1
120
Featured
See All Featured
Music & Morning Musume
bryan
47
7.1k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
450
The Curse of the Amulet
leimatthew05
1
9k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
190
Believing is Seeing
oripsolob
1
65
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
89
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
Design in an AI World
tapps
0
150
Thoughts on Productivity
jonyablonski
75
5.1k
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