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
120
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
130
Claude Code×Terraform IaC テンプレート駆動開発
itouhi
1
580
Other Decks in Education
See All in Education
2026年度春学期 統計学 第11回 分布の「型」を考える - 確率分布モデルと正規分布 (2026. 6. 11)
akiraasano
PRO
0
110
면접관 눈에 띄는 데이터 분석 포트폴리오 만드는 법 | 2026년 5월 세미나
datarian
0
870
Gitがない時代 インターネットがない時代の 開発話
sapi_kawahara
0
310
Portable & Reproducible Research Environments in the Age of AI Agents
denkiwakame
0
450
2026年度春学期 統計学 第5回 分布をまとめるー記述統計量(平均・分散など) (2026. 5. 7)
akiraasano
PRO
0
170
Soluciones al examen de Geografía 2026. JULIO (Convocatoria Extraordinaria)
juanmartin2026
0
1.8k
「機械学習と因果推論」入門 ③ 漸近効率な推定量と二重機械学習
masakat0
0
720
Curso de Consagração ao Sagrado Coração de Jesus - O Sagrado Coração na História (Aula 01)
cm_manaus
0
240
Course Review - Lecture 13 - Information Visualisation (4019538FNR)
signer
PRO
1
2.7k
We部コミュニティスライド2026-04-24
junhat6
0
190
Visionary Initiative: Future Intelligence — Laying the foundations for the future of science, intelligence, and society | Science Tokyo
sciencetokyo
PRO
0
110
Lectura 1 (PIT : Python Basico)
robintux
0
370
Featured
See All Featured
Odyssey Design
rkendrick25
PRO
2
720
Evolving SEO for Evolving Search Engines
ryanjones
0
230
Designing for Timeless Needs
cassininazir
1
270
So, you think you're a good person
axbom
PRO
2
2.1k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
How GitHub (no longer) Works
holman
316
150k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
160
Leo the Paperboy
mayatellez
7
1.9k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
410
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
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バケットポリシーとは?
ご清聴ありがとうございました