Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CloudTailをAzure Sentinelで 分析するということ

CloudTailをAzure Sentinelで 分析するということ

Security JAWS #21で登壇したセッション資料です

fnifni

May 20, 2021
Tweet

More Decks by fnifni

Other Decks in Technology

Transcript

  1. It means analyzing CloudTail with Azure Sentinel. A little bit

    of the depths of log analysis in the cloud. By Hirokazu Yoshida / At S-JAWS#21 / 2021.05.19
  2. Who am I !? Hirokazu Yoshida @ CloudNative Inc. Job

    : Security Engineer Community : Security-JAWS Favorite AWS Service :
  3. What are AWS logs? • CloudTrail • Con fi gมߋཤྺϩά

    • ELBܥΞΫηεϩά • CloudFrontඪ४ϩά • AWS WAFτϥϑΟοΫϩά • S3αʔόʔΞΫηεϩά • CloudWatch Logsʹྲྀͨ͠΋ͷ • RDS DBϩά, VPC Flow Logs, ECS(k8s) 
 Fargate, Lambda, FileGateway etc… • Security Hub Findings • GuardDuty, Inspector, Macie, 
 Firewall Manager, Systems Manager, 
 IAM Access Analyzer
  4. Today's Scope • CloudTrail • Con fi gมߋཤྺϩά • ELBܥΞΫηεϩά

    • CloudFrontඪ४ϩά • AWS WAFτϥϑΟοΫϩά • S3αʔόʔΞΫηεϩά • CloudWatch Logsʹྲྀͨ͠΋ͷ • RDS DBϩά, VPC Flow Logs, ECS(k8s) 
 Fargate, Lambda, FileGateway etc… • Security Hub Findings • GuardDuty, Inspector, Macie, 
 Firewall Manager, Systems Manager, 
 IAM Access Analyzer
  5. Should I have only looked at the AWS logs? •

    Operations Cloud Hopper • MSPΛඪతͱͨ͠߈ܸΩϟϯϖʔϯ • ҰछͷαϓϥΠνΣʔϯ߈ܸ • ϚΠωοτάϧʔϓ͕ӡӦ͢ΔҰ෦ήʔϜλΠτϧͷαʔόʔো֐ͷ͓ ஌Βͤͱ͓࿳ͼ • Ϗδωενϟοτ্Ͱڞ༗͍ͯ͠Δ 
 ΞΫηε৘ใΛ౪ΈݟΒΕͨՄೳੑ
  6. Motivation for log analysis • ؂ࢹʢ҆ఆՔಇ؍఺ʣ • αʔϏεՔಇঢ়گ؂ࢹ • ো֐ௐࠪ

    • αʔϏεར༻ʢϏδωε؍఺ʣ • αʔϏεར༻܏޲ͷ೺Ѳ • ௥੻ௐࠪʢηΩϡϦςΟ؍఺ʣ • αʔϏεෆਖ਼ར༻ͷ௥੻ • ֎෦͔Βͷ߈ܸͷ೺Ѳͱ௥੻ • ϩάΠϯঢ়گͷ௥੻ • ؅ཧऀૢ࡞ͷ೺Ѳͱ௥੻
  7. Motivation for log analysis • ؂ࢹʢ҆ఆՔಇ؍఺ʣ • αʔϏεՔಇঢ়گ؂ࢹ • ো֐ௐࠪ

    • αʔϏεར༻ʢϏδωε؍఺ʣ • αʔϏεར༻܏޲ͷ೺Ѳ • ௥੻ௐࠪʢηΩϡϦςΟ؍఺ʣ • αʔϏεෆਖ਼ར༻ͷ௥੻ • ֎෦͔Βͷ߈ܸͷ೺Ѳͱ௥੻ • ϩάΠϯঢ়گͷ௥੻ • ؅ཧऀૢ࡞ͷ೺Ѳͱ௥੻ αʔϏενʔϜɺϏδωεΦʔφʔ αʔϏενʔϜɺӡ༻อकνʔϜ αʔϏενʔϜɺηΩϡϦςΟνʔϜ ηΩϡϦςΟνʔϜ αʔϏενʔϜ
  8. Motivation for log analysis • ؂ࢹʢ҆ఆՔಇ؍఺ʣ • αʔϏεՔಇঢ়گ؂ࢹ • ো֐ௐࠪ

    • αʔϏεར༻ʢϏδωε؍఺ʣ • αʔϏεར༻܏޲ͷ೺Ѳ • ௥੻ௐࠪʢηΩϡϦςΟ؍఺ʣ • αʔϏεෆਖ਼ར༻ͷ௥੻ • ֎෦͔Βͷ߈ܸͷ೺Ѳͱ௥੻ • ϩάΠϯঢ়گͷ௥੻ • ؅ཧऀૢ࡞ͷ೺Ѳͱ௥੻ ͚ͩ͜͜είʔϓ͕"84಺ʹऩ·Βͳ͍ ଟ͕͘"84಺ʹऩ·Δ
  9. What is Azure Sentinel ? • CloudܕSIEM • ෼ੳɺՄࢹԽɺࣗಈԽͷػೳ •

    ๛෋ͳࣄલఆٛͷςϯϓϨʔτ • ςϯϓϨʔτͷࣗಈ௥Ճ • Kusto Query Language • Azure؀ڥͱͷߴ͍਌࿨ੑ • ๛෋ͳίωΫλ • APIͷ༻ҙ • ϩάྲྀೖྔͱอଘظؒͰ՝ۚ • ಛผͳϥΠηϯεෆཁ
  10. Advantages of Azure Sentinel • ্ཱͪ͛ʹ͔͔Δ޻਺͕গͳ͍ • αϒεΫϦϓγϣϯΛ࡞ͬͯɺ਺ΫϦοΫͰΦϯϘʔυ • AWSͱͷ઀ଓ͸ɺIAMϙϦγʔͱIAMϩʔϧͷઃఆͷΈ

    • AWSCloudTrailReadOnlyAccess • ઃఆޙɺ20෼͘Β͍Ͱσʔλ͕ྲྀΕͯ͘Δ IUUQTEPDTNJDSPTPGUDPNKBKQB[VSFTFOUJOFMDPOOFDUBXT IUUQTEPDTNJDSPTPGUDPNKBKQB[VSFTFOUJOFMRVJDLTUBSUPOCPBSE
  11. Advantages of Azure Sentinel • ࣄલఆٛͷ෼ੳςϯϓϨʔτʢCSPMతͳ΍ͭฤʣ • Login to AWS

    Management Console without MFA • Changes made to AWS CloudTrail logs • Changes to internet facing AWS RDS Database instances • Changes to AWS Elastic Load Balancer security groups • Changes to AWS Security Group ingress and egress settings • Changes to Amazon VPC settings
  12. Advantages of Azure Sentinel • ࣄલఆٛͷ෼ੳςϯϓϨʔτʢෆ৹ͳڍಈͳ΍ͭฤʣ • Failed AWS Console

    logons but success logon to AzureAD • Failed AzureAD logons but success logon to AWS Console • Monitor AWS Credential abuse or hijacking • ࣄલఆٛͷ෼ੳςϯϓϨʔτʢڴҖΠϯςϦδΣϯεͱ࿈ܞฤʣ • (Preview) TI map IP entity to AWSCloudTrail
  13. Query Example • Changes to Amazon VPC settings $IBOHFTUP"NB[PO71$TFUUJOHT MFU&WFOU/BNF-JTU

    EZOBNJD <$SFBUF/FUXPSL"DM&OUSZ $SFBUF3PVUF $SFBUF3PVUF5B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EF**4PLIUUQ VOJPOJTGV[[ZUSVF 0 ff i DF"DUJWJUZ cதུ   8$**4-PH cதུ   "84$MPVE5SBJM cXIFSF5JNF(FOFSBUFEBHP UJNFGSBNF  cXIFSF6TFS"HFOUNBUDIFTSFHFY6TFS"HFOU-JTU cFYUFOE4PVSDF*14PVSDF*Q"EESFTT cQSPKFDU5JNF(FOFSBUFE 5ZQF 6TFS"HFOU 4PVSDF*1  cTVNNBSJ[FNJO 5JNF(FOFSBUFE NBY 5JNF(FOFSBUFE  DPVOU CZ5ZQF 6TFS"HFOU 4PVSDF*1 cFYUFOEUJNFTUBNQNJO@5JNF(FOFSBUFE  *1$VTUPN&OUJUZ4PVSDF*1
  15. The intrinsic pain of trying. • ϩάͷΤΫεϙʔτʢ௕ظอ؅ʣ • Azure Sentinelࣗମͷϩάอଘظؒ͸࠷େ23ϲ݄(90೔Ҏ্՝ۚ)

    • ௕ظอ؅ͷͨΊͷΤΫεϙʔτػೳ͸ɺҰ෦ϩάͷΈαϙʔτ • APIΛ༻͍ͯΤΫεϙʔτ͢Δػߏͷ࡞ΓࠐΈ͕ඞཁ • APIίʔϧϦϛοτɺಥ೗ݱΕΔ429Τϥʔ • ΫΤϦʔԠ౴্ݶʹҾ͔͔ͬΔͱσʔλ͕Ϳͭ੾ΓʹͳΔ
  16. The intrinsic pain of trying. • ௕ظอ؅ઌ͔Βͷ࠶෼ੳ • Azure Sentinelʹॻ͖໭ͯ͠࠶෼ੳ

    • 1ϲ݄෼ͷσʔλͷॻ͖໭͠Ͱ48࣌ؒOver • ཱͪ;͕͞ΔAPIίʔϧϦϛοτɺಥ೗ݱΕΔ429Τϥʔ • ௕ظอଘઌͰ௚઀෼ੳͰ͖ͳ͍ͱ͠ΜͲ͍ • Data Explorer͸ߴֹɻɻɻ
  17. The intrinsic pain of trying. • Ϋϥ΢υͷϩά͸ʮ݁Ռ੔߹ੑʯ • ϩά͸ૢ࡞͕ߦΘΕ͔ͯΒ͙͢ʹಡΈऔΓՄೳʹ͸ͳΒͳ͍ •

    CloudTrail͸ɺ8-12෼ఔ౓ͷܦ͔ͬͯΒࢀরՄೳ • CloudTrail -> Azure Sentinel͸ɺ໿20෼લͷϩά͕౸ண • σʔλιʔεʹΑͬͯ·ͪ·ͪɻଈ࣌Ξϥʔτ͸ແཧے IUUQTUFDIDPNNVOJUZNJDSPTPGUDPNUB[VSFTFOUJOFMIBOEMJOH JOHFTUJPOEFMBZJOB[VSFTFOUJOFMTDIFEVMFEBMFSUSVMFTCBQ
  18. Conclusion • ϩά෼ੳͷπʔϧ͸ɺ࢖͏ਓͱ༻్ʹԠͯ͡దࡐదॴ • ༷ʑͳϏδωεϓϥοτϑΥʔϜΛލΔ૬ؔ෼ੳʹ͸ɺ 
 Azure Sentinel͸༗ྗͳબ୒ࢶ • Azure

    Sentinel͸গͳ͍޻਺Ͱ্ཱ͕ͪΓɺεϞʔϧελʔτʹ࠷ద • Ϋϥ΢υͷಛੑΛߟྀͨ࣌ؒ͠ઃఆ΍औΓѻ͍ͷߟྀ͕ඞཁ