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.1k
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.6k
Developers.IO 2017 E3
tmorinaga
0
1.2k
JAWS DAYS 2017 Security-JAWS発表資料
tmorinaga
2
4.3k
re:Growth 2016 in Tokyo
tmorinaga
0
2.1k
Developers.IO 2016 in Fukuoka
tmorinaga
1
720
【エンジニア編】AWS活用を考えているなら”必ず!"知っておくべきセキュリティの話
tmorinaga
1
4.2k
【ビジネス編】AWS活用を考えているなら”必ず!"知っておくべきセキュリティの話
tmorinaga
1
2.1k
OpsJAWS#4 CloudWatch Events Hands-on
tmorinaga
3
1.7k
Other Decks in Technology
See All in Technology
Classmethod Odyssey 登壇資料
yamahiro
0
390
サービスの持続的な成長と技術負債について
siva_official
PRO
10
4.4k
LLMアプリケーションの評価の実践と課題 ~PharmaXにおける今後の展望~
pharma_x_tech
2
160
コンテナ・K8s研修 - 後半 Kubernetes 基礎&ハンズオン【MIXI 24新卒技術研修】
mixi_engineers
PRO
1
120
OSSコミットしてZennの課題を解決した話
dyoshikawa1993
0
150
Git 研修 Advanced【MIXI 24新卒技術研修】
mixi_engineers
PRO
0
200
What is DRE? - Road to SRE NEXT@広島
chanyou0311
3
620
シフトレフトで挑む セキュリティの生産性向上
sekido
PRO
0
270
目標設定は好きですか? アジャイルとともに目標と向き合い続ける方法 / Do you like target Management?
kakehashi
10
3k
データ分析を支える技術 生成AI再入門
ishikawa_satoru
0
380
頼られるのが大好きな 皆さんへ - 支援相手との期待の合わせ方、突き放し方 -/For_people_who_like_to_be_relied_on
naitosatoshi
1
290
データ分析基盤を作ってみよう~設計編~
nrinetcom
PRO
1
110
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
399
65k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
52k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
121
18k
Ruby is Unlike a Banana
tanoku
96
10k
Building Applications with DynamoDB
mza
89
5.8k
Building Your Own Lightsaber
phodgson
101
5.9k
Producing Creativity
orderedlist
PRO
340
39k
Leading Effective Engineering Teams 2024
addyosmani
3
300
Fantastic passwords and where to find them - at NoRuKo
philnash
42
2.7k
Teambox: Starting and Learning
jrom
130
8.6k
Practical Orchestrator
shlominoach
185
10k
Gamification - CAS2011
davidbonilla
78
4.9k
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