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
S3バケットポリシー解説
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Itou Hideki
February 26, 2025
Education
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
S3バケットポリシー解説
Itou Hideki
February 26, 2025
More Decks by Itou Hideki
See All by Itou Hideki
アーキテクチャー設計と 生成AIによるTerraform IaC テンプレートの作り方 AWS
itouhi
1
150
Claude Code×Terraform IaC テンプレート駆動開発
itouhi
1
590
Other Decks in Education
See All in Education
現場最前線から教えるデータサイエンス1 -ITベンダーにおけるデータサイエンティスト-
hidetoshikawaguchi
0
140
View Manipulation and Reduction - Lecture 9 - Information Visualisation (4019538FNR)
signer
PRO
1
2.8k
Case Studies and Future Research - Lecture 12 - Next Generation User Interfaces (4018166FNR)
signer
PRO
0
210
We部コミュニティスライド2026-04-24
junhat6
0
200
参加制約理論
roadofhope
0
140
[2026前期火5] 論理学(京都大学文学部 前期 第9回)「正規化の停止性——ヒドラゲームによる証明」
yatabe
0
210
遊ぶかね欲しさの犯行(ルビ:労働)です
shirayanagiryuji
0
200
教育現場から見た Ruby on Rails
yasslab
PRO
0
220
Course Review - Lecture 13 - Next Generation User Interfaces (4018166FNR)
signer
PRO
0
2.3k
Catecismo 26 #1 - Aula inaugural
cm_manaus
0
210
2026年度春学期 統計学 第6回 データの関係を知る(1)ー 相関関係 (2026. 5. 14)
akiraasano
PRO
0
190
Visionary Initiative: Future Intelligence — Laying the foundations for the future of science, intelligence, and society | Science Tokyo
sciencetokyo
PRO
0
180
Featured
See All Featured
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
370
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Making Projects Easy
brettharned
120
6.7k
Evolving SEO for Evolving Search Engines
ryanjones
0
250
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
670
First, design no harm
axbom
PRO
2
1.2k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Are puppies a ranking factor?
jonoalderson
1
3.7k
Transcript
S3バケットポリシーの解説 JAWS-UG 磐田 伊藤 秀樹
本日の発表者 ◼ 伊藤 秀樹(いとう ひでき) ◼ 輸送機器メーカーのIT子会社に勤務 ◼ 入社以来、メールやファイル共有などIAサーバ系の ITインフラの設計構築・サーバ運用を担当
最近は、CCoE立ち上げでクラウドアーキテクト担当 ◼ JAWS-UG 磐田を設立し、コアメンバーの一人として活動中 掛川城 2
Agenda ・S3バケットで実施したい権限管理 ・S3バケットポリシーの考え方 ・S3バケットポリシーの設定例
・S3バケットで実施したい権限管理 ・公開コンテンツの保管(静的Webサイト) ・各種文書などの保管 ・ALBやVPC、アプリケーションなどのログ保管 etc. データ保護や情報漏洩対策など、 実施したいけど・・・
実現したい事は・・・ 出典:https://qiita.com/c60evaporator/items/da47620d69f84a9be7dc ファイルの保護は、バケットポリシーで実施する必要があります。
・バケットポリシーの考え方 S3のバケットポリシーは、JSON形式で記述するアクセス制御ルールです。 バケット単位で適用され、誰がどの操作をできるかを決定します。 { "Version": "2012-10-17", "Statement": [ { "Effect":
"Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::example-bucket/*" } ] } 1. バケットポリシーの基本構造 バケットポリシーは、以下のようなJSON形式で記述します。
IAMポリシーとの違い
複数条件の組み合わせ① 以下ような条件のポリシーを実現したい ・一般操作の接続は、VPC Endpointのみ ・データ管理者の接続は、接続元IPアドレスかIAMロールが一致している場合 VPC Endpoint 一般操作 データ管理者 接続元
IPアドレス IAM ロール OR OR
バケットポリシー条件にしてみる VPC Endpoint 一般操作 データ管理者 接続元 IPアドレス IAM ロール OR
VPC Endpoint 接続元 IPアドレス IAM ロール AND OR AND
・バケットポリシーの設定例
設定例:バケットポリシー { "Version": "2012-10-17", "Statement": [ { "Sid": "IPAllow", "Effect":
"Deny", "Principal": "*", "Action": "s3:PutObject", "Resource": "arn:aws:s3:::s3-demo-123456789012/*", "Condition": { "StringNotLike": { "aws:userId": "AROA2UC3CHRLHRD5XCES5:*" }, "NotIpAddress": { "aws:SourceIp": "203.0.113.1/32" }, "StringNotEquals": { "aws:SourceVpce": "vpce-0d55dd32cf374b969" } } } ] } #許可するロールのロールID #許可するグローバルIPアドレス #許可するS3エンドポイント
複数条件の組み合わせ② 以下ような条件のポリシーを実現したい ・一般操作の接続は、VPC Endpointのみ ・データ管理者の接続は、接続元IPアドレスかつIAMロールが一致している場合 VPC Endpoint 一般操作 データ管理者 接続元
IPアドレス IAM ロール AND OR
VPC Endpoint バケットポリシー条件にしてみる VPC Endpoint 一般操作 データ管理者 接続元 IPアドレス IAM
ロール AND VPC Endpoint 接続元 IPアドレス IAM ロール OR OR AND AND
{ "Version": "2012-10-17", "Statement": [ { "Sid": "IPAllow", "Effect": "Deny",
"Principal": "*", "Action": "s3:PutObject", "Resource": "arn:aws:s3:::s3-demo2-123456789012/*", "Condition": { "NotIpAddress": { "aws:SourceIp": " 203.0.113.1/32" }, "StringNotEquals": { "aws:SourceVpce": "vpce-0d55dd32cf374b969" } } }, { "Sid": "RoleAllow", "Effect": "Deny", "Principal": "*", "Action": "s3:PutObject", "Resource": "arn:aws:s3:::s3-demo2-123456789012/*", "Condition": { "StringNotLike": { "aws:userId": "AROA2UC3CHRLHRD5XCES5:*" }, "StringNotEquals": { "aws:SourceVpce": "vpce-0d55dd32cf374b969" } } } ] } 設定例:バケットポリシー #許可するロールのロールID #許可するグローバルIPアドレス #許可するS3エンドポイント #許可するS3エンドポイント
もし、アクセスポイントを併用すると・・・
まとめ:S3バケットポリシーとは?
ご清聴ありがとうございました