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
AWS WAFのログが3時間しか見れないのでなんとかしてみる
Search
Tmorinaga
February 14, 2017
Technology
3
4.2k
AWS WAFのログが3時間しか見れないのでなんとかしてみる
Ops JAWS #10
Tmorinaga
February 14, 2017
Tweet
Share
More Decks by Tmorinaga
See All by Tmorinaga
OpsJAWS#13 IAMベストプラクティス
tmorinaga
1
3.9k
Developers.IO 2017 E3
tmorinaga
0
1.3k
JAWS DAYS 2017 Security-JAWS発表資料
tmorinaga
2
4.7k
re:Growth 2016 in Tokyo
tmorinaga
0
2.2k
Developers.IO 2016 in Fukuoka
tmorinaga
1
830
【エンジニア編】AWS活用を考えているなら”必ず!"知っておくべきセキュリティの話
tmorinaga
1
4.4k
【ビジネス編】AWS活用を考えているなら”必ず!"知っておくべきセキュリティの話
tmorinaga
1
2.3k
OpsJAWS#4 CloudWatch Events Hands-on
tmorinaga
3
1.8k
Other Decks in Technology
See All in Technology
ハノーバーメッセ2025座談会.pdf
iotcomjpadmin
0
140
登壇ネタの見つけ方 / How to find talk topics
pinkumohikan
2
190
本部長の代わりに提案書レビュー! KDDI営業が毎日使うAIエージェント「A-BOSS」開発秘話
minorun365
PRO
14
2.3k
AIの最新技術&テーマをつまんで紹介&フリートークするシリーズ #1 量子機械学習の入門
tkhresk
0
120
菸酒生在 LINE Taiwan 的後端雙刀流
line_developers_tw
PRO
0
1.1k
Azure AI Foundryでマルチエージェントワークフロー
seosoft
0
140
CIでのgolangci-lintの実行を約90%削減した話
kazukihayase
0
340
Observability infrastructure behind the trillion-messages scale Kafka platform
lycorptech_jp
PRO
0
130
讓測試不再 BB! 從 BDD 到 CI/CD, 不靠人力也能 MVP
line_developers_tw
PRO
0
1.1k
エンジニア向け技術スタック情報
kauche
0
110
kubellが挑むBPaaSにおける、人とAIエージェントによるサービス開発の最前線と技術展望
kubell_hr
1
390
Perk アプリの技術選定とリリースから1年弱経ってのふりかえり
stomk
0
120
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.8k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Bash Introduction
62gerente
614
210k
Agile that works and the tools we love
rasmusluckow
329
21k
How to Think Like a Performance Engineer
csswizardry
24
1.7k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
8
660
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
Speed Design
sergeychernyshev
31
1k
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
Thoughts on Productivity
jonyablonski
69
4.7k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
2.8k
Gamification - CAS2011
davidbonilla
81
5.3k
Transcript
AWS WAFͷϩά͕ 3͔࣌ؒ͠ݟΕͳ͍ͷͰ ͳΜͱ͔ͯ͠ΈΔ Ϋϥεϝιουגࣜձࣾ ιϦϡʔγϣϯΞʔΩςΫτ Ӭେࢤ
ࣗݾհ
ɹɹɹɹɹɹӬ େࢤ(@morimoritaitai) AWSࣄۀ෦ ιϦϡʔγϣϯΞʔΩςΫτ ✦ झຯ : ήʔϜ / ञ
/ Χϝϥ ✦ ڵຯ : Security / OpsࣗಈԽ ✦ ͖:Config/CloudTrail/IAM/PHD ✦ ৭ͷαʔϏε͕͖ͳϑϨϯζ ✦ AWSೝఆࢿ֨5ף
ձࣾհ
ϒϩάͷձࣾ
AWS WAFͬͯ·͔͢ʁ
AWS WAFͱ • CloudFrontͱALBʹࠐΊΔϚωʔδυWAF • IPΞυϨε੍ݶ/จࣈྻ੍ݶ/SQLΠϯδΣΫ γϣϯ/XSSରࡦͳͲجຊతͳWAFཁ݅ຬͨ ͤΔ • ͦΜͳʹෳࡶͳઃఆग़དྷͳ͍͚Ͳ؆қͳ
WAF͕΄͍͠ͳΒ͘͢͝ศར
AWS WAFศརͳΜͰ͕͢ɺ 1͍͚ͨͩͳ͍͜ͱ͕…
Πϕϯτϩά͕3͔࣌ؒ͠ ݟΕͳ͍
४ϦΞϧλΠϜͷ ΠϯγσϯτରԠͱߟ͑Ε ͔Βͳ͘ͳ͍
ͰͬͺΓΠϕϯτϩά ޙ͔Β֬ೝͰ͖ΔΑ͏ʹ͍ͨ͠
ͳΜͱ͔ͯ͠ΈΔ
ߏΛߟ͑Δ • AWS WAFͷΠϕϯτCloudWatchͰݕ • CloudWatchͷΞϥʔτΛSNSͰൃใ • SNSͰLambdaΛൃՐ • Lambda͕AWS
WAFͷϩάΛऔಘ͠S3อଘ
ߏਤ ᶃ Πϕϯτൃੜ ᶄΞϥʔϜൃใ ᶅ SNS௨ ᶆ ϩάऔಘ ᶇ ϩάอ
WAF CloudWatch SNS Lambda S3
SNSτϐοΫ࡞
CloudWatchΞϥʔτ࡞ 1ͭͰϒϩοΫ͕͋Ε SNSͰ௨
ϩάอ༻S3όέοτ࡞
Lambda༻IAMϩʔϧ࡞ • AmazonS3FullAccess • AWSWAFReadOnlyAccess • AWSLambdaBasicExecutionRole
LambdaϑΝϯΫγϣϯ࡞ • https://github.com/Tmorinaga/aws-waf-logger/blob/master/aws-waf-logger.py
LambdaϑΝϯΫγϣϯ࡞ SNSΛΠϕϯτιʔεʹ
LambdaϑΝϯΫγϣϯ࡞ ڥมͰS3όέοτ໊ࢦఆ ࡞ͨ͠IAM RoleΛࢦఆ
ࢼ͢ Α͋͘ΔSQLΠϯδΣΫγϣϯྫ
ࢼ͢ ϒϩοΫ͞Εͨ
5ޙ
ࢼ͢ S3ʹϩά͕֨ೲ͞Εͨʂ͢͝ʔ͍ʂ
ҙ • AWS WAFଆͷ༷ͰPOSTͷதݟΕͳ͍ • ݟΕΔΑ͏ʹͳΓ·ͤΜ͔Ͷɻɻɻʁ • Sample Requests100͔݅͠औΕͳ͍ͷͰɺ Ұؾʹ100݅Ҏ্ͷ߈ܸ͕དྷΔͱऔಘ࿙ΕΔ
࠷ޙʹ • ͍ͭެࣜରԠ͓͔ͯ͘͠͠ͳ͍ͷͰυΩυ Ω͠ͳ͕ΒίʔυΛॻ͍ͯ·ͨ͠ • POSTͷதΛه͍ͨ͠…ʂ • ϓϧϦΫ͍ͩ͘͞ • https://github.com/Tmorinaga/aws-waf-
logger/blob/master/aws-waf-logger.py
JAWS DAYS2017ʹొஃ͠·͢ • Security JAWSͷҰһͱͯ͠AWS Configʹ͍ͭͯ͘ޠΓ·͢ • ଞʹSec-JAWSϝϯόʔ͕ొஃͯ͠WAFʹ͍ͭͯΓ·͢
None