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
4.4k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
AWS WAFのログが3時間しか見れないのでなんとかしてみる
Ops JAWS #10
Tmorinaga
February 14, 2017
More Decks by Tmorinaga
See All by Tmorinaga
OpsJAWS#13 IAMベストプラクティス
tmorinaga
1
4.1k
Developers.IO 2017 E3
tmorinaga
0
1.4k
JAWS DAYS 2017 Security-JAWS発表資料
tmorinaga
2
5k
re:Growth 2016 in Tokyo
tmorinaga
0
2.4k
Developers.IO 2016 in Fukuoka
tmorinaga
1
950
【エンジニア編】AWS活用を考えているなら”必ず!"知っておくべきセキュリティの話
tmorinaga
1
4.6k
【ビジネス編】AWS活用を考えているなら”必ず!"知っておくべきセキュリティの話
tmorinaga
1
2.5k
OpsJAWS#4 CloudWatch Events Hands-on
tmorinaga
3
1.9k
Other Decks in Technology
See All in Technology
平文パスワードはログに“残り” ── 肝心の侵入は“痕跡すら残らない”
kuroneko13
0
110
会社紹介資料 / Sansan Company Profile
sansan33
PRO
24
430k
Bits Agent Builder の⼊⾨と活⽤事例
nulabinc
PRO
0
250
LLM・AIエージェントシステムベストプラクティス
shibuiwilliam
6
1.6k
Kiro Crew入門 - 常駐エージェントの仕組みと使いどころ / Intro to Kiro Crew
k_adachi_01
1
610
Flutter × BLE Centralを自前Pluginで実装する設計パターン - MethodChannel / EventChannelで作る双方向ブリッジの実践 / Building Custom Flutter BLE Central Plugins: Bidirectional Bridging with Method & Event Channels
bitkey
PRO
0
180
ハーレムエンジニアリング
kazuma777777
0
190
コーチングの奥義 何もしないテクニック
jinwatanabe
0
140
Android skills に学ぶ
kokiko
0
130
LLM Internals: 언어 모델의 계보와 알고리즘 진화 (2023~2026)
inureyes
PRO
1
790
MIXIで活躍できるエンジニアを 若手社員目線で考えてみる
mixi_engineers
PRO
0
110
生成 AI の基礎 〜 サンプル実装で学ぶ基本原理
enakai00
7
4.5k
Featured
See All Featured
WCS-LA-2024
lcolladotor
0
800
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
490
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
300
Documentation Writing (for coders)
carmenintech
77
5.5k
Tell your own story through comics
letsgokoyo
1
1k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Automating Front-end Workflow
addyosmani
1369
210k
The Pragmatic Product Professional
lauravandoore
37
7.4k
Being A Developer After 40
akosma
91
590k
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