Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1019767%22%20slang%3D%22en-US%22%3EHunting%20for%20Capital%20One%20Breach%20TTPs%20in%20AWS%20logs%20using%20Azure%20Sentinel%20-%20Part%20II%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1019767%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20the%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FAzure-Sentinel%2FHunting-for-Capital-One-Breach-TTPs-in-AWS-logs-using-Azure%2Fba-p%2F1014258%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Efirst%20part%3C%2FA%3E%20of%202-part%20series%20%2C%20we%20performed%26nbsp%3B%3CSPAN%3Eattack%20simulation%20of%20Capital%20one%20Breach%20scenario%20using%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FRhinoSecurityLabs%2Fcloudgoat%2Fblob%2Fmaster%2Fscenarios%2Fcloud_breach_s3%2FREADME.md%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECloud%20Goat%20scenario%20-%26nbsp%3B%3CSTRONG%3E%3CEM%3Ecloud_breach_s3%3C%2FEM%3E%3C%2FSTRONG%3E%3C%2FA%3E%26nbsp%3B.%20In%20this%20second%20part%2C%20we%20will%20analyze%20logs%20generated%20from%20simulation%20and%20see%20how%20we%20can%20hunt%20for%20some%20of%20the%20attacker%20techniques%20from%20AWS%20data%20sources%20on%20boarded%20to%20Azure%20Sentinel.%20We%20will%20also%20walk-through%20how%20to%20ingest%20relevant%20data%20sources%2C%20develop%20detection%20or%20hunting%20queries%20using%20Kusto%20Query%20Language(KQL)%20and%20also%20use%20Azure%20Sentinel%20incident%20workflow%20and%20investigation%20features.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1443896951%22%20id%3D%22toc-hId--1443896951%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId-1043615882%22%20id%3D%22toc-hId-1043615882%22%3EIdentify%20Threat%20Hunting%20opportunities%20in%20AWS%20Logs.%3C%2FH2%3E%0A%3CP%3EIf%20you%20have%20not%20seen%20it%20already%2C%20read%20our%20blogpost%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FAzure-Sentinel%2FIdentifying-Threat-Hunting-opportunities-in-your-data%2Fba-p%2F915721%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EIdentifying%20Threat%20Hunting%20opportunities%20in%20your%20data%3C%2FA%3E%20to%20understand%20potential%20threat%20hunting%20approaches%20across%20your%20data%20sources.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20goal%20of%20this%20blog%20is%20walk%20through%20an%20attack%20simulation%20to%20identify%20what%20activities%20show%20up%20in%20logs%20and%20can%20be%20converted%20into%20Detection%20or%20Hunting%20queries%20to%20provide%20proactive%20protection%20capabilities%20in%20the%20future.%20In%20the%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FAzure-Sentinel%2FHunting-for-Capital-One-Breach-TTPs-in-AWS-logs-using-Azure%2Fba-p%2F1014258%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Efirst%20part%3C%2FA%3E%20of%20this%20blog%20we%20performed%20the%20attack%20simulation%20and%20therefore%20know%20the%20suspicious%20entities%20involved.%20We%20can%20start%20mapping%20those%20entities%20to%20relevant%20data%20types%20and%20then%20investigate%20further.%20AWS%20has%20several%20data%20types%20that%20capture%20information%20related%20to%20API%20and%20network%20activities%2C%20but%20in%20this%20case%2C%20we%20are%20limiting%20our%20investigation%20to%20AWS%20CloudTrail%20and%20S3%20Bucket%20API%20logging%20to%20monitor%20file%20level%20operations.%20These%20datasources%20are%20primary%20logging%20datasources%20and%20provide%20best%20coverage%20of%20all%20activity.%20We%20also%20enabled%20GuardDuty%20during%20the%20simulation%20to%20see%20if%20any%20of%20its%20built-in%20alerts%20trigger.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20below%20table%20represents%20entities%20involved%20in%20attack%20mapped%20against%20potential%20data%20sources.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158024iA863E1FCC0DAC6C3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2201-Entity%20Details.png%22%20title%3D%2201-Entity%20Details.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--763838581%22%20id%3D%22toc-hId--763838581%22%3EStorage%20access%20Logging%20vs%20Object%20Level%20Logging%3C%2FH2%3E%0A%3CP%3ETo%20monitor%20file%20level%20operations%20in%20S3%20buckets%2C%20there%20are%202%20types%20of%20logs%20available%20storage%20access%20logs%20and%20S3%20object%20level%20API%20logs.%20However%2C%20for%20Incident%20response%20and%20detection%20purposes%2C%20S3%20object%20level%20logging%20is%20recommended%20as%20it%20includes%20more%20services%2C%20comes%20with%20detailed%20and%20structured%20log%20format%20and%20additionally%20promises%20timeliness%20and%20reliable%20log%20delivery.%20This%20blog%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.netskope.com%2Fblog%2Faws-s3-logjam-server-access-logging-vs-object-level-logging%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAWS%20S3%20Logjam%3A%20Server%20Access%20Logging%20vs.%20Object-Level%20Logging%3C%2FA%3E%20is%20a%20recommended%20read%20which%20goes%20deeper%20and%20explains%20the%20differences%20between%20both%20log%20formats%20and%20pros%20and%20cons%20of%20each.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1723674252%22%20id%3D%22toc-hId-1723674252%22%3EEnable%20S3%20Object%20Level%20Logging%3C%2FH2%3E%0A%3CP%3ETo%20enable%20S3%20object%20logging%2C%20you%20need%20to%20create%20new%20CloudTrail%20with%20destination%20as%20S3%20bucket.%3C%2FP%3E%0A%3CP%3ENavigate%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Fconsole.aws.amazon.com%2Fcloudtrail%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3ECloudTrail%20Console%3C%2FA%3E.%26nbsp%3B%20Go%20to%20%3CSTRONG%3EEvent%20history%3C%2FSTRONG%3E%20and%20in%20%3CSTRONG%3ECreate%20a%20trail%3C%2FSTRONG%3E%20select%20%3CSTRONG%3ECreate%20trail.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158026i25D79B9AD9FD1E69%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2202-Enable%20Object%20logging.png%22%20title%3D%2202-Enable%20Object%20logging.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20Trails%2C%20Enter%20a%20trail%20name%2C%20Select%20Apply%20trail%20to%20all%20regions%20else%20to%20cover%20all%20buckets%20from%20all%20regions.%20In%20the%20same%20window%2C%20Under%20navigate%20to%20the%20S3%20Tab%2C%20select%20all%20S3%20buckets%20in%20your%20account%20with%20Read%20and%20Write%20selected%20as%20shown%20in%20below%20screenshot.%20This%20will%20enable%20logging%20for%20all%20existing%20as%20well%20newly%20created%20buckets.%20You%20also%20have%20option%20to%20selectively%20go%20to%20specific%20bucket%20and%20enable%20object%20level%20logging%20for%20existing%20buckets.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERefer%20%3CSTRONG%3E%3CU%3EAWS%20guidance%3C%2FU%3E%3C%2FSTRONG%3E%3A%20%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.aws.amazon.com%2FAmazonS3%2Flatest%2Fuser-guide%2Fenable-cloudtrail-events.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EHow%20Do%20I%20Enable%20Object-Level%20Logging%20for%20an%20S3%20Bucket%20with%20AWS%20CloudTrail%20Data%20Events%3F%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158052iF8F24685C1C49065%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2203-Create%20Trail.png%22%20title%3D%2203-Create%20Trail.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFollow%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.aws.amazon.com%2Fawscloudtrail%2Flatest%2Fuserguide%2Fcloudtrail-s3-bucket-naming-requirements.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAmazon%20S3%20Bucket%20Naming%20Requirements%3C%2FA%3E%20as%20specified%20in%20AWS%20documentation.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158028i75F08297C79908BF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2203-Create%20Trail-02.png%22%20title%3D%2203-Create%20Trail-02.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAfter%20creating%20the%20trail%2C%20make%20sure%20status%20shows%20Green%20and%20multi-region%20trail%20as%20Yes%20as%20per%20below%20screenshot.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158029i40E916BC6B455C3A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2204-Verify%20Trail%20Status.png%22%20title%3D%2204-Verify%20Trail%20Status.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--83780211%22%20id%3D%22toc-hId--83780211%22%3EIngest%20S3%20Logs%20to%20Azure%20Sentinel%20via%20Logstash%3C%2FH2%3E%0A%3CP%3ECurrently%20you%20can%20use%20the%20AWS%20connector%20to%20stream%20all%20your%20AWS%20CloudTrail%20events%20into%20Azure%20Sentinel%20by%20using%20the%20instructions%20at%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsentinel%2Fconnect-aws%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EConnect%20Azure%20Sentinel%20to%20AWS%20CloudTrail%3C%2FA%3E.%20It%20currently%20only%20ingests%20management%20events%20and%20does%20not%20support%20Data%20Events%20logged%20to%20S3%20bucket.%20While%20our%20Product%20Engineering%20team%20works%20through%20adding%20support%20for%20other%20services%20and%20improving%20connector%20coverage%2C%20Azure%20Sentinel%20has%20multiple%20option%20to%20ingest%20Custom%20Logs%20from%20such%20unsupported%20sources.%20%26nbsp%3BYou%20can%20also%20read%20about%20it%20in%20our%20tech%20community%20blog%20post%26nbsp%3B%20-%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FAzure-Sentinel%2FAzure-Sentinel-Creating-Custom-Connectors%2Fba-p%2F864060%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EAzure%20Sentinel%3A%20Creating%20Custom%20Connectors%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3EFor%20this%20article%2C%20we%20are%20going%20to%20use%20Logstash%2C%20which%20has%20an%20S3%20input%20plugin%20and%20a%20Log%20Analytics%20output%20plugin%20available.%20Please%20check%20the%20Azure%20Sentinel%20GitHub%20wiki%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fwiki%2FIngest-Custom-Logs-LogStash%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EIngest%20Custom%20Logs%20using%20Logstash%3C%2FA%3E%20for%20detailed%20installation%20steps%20of%20Logstash%20and%20how%20to%20use%20a%20sample%20configuration%20file%20to%20send%20logs%20to%20Azure%20Sentinel.%20In%20order%20to%20parse%20json%20logs%20from%20an%20S3%20bucket%2C%20you%20can%20use%20the%20configuration%20file%20available%20in%20Azure%20Sentinel%20under%20section%20Parsers%20-%20%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FParsers%2FLogstash%2Finput-aws_s3-output-loganalytics.conf%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Einput-aws_s3-output-loganalytics.conf%26nbsp%3B%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20better%20understanding%2C%20you%20can%20check%20below%20diagram%20on%20how%20data%20ingestion%20will%20take%20place.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158031i66FDD4BF8586F59B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2205-Logstash%20setup.png%22%20title%3D%2205-Logstash%20setup.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1891234674%22%20id%3D%22toc-hId--1891234674%22%3EWriting%20Detections%2FHunting%20query%20for%20TTPs%3C%2FH2%3E%0A%3CP%3ENow%20we%20have%20entities%20and%20ingested%20relevant%20data%20sources%2C%20let%E2%80%99s%20start%20looking%20into%20what%20logs%20are%20available%20for%20investigation.%20You%20can%20start%20with%20free%20text%20search%20queries%20for%20each%20of%20these%20using%20the%20KQL%20%E2%80%98search%E2%80%99%20function.%3C%2FP%3E%0A%3CP%3EFor%20example%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Esearch%20%2251.141.184.127%22%0A%7C%20summarize%20count()%20by%20%24table%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20533px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158032i3CB2AE28304E6AED%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2206-KQL%20Query.png%22%20title%3D%2206-KQL%20Query.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20also%20start%20looking%20at%20sample%20events%20to%20identify%20key%20attributable%20columns%20for%20UserIdentity%2C%20IP%20address%2C%20S3%20bucket%20name%20and%20so%20on.%20The%20below%20screenshot%20shows%20a%20sample%20event%20from%20AWSCloudTrail%20connector%20of%20the%20UserIdentity%20%3D%3D%20Cloudgoat%20adding%20IP%20Addresses%20provided%20during%20whitelisting%20at%20resource%20deployment.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3Esearch%20%2251.141.184.127%22%0A%7C%20where%20%24table%20%3D%20'AWSCloudTrail'%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158033iE36EF16470DC09AA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2207-SampleEvent-cloudgoat.png%22%20title%3D%2207-SampleEvent-cloudgoat.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnother%20event%20shows%2C%20sample%20GetObject%20API%20call%20made%20to%20the%20S3%20bucket%20and%20downloading%20resources%20from%20it.%20You%20can%20use%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FParsers%2FAwsS3BucketAPILogsParser.txt%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAWSS3BucketAPILogsParser%3C%2FA%3E%26nbsp%3Bwe%20have%20published%20in%20Github%20which%20has%20normalized%20column%20names%20to%20better%20align%20with%20CloudTrail%20event%20schema.%20Follow%20the%20parser%20notes%20to%20create%20a%20function%20and%20use%20below%20query%20to%20take%20a%20sample%20event.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3EAWSS3BucketAPILogParsed%20%0A%7C%20where%20SourceIPAddress%20%3D%3D%20%2251.141.184.127%22%0A%7C%20where%20EventName%20%3D%3D%20%22GetObject%22%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158035i620E109021423F34%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2208-SampleEvent-GetObject.png%22%20title%3D%2208-SampleEvent-GetObject.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAfter%20completing%20queries%20for%20each%20of%20the%20entities%20from%20the%20table%2C%20we%20can%20populate%20the%20Entity%20to%20datasource%20mapping%20table%20below%2C%20where%20green%20indicates%20it%20is%20present%20in%20the%20data%20type%20and%20Red%20indicates%20it%20is%20not%20present.%20The%20number%20indicates%20the%20count%20of%20events.%20Also%2C%20add%20any%20interesting%20event%20types%20from%20monitoring%2Falerting%20perspective.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158036iCAC87D88167F2183%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2209-Entity%20DataSource%20Details.png%22%20title%3D%2209-Entity%20DataSource%20Details.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-596278159%22%20id%3D%22toc-hId-596278159%22%3EDetection%20and%20Hunting%20Queries%3C%2FH2%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3E%3CSTRONG%3E%3CU%3ET1078%3A%20Privileged%20role%20attached%20to%20Instance%3C%2FU%3E%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EThis%20technique%20maps%20back%20to%20initial%20vulnerable%20resources%20associated%20with%20scenario%20deployed%20by%20cloudgoat.%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FAWSCloudTrail%2FAWS_PrivilegedRoleAttachedToInstance.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGithub%20Query%20Link%3C%2FA%3E%26nbsp%3B%3A%20This%26nbsp%3Bquery%20looks%20for%20when%20a%20Privileged%20role%20is%20attached%20to%20existing%20instance%20or%20new%20instance%20at%20deployment.%20This%20instance%20may%20be%20used%20by%20adversary%20to%20escalate%20normal%20user%20privileges%20to%20administrative%20user.%20There%20may%20be%20legitimate%20use%20cases%20in%20case%20of%20cross%20account%20access%20to%20do%20administrator%20activity%2C%20in%20such%20cases%20whitelisting%20the%20UserIdentity%20invoking%20and%20RoleName%20combinations%20based%20on%20historical%20analysis%20will%20reduce%20False%20positives.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158038i8BD91A88176DCBBB%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2210-Detection-01.png%22%20title%3D%2210-Detection-01.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3E%3CU%3E%3CSTRONG%3ET1078%20%3A%20Suspicious%20credential%20token%20access%20of%20valid%20IAM%20Roles%3C%2FSTRONG%3E%3C%2FU%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EThis%20log%20is%20a%20result%20of%20second%20command%20from%20scenario%20cheatsheet%20which%20requested%20temp%20credentials%20via%20curl%20request.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FCustomLogs%2FAWSBucketAPILogs-SuspiciousCredentialTokenAccessOfValid_IAM_Roles.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGithub%20Query%20Link%3C%2FA%3E%26nbsp%3B%3A%20This%20query%20will%20look%20for%20AWS%20STS%20API%20Assume%20Role%20operations%20for%20RoleArn%20(Role%20Amazon%20Resource%20Names)%20which%20was%20not%20historically%20seen%20invoked%20by%20Useridentity%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158040iF86228CA07A4E91F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2211-Detection-02.png%22%20title%3D%2211-Detection-02.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CU%3E%3CFONT%20color%3D%22%230000FF%22%3ET1530%20%3A%20Suspicious%20Data%20Access%20to%20S3%20Bucket%20from%20Unknown%20IP%20address.%3C%2FFONT%3E%3C%2FU%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EThis%20technique%20is%20a%20result%20of%20third%20and%20last%20command%20executed%20from%20scenario%20cheatsheet%20to%20use%20IAM%20role%20credentials%20retrieved%20from%20previous%20steps%20to%20list%20buckets%20and%20retrieve%20object%20contents.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FCustomLogs%2FAWSBucketAPILogs-SuspiciousDataAccessToS3BucketsfromUnknownIP.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGithub%20query%3C%2FA%3E%20%3A%20This%20query%20will%20look%20for%20any%20access%20originating%20from%20Source%20IP%20which%20was%20not%20seen%20historically%20accessing%20the%20bucket%20or%20downloading%20files%20from%20it%20via%20AWS%20S3%20API.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158041i7557E140B9CEB5F3%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2212-Detection-03.png%22%20title%3D%2212-Detection-03.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CU%3E%3CFONT%20color%3D%22%230000FF%22%3ET1020%20%3A%20S3%20Bucket%20outbound%20Data%20transfer%20anomaly%3C%2FFONT%3E%3C%2FU%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EThis%20technique%20is%20a%20result%20of%20s3%20sync%20command%20executed%20from%20scenario%20cheatsheet%20to%20retrieve%20object%20contents.%20Identifies%20an%20anomalous%20spike%20in%20data%20transfer%20from%20an%20S3%20bucket%20based%20on%20GetObject%20API%20call%20and%20BytesTransferred%20out%20field.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FCustomLogs%2FAWSBucketAPILogs-S3BucketDataTransferTimeSeriesAnomaly.yaml%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EGithub%20Query%3A%26nbsp%3B%20%3C%2FA%3EThe%26nbsp%3Bquery%26nbsp%3Bleverages%26nbsp%3BKQL%26nbsp%3Bbuiltin%26nbsp%3Banomaly%26nbsp%3Bdetection%26nbsp%3Balgorithms%26nbsp%3Bto%26nbsp%3Bfind%26nbsp%3Blarge%26nbsp%3Bdeviations%26nbsp%3Bfrom%26nbsp%3Bbaseline%26nbsp%3Bpatterns.%20Sudden%20increase%20in%20amount%20of%20data%20transferred%20from%20S3%20buckets%20can%20be%20indication%20of%20data%20exfiltration%20attempts.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158046iDD4770D0D41D2A96%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2213-Detection-04.png%22%20title%3D%2213-Detection-04.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1211176304%22%20id%3D%22toc-hId--1211176304%22%3EAzure%20Sentinel%20Incident%20Workflow%3C%2FH2%3E%0A%3CP%3EYou%20can%20follow%20the%20tutorial%20%E2%80%93%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsentinel%2Ftutorial-detect-threats-custom%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ecreate%20custom%20analytic%20rules%20based%3C%2FA%3E%20on%20the%20queries%20mentioned%20in%20above%20steps.%20While%20scheduling%20the%20alerts%2C%20we%20will%20run%20the%20analytics%20on%20historical%20data%20already%20ingested%20in%20Sentinel%20so%20as%20to%20trigger%20incidents.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFrom%20the%20incidents%20page%2C%20you%20will%20see%20related%20incidents.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158047i2F7064EF87370C46%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2215-Incidents.png%22%20title%3D%2215-Incidents.png%22%20%2F%3E%3C%2FSPAN%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAfter%20clicking%20on%20the%20Investigate%2C%20it%20will%20open%20Graph%20view%20for%20Incident.%20You%20can%20further%20right%20click%20on%20entities%20and%20show%20related%20alerts.%20Repeat%20the%20same%20for%20alerts%20to%20show%20additional%20related%20entities.%3C%2FP%3E%0A%3CP%3EYou%20can%20then%20see%20similar%20entity%20relationship%20graph%20as%20below.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158048i6C60F6F08453206F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2216-Graph%20view.png%22%20title%3D%2216-Graph%20view.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20also%20see%20Timeline%20view%20of%20the%20triggered%20alerts.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20530px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F158049i1675ADA8B7D185A8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%2217-TimelineView.png%22%20title%3D%2217-TimelineView.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20read%20more%20about%20investigate%20incidents%20at%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsentinel%2Ftutorial-investigate-cases%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3ETutorial%3A%20Investigate%20incidents%20with%20Azure%20Sentinel%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1276336529%22%20id%3D%22toc-hId-1276336529%22%3EConclusion%3C%2FH2%3E%0A%3CP%3EAdversary%20simulation%20or%20vulnerable%20by%20design%20labs%20are%20great%20sources%20for%20generating%20interesting%20data%20on%20which%20a%20defender%20can%20write%20new%20detection%20or%20validate%20existing%20detections.%20In%20this%202-part%20series%2C%20we%20demonstrated%20how%20Cloudgoat%20provides%20the%20capability%20to%20simulate%20the%20attack%20scenario%20by%20deploying%20vulnerable%20resources%20and%20conducting%20the%20attacks.%20While%20conducting%20the%20simulation%2C%20we%20enabled%20relevant%20log%20data%20types%2C%20ingested%20them%20into%20Azure%20Sentinel%20and%20analyzed%20the%20events%20to%20correlate%20the%20attack%20activity.%20Although%20there%20is%20no%20built-in%20connector%20support%20currently%20for%20some%20data%20types%2C%20such%20as%20AWS%20S3%20bucket%20API%20logs%2C%20we%20can%20ingest%20these%20as%20custom%20log%20sources%20via%20other%20methods%20such%20as%20the%20Logstash%20method%20described%20in%20this%20article.%3C%2FP%3E%0A%3CP%3EOnce%20we%20have%20relevant%20data%20sources%20onboarded%20to%20Azure%20sentinel%2C%20we%20can%20start%20mapping%20published%20resources%20to%20MITRE%20ATT%26amp%3BCK%20Techniques%20and%20turn%20them%20into%20detection%20or%20hunting%20queries.%20In%20the%20real%20world%2C%20separating%20interesting%20events%20from%20normal%20behavior%20can%20be%20challenging%20for%20analysts%2C%20therefore%2C%20developing%20and%20maintaining%20detections%20or%20hunting%20queries%20mapping%20to%20MITRE%20ATT%26amp%3BCK%20Techniques%20can%20help%20you%20in%20detecting%20attacks%20at%20earlier%20stages.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20are%20looking%20for%20similar%20list%20of%20security%20alerts%20on%20Azure%20storage%20accounts%2C%20be%20sure%20to%20check%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsecurity-center%2Fsecurity-center-alerts-data-services%23azure-storage%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAdvanced%20Threat%20Protection%20for%20Storage.%3C%2FA%3E%26nbsp%3B%20Advanced%20Threat%20Protection%20for%20Storage%20provides%20an%20additional%20layer%20of%20security%20intelligence%20that%20detects%20unusual%20and%20potentially%20harmful%20attempts%20to%20access%20or%20exploit%20storage%20accounts.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFeel%20free%20to%20submit%20your%20own%20queries%20to%20the%20public%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sentinel%20github%3C%2FA%3E%20for%20review%20and%20eventual%20inclusion%20in%20the%20Azure%20Sentinel%20User%20Interface.%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAdditionally%2C%20if%20you%20have%20additional%20feedback%2C%20you%20can%20reach%20out%20to%20me%20via%20%3CA%20href%3D%22https%3A%2F%2Ftwitter.com%2Fashwinpatil%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3ETwitter%3C%2FA%3E.%20Happy%20Hunting.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENote%3A%20Also%20read%20more%20about%20%3CA%20href%3D%22https%3A%2F%2Faws.amazon.com%2Fblogs%2Fsecurity%2Fdefense-in-depth-open-firewalls-reverse-proxies-ssrf-vulnerabilities-ec2-instance-metadata-service%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EEC2%20Instance%20Metadata%20Service%20(IMDSv2)%3C%2FA%3E%26nbsp%3Bpublished%20yesterday%20on%2019th%20at%20AWS%20Security%20blogs.%26nbsp%3BIMDSv2%20adds%20new%20%E2%80%9Cbelt%20and%20suspenders%E2%80%9D%20protections%20such%20as%26nbsp%3Brestricting%20IAM%20roles%20and%20using%20local%20firewall%20rules%20to%20restrict%20access%20to%20the%20IMDS.%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--531117934%22%20id%3D%22toc-hId--531117934%22%3EReferences%3C%2FH2%3E%0A%3CUL%3E%0A%3CLI%3EHunting%20for%20Capital%20One%20Breach%20TTPs%20in%20AWS%20logs%20using%20Azure%20Sentinel%20-%20Part%20I%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FAzure-Sentinel%2FHunting-for-Capital-One-Breach-TTPs-in-AWS-logs-using-Azure%2Fba-p%2F1014258%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2FAzure-Sentinel%2FHunting-for-Capital-One-Breach-TTPs-in-AWS-logs-using-Azure%2Fba-p%2F1014258%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ELogging%20Data%20Events%20with%20the%20AWS%20Management%20Console%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.aws.amazon.com%2Fawscloudtrail%2Flatest%2Fuserguide%2Flogging-management-and-data-events-with-cloudtrail.html%23logging-data-events%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.aws.amazon.com%2Fawscloudtrail%2Flatest%2Fuserguide%2Flogging-management-and-data-events-with-cloudtrail.html%23logging-data-events%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAzure%20Log%20Analytics%20output%20plugin%20for%20Logstash%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fyokawasa%2Flogstash-output-azure_loganalytics%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fyokawasa%2Flogstash-output-azure_loganalytics%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAWS%20CLI%20%E2%80%93%20S3%20API%20Command%20References%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.aws.amazon.com%2Fcli%2Flatest%2Freference%2Fs3api%2Findex.html%23cli-aws-s3api%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.aws.amazon.com%2Fcli%2Flatest%2Freference%2Fs3api%2Findex.html%23cli-aws-s3api%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ELogstash%20S3%20input%20plugin%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.elastic.co%2Fguide%2Fen%2Flogstash%2Fcurrent%2Fplugins-inputs-s3.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.elastic.co%2Fguide%2Fen%2Flogstash%2Fcurrent%2Fplugins-inputs-s3.html%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ECloudTrail%20Log%20Event%20Reference%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.aws.amazon.com%2Fawscloudtrail%2Flatest%2Fuserguide%2Fcloudtrail-event-reference.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.aws.amazon.com%2Fawscloudtrail%2Flatest%2Fuserguide%2Fcloudtrail-event-reference.html%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAWS%20S3%20Logjam%3A%20Server%20Access%20Logging%20vs.%20Object-Level%20Logging%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.netskope.com%2Fblog%2Faws-s3-logjam-server-access-logging-vs-object-level-logging%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.netskope.com%2Fblog%2Faws-s3-logjam-server-access-logging-vs-object-level-logging%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAWS%20S3%20Operations%20on%20Objects%20%E2%80%93%20Get%20Object%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.aws.amazon.com%2FAmazonS3%2Flatest%2FAPI%2FRESTObjectGET.html%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.aws.amazon.com%2FAmazonS3%2Flatest%2FAPI%2FRESTObjectGET.html%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%3EList%20of%20Security%20alerts%20for%20Advanced%20Threat%20Protection%20for%20Storage%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsecurity-center%2Fsecurity-center-alerts-data-services%23azure-storage%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsecurity-center%2Fsecurity-center-alerts-data-services%23azure-storage%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAzure%20Sentinel%20Pull%20Request%20%3A%20Logstash%20Parser%2C%20Sentinel%20hunting%20queries%20for%20AWS%20Cloudtrail%20and%20S3BucketAPILogs%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fcommit%2F083781f95c18e56a990df6751b04e6746e5bbba5%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fcommit%2F083781f95c18e56a990df6751b04e6746e5bbba5%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAdd%20defense%20in%20depth%20against%20open%20firewalls%2C%20reverse%20proxies%2C%20and%20SSRF%20vulnerabilities%20with%20enhancements%20to%20the%20EC2%20Instance%20Metadata%20Service%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Faws.amazon.com%2Fblogs%2Fsecurity%2Fdefense-in-depth-open-firewalls-reverse-proxies-ssrf-vulnerabilities-ec2-instance-metadata-service%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Faws.amazon.com%2Fblogs%2Fsecurity%2Fdefense-in-depth-open-firewalls-reverse-proxies-ssrf-vulnerabilities-ec2-instance-metadata-service%2F%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1019767%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EIn%20the%20second%20part%2C%20we%20will%20analyze%20logs%20generated%20from%20simulation%20and%20see%20how%20we%20can%20hunt%20for%20some%20of%20the%20attacker%20techniques%20from%20AWS%20data%20sources%20on%20boarded%20to%20Azure%20Sentinel.%20%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Microsoft

In the first part of 2-part series , we performed attack simulation of Capital one Breach scenario using Cloud Goat scenario - cloud_breach_s3 . In this second part, we will analyze logs generated from simulation and see how we can hunt for some of the attacker techniques from AWS data sources on boarded to Azure Sentinel. We will also walk-through how to ingest relevant data sources, develop detection or hunting queries using Kusto Query Language(KQL) and also use Azure Sentinel incident workflow and investigation features.

 

Identify Threat Hunting opportunities in AWS Logs.

If you have not seen it already, read our blogpost Identifying Threat Hunting opportunities in your data to understand potential threat hunting approaches across your data sources. 

The goal of this blog is walk through an attack simulation to identify what activities show up in logs and can be converted into Detection or Hunting queries to provide proactive protection capabilities in the future. In the first part of this blog we performed the attack simulation and therefore know the suspicious entities involved. We can start mapping those entities to relevant data types and then investigate further. AWS has several data types that capture information related to API and network activities, but in this case, we are limiting our investigation to AWS CloudTrail and S3 Bucket API logging to monitor file level operations. These datasources are primary logging datasources and provide best coverage of all activity. We also enabled GuardDuty during the simulation to see if any of its built-in alerts trigger.

 

The below table represents entities involved in attack mapped against potential data sources.

01-Entity Details.png

 

Storage access Logging vs Object Level Logging

To monitor file level operations in S3 buckets, there are 2 types of logs available storage access logs and S3 object level API logs. However, for Incident response and detection purposes, S3 object level logging is recommended as it includes more services, comes with detailed and structured log format and additionally promises timeliness and reliable log delivery. This blog AWS S3 Logjam: Server Access Logging vs. Object-Level Logging is a recommended read which goes deeper and explains the differences between both log formats and pros and cons of each.

 

Enable S3 Object Level Logging

To enable S3 object logging, you need to create new CloudTrail with destination as S3 bucket.

Navigate to the CloudTrail Console.  Go to Event history and in Create a trail select Create trail.

02-Enable Object logging.png

 

In Trails, Enter a trail name, Select Apply trail to all regions else to cover all buckets from all regions. In the same window, Under navigate to the S3 Tab, select all S3 buckets in your account with Read and Write selected as shown in below screenshot. This will enable logging for all existing as well newly created buckets. You also have option to selectively go to specific bucket and enable object level logging for existing buckets.

 

Refer AWS guidance:  How Do I Enable Object-Level Logging for an S3 Bucket with AWS CloudTrail Data Events?

 

03-Create Trail.png

 

Follow the Amazon S3 Bucket Naming Requirements as specified in AWS documentation.

03-Create Trail-02.png

 

After creating the trail, make sure status shows Green and multi-region trail as Yes as per below screenshot.

04-Verify Trail Status.png

 

Ingest S3 Logs to Azure Sentinel via Logstash

Currently you can use the AWS connector to stream all your AWS CloudTrail events into Azure Sentinel by using the instructions at Connect Azure Sentinel to AWS CloudTrail. It currently only ingests management events and does not support Data Events logged to S3 bucket. While our Product Engineering team works through adding support for other services and improving connector coverage, Azure Sentinel has multiple option to ingest Custom Logs from such unsupported sources.  You can also read about it in our tech community blog post  - Azure Sentinel: Creating Custom Connectors.

For this article, we are going to use Logstash, which has an S3 input plugin and a Log Analytics output plugin available. Please check the Azure Sentinel GitHub wiki Ingest Custom Logs using Logstash for detailed installation steps of Logstash and how to use a sample configuration file to send logs to Azure Sentinel. In order to parse json logs from an S3 bucket, you can use the configuration file available in Azure Sentinel under section Parsers -  input-aws_s3-output-loganalytics.conf 

 

For better understanding, you can check below diagram on how data ingestion will take place.

05-Logstash setup.png

 

Writing Detections/Hunting query for TTPs

Now we have entities and ingested relevant data sources, let’s start looking into what logs are available for investigation. You can start with free text search queries for each of these using the KQL ‘search’ function.

For example:

 

 

 

 

search "51.141.184.127"
| summarize count() by $table

 

 

 

 

 

06-KQL Query.png

 

You can also start looking at sample events to identify key attributable columns for UserIdentity, IP address, S3 bucket name and so on. The below screenshot shows a sample event from AWSCloudTrail connector of the UserIdentity == Cloudgoat adding IP Addresses provided during whitelisting at resource deployment.

 

 

 

 

search "51.141.184.127"
| where $table = 'AWSCloudTrail'

 

 

 

 

 

07-SampleEvent-cloudgoat.png

 

Another event shows, sample GetObject API call made to the S3 bucket and downloading resources from it. You can use AWSS3BucketAPILogsParser we have published in Github which has normalized column names to better align with CloudTrail event schema. Follow the parser notes to create a function and use below query to take a sample event.

 

 

 

 

AWSS3BucketAPILogParsed 
| where SourceIPAddress == "51.141.184.127"
| where EventName == "GetObject"

 

 

 

 

08-SampleEvent-GetObject.png

 

After completing queries for each of the entities from the table, we can populate the Entity to datasource mapping table below, where green indicates it is present in the data type and Red indicates it is not present. The number indicates the count of events. Also, add any interesting event types from monitoring/alerting perspective.

 

09-Entity DataSource Details.png

 

Detection and Hunting Queries

T1078: Privileged role attached to Instance

This technique maps back to initial vulnerable resources associated with scenario deployed by cloudgoat.
Github Query Link : This query looks for when a Privileged role is attached to existing instance or new instance at deployment. This instance may be used by adversary to escalate normal user privileges to administrative user. There may be legitimate use cases in case of cross account access to do administrator activity, in such cases whitelisting the UserIdentity invoking and RoleName combinations based on historical analysis will reduce False positives.

 

10-Detection-01.png

 

T1078 : Suspicious credential token access of valid IAM Roles

This log is a result of second command from scenario cheatsheet which requested temp credentials via curl request.

Github Query Link : This query will look for AWS STS API Assume Role operations for RoleArn (Role Amazon Resource Names) which was not historically seen invoked by Useridentity

 

11-Detection-02.png

 

T1530 : Suspicious Data Access to S3 Bucket from Unknown IP address.

This technique is a result of third and last command executed from scenario cheatsheet to use IAM role credentials retrieved from previous steps to list buckets and retrieve object contents.

Github query : This query will look for any access originating from Source IP which was not seen historically accessing the bucket or downloading files from it via AWS S3 API.

 

12-Detection-03.png

 

T1020 : S3 Bucket outbound Data transfer anomaly

This technique is a result of s3 sync command executed from scenario cheatsheet to retrieve object contents. Identifies an anomalous spike in data transfer from an S3 bucket based on GetObject API call and BytesTransferred out field.

Github Query:  The query leverages KQL builtin anomaly detection algorithms to find large deviations from baseline patterns. Sudden increase in amount of data transferred from S3 buckets can be indication of data exfiltration attempts.

 

13-Detection-04.png

 

Azure Sentinel Incident Workflow

You can follow the tutorial – create custom analytic rules based on the queries mentioned in above steps. While scheduling the alerts, we will run the analytics on historical data already ingested in Sentinel so as to trigger incidents.

 

From the incidents page, you will see related incidents.

15-Incidents.png 

After clicking on the Investigate, it will open Graph view for Incident. You can further right click on entities and show related alerts. Repeat the same for alerts to show additional related entities.

You can then see similar entity relationship graph as below.

 

16-Graph view.png

 

You can also see Timeline view of the triggered alerts.

17-TimelineView.png

 

You can read more about investigate incidents at Tutorial: Investigate incidents with Azure Sentinel.

 

Conclusion

Adversary simulation or vulnerable by design labs are great sources for generating interesting data on which a defender can write new detection or validate existing detections. In this 2-part series, we demonstrated how Cloudgoat provides the capability to simulate the attack scenario by deploying vulnerable resources and conducting the attacks. While conducting the simulation, we enabled relevant log data types, ingested them into Azure Sentinel and analyzed the events to correlate the attack activity. Although there is no built-in connector support currently for some data types, such as AWS S3 bucket API logs, we can ingest these as custom log sources via other methods such as the Logstash method described in this article.

Once we have relevant data sources onboarded to Azure sentinel, we can start mapping published resources to MITRE ATT&CK Techniques and turn them into detection or hunting queries. In the real world, separating interesting events from normal behavior can be challenging for analysts, therefore, developing and maintaining detections or hunting queries mapping to MITRE ATT&CK Techniques can help you in detecting attacks at earlier stages. 

 

If you are looking for similar list of security alerts on Azure storage accounts, be sure to check 

Advanced Threat Protection for Storage.  Advanced Threat Protection for Storage provides an additional layer of security intelligence that detects unusual and potentially harmful attempts to access or exploit storage accounts.

 

Feel free to submit your own queries to the public Azure Sentinel github for review and eventual inclusion in the Azure Sentinel User Interface. 

Additionally, if you have additional feedback, you can reach out to me via Twitter. Happy Hunting.

 

Note: Also read more about EC2 Instance Metadata Service (IMDSv2) published yesterday on 19th at AWS Security blogs. IMDSv2 adds new “belt and suspenders” protections such as restricting IAM roles and using local firewall rules to restrict access to the IMDS. 

References

  • Hunting for Capital One Breach TTPs in AWS logs using Azure Sentinel - Part I

https://techcommunity.microsoft.com/t5/Azure-Sentinel/Hunting-for-Capital-One-Breach-TTPs-in-AWS-log...

  • Logging Data Events with the AWS Management Console

https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-c...

  • Azure Log Analytics output plugin for Logstash

https://github.com/yokawasa/logstash-output-azure_loganalytics

  • AWS CLI – S3 API Command References

https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html#cli-aws-s3api

  • Logstash S3 input plugin

https://www.elastic.co/guide/en/logstash/current/plugins-inputs-s3.html

  • CloudTrail Log Event Reference

https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-event-reference.html

  • AWS S3 Logjam: Server Access Logging vs. Object-Level Logging

https://www.netskope.com/blog/aws-s3-logjam-server-access-logging-vs-object-level-logging

  • AWS S3 Operations on Objects – Get Object

https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectGET.html

  • List of Security alerts for Advanced Threat Protection for Storage

https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-data-services#azure-st...

  • Azure Sentinel Pull Request : Logstash Parser, Sentinel hunting queries for AWS Cloudtrail and S3BucketAPILogs

https://github.com/Azure/Azure-Sentinel/commit/083781f95c18e56a990df6751b04e6746e5bbba5

  • Add defense in depth against open firewalls, reverse proxies, and SSRF vulnerabilities with enhancements to the EC2 Instance Metadata Service

https://aws.amazon.com/blogs/security/defense-in-depth-open-firewalls-reverse-proxies-ssrf-vulnerabi...