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
280
プライベートコンテンツのHLS配信 with CloudFront
LT資料(2021/12/23)
defunty
December 23, 2021
Tweet
Share
More Decks by defunty
See All by defunty
SPAでの認証方法に関するマサカリぶん投げ会場はこちらです
defunty
0
870
CSS Module・CSS in JS抗争の過去と現在
defunty
1
160
アクセシビリティ in 令和
defunty
0
28
Other Decks in Programming
See All in Programming
MCPで実現するAIエージェント駆動のNext.jsアプリデバッグ手法
nyatinte
7
1k
250830 IaCの選定~AWS SAMのLambdaをECSに乗り換えたときの備忘録~
east_takumi
0
370
More Approvers for Greater OSS and Japan Community
tkikuc
1
110
AIを活用し、今後に備えるための技術知識 / Basic Knowledge to Utilize AI
kishida
20
4.9k
MLH State of the League: 2026 Season
theycallmeswift
0
220
意外と簡単!?フロントエンドでパスキー認証を実現する WebAuthn
teamlab
PRO
0
100
Jakarta EE Core Profile and Helidon - Speed, Simplicity, and AI Integration
ivargrimstad
0
330
Rancher と Terraform
fufuhu
2
200
プロポーザル駆動学習 / Proposal-Driven Learning
mackey0225
2
710
Oracle Database Technology Night 92 Database Connection control FAN-AC
oracle4engineer
PRO
1
390
Microsoft Orleans, Daprのアクターモデルを使い効率的に開発、デプロイを行うためのSekibanの試行錯誤 / Sekiban: Exploring Efficient Development and Deployment with Microsoft Orleans and Dapr Actor Models
tomohisa
0
230
テストカバレッジ100%を10年続けて得られた学びと品質
mottyzzz
2
460
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.8k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
13k
Rails Girls Zürich Keynote
gr2m
95
14k
Visualization
eitanlees
148
16k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
A designer walks into a library…
pauljervisheath
207
24k
Writing Fast Ruby
sferik
628
62k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
The Pragmatic Product Professional
lauravandoore
36
6.8k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
Code Review Best Practice
trishagee
70
19k
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