Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1344431%22%20slang%3D%22en-US%22%3EHunting%20Threats%20on%20Linux%20with%20Azure%20Sentinel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1344431%22%20slang%3D%22en-US%22%3E%3CH2%20id%3D%22toc-hId--1355389966%22%20id%3D%22toc-hId--1355389966%22%3EIntroduction%3C%2FH2%3E%0A%3CP%3EAll%20sorts%20of%20activity%20and%20security%20data%20can%20be%20collected%20by%20Azure%20Sentinel%20for%20storage%20and%20mining.%26nbsp%3B%20The%20Syslog%20data%20collector%20is%20good%20for%20collecting%20data%20from%20Linux%20platforms%20but%20needs%20a%20helping%20hand%20to%20access%20information%20produced%20by%20the%20Linux%20kernel%E2%80%99s%20audit%20subsystem%2C%20%3CEM%3Ekaudit%3C%2FEM%3E%2C%20and%20the%20optional%20user-space%26nbsp%3B%20daemon%2C%20%3CEM%3Eauditd%3C%2FEM%3E.%26nbsp%3B%20These%20components%20can%20be%20configured%20to%20generate%20event%20data%20when%20syscalls%20are%20invoked%2C%20such%20as%20process%20creations%2C%20file%20access%2C%20and%20other%20telemetry%20that%20could%20be%20used%20to%20identify%20malicious%20activity.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhile%20it%20is%20possible%20to%20use%20the%20%3CEM%3Eaudisp%3C%2FEM%3E%20daemon%20to%20redirect%20auditd%20events%20to%20syslog%2C%20there%20are%20a%20couple%20of%20potential%20problems%20with%20this%20approach.%26nbsp%3B%20The%20first%20issue%20is%20that%20while%20kaudit%20is%20a%20standard%20component%20on%20most%20Linux%20distributions%2C%20the%20user-space%20daemon%20auditd%20is%20not%2C%20and%20audisp%20relies%20on%20auditd%20to%20work.%26nbsp%3B%20The%20second%20issue%20is%20that%20audisp%20simply%20forwards%20the%20auditd%20event%20data%20without%20any%20filtering%20or%20processing.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFiltering%20events%20is%20essential%20to%20reduce%20the%20noise%20generated%20by%20known%20system%20tools%20that%20run%20regularly%3B%20these%20include%20cron%20jobs%20to%20rotate%20logs%20and%20system%20tools%20that%20ensure%20software%20is%20kept%20up%20to%20date.%26nbsp%3B%20There%20is%20usually%20little%20need%20to%20see%20this%20data%20in%20your%20SIEM%20and%20filtering%20it%20at%20the%20source%20reduces%20bandwidth%20and%20storage%20requirements.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESimilarly%2C%20event%20processing%20is%20important%20to%20enrich%20the%20data%20so%20that%20it%20makes%20more%20sense%20when%20it%20is%20mined.%26nbsp%3B%20The%20Linux%20audit%20sub-system%20uses%20numerical%20values%20for%20a%20range%20of%20identifiers%2C%20and%20these%20need%20to%20be%20converted%20into%20corresponding%20names%20for%20them%20to%20make%20sense.%26nbsp%3B%20It%E2%80%99s%20possible%20to%20do%20this%20in%20the%20SIEM%20but%20it%20is%20easier%20if%20this%20happens%20before%20the%20events%20leave%20the%20machine%20that%20generated%20them.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20Microsoft%20audit%20collection%20tool%2C%20%3CEM%3EAUOMS%3C%2FEM%3E%2C%20includes%20configurable%20filtering%20and%20processing%20steps%2C%20collects%20events%20from%20either%20kaudit%20or%20auditd%2Faudisp%2C%20and%20outputs%20them%20in%20a%20range%20of%20formats%20to%20specified%20locations%20and%20pipes.%26nbsp%3B%20The%20MSTIC%20(Microsoft%20Threat%20Intelligence%20Center)%20research%20branch%20of%20AUOMS%20can%20be%20used%20to%20forward%20events%20to%20the%20syslog%2C%20from%20where%20they%20can%20be%20collected%20by%20Azure%20Sentinel.%26nbsp%3B%20This%20blog%20post%20will%20describe%20how%20to%20install%20this%20branch%20of%20AUOMS%20and%20configure%20Azure%20Sentinel%20to%20collect%20the%20events.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20blog%20post%2C%20we%20will%20cover%20how%20to%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EInstall%20the%20OMS%20(Operations%20Management%20Suite)%20agent%20that%20Azure%20Sentinel%20will%20use%20to%20collect%20the%20syslog%3C%2FLI%3E%0A%3CLI%3EInstall%20the%20MSTIC-Research%20branch%20of%20AUOMS%3C%2FLI%3E%0A%3CLI%3EConfigure%20Azure%20Sentinel%20to%20collect%20the%20events%3C%2FLI%3E%0A%3CLI%3EBuild%20useful%20functions%20in%20Azure%20Sentinel%20to%20aid%20threat%20hunting%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EAzure%20Sentinel%20also%20supports%20the%20use%20of%20Jupyter%20Notebooks%20and%20Ian%20Hellen%20has%20already%20written%20a%20great%20blog%20post%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-sentinel%2Fusing-threat-intelligence-in-your-jupyter-notebooks%2Fba-p%2F860239%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3EJupyter%20Notebooks%20in%20Sentinel%3C%2FA%3E%20which%20covers%20their%20use.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1132122867%22%20id%3D%22toc-hId-1132122867%22%3ECreate%20an%20Azure%20Sentinel%20Workspace%3C%2FH2%3E%0A%3CP%3EIf%20you%20don%E2%80%99t%20already%20have%20an%20Azure%20Sentinel%20workspace%2C%20then%20you%E2%80%99ll%20need%20to%20create%20one.%26nbsp%3B%20The%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fsentinel%2Fquickstart-onboard%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EQuickstart%3C%2FA%3E%20guide%20provides%20details%20on%20the%20prerequisites%20and%20steps%20to%20create%20an%20Azure%20Sentinel%20workspace.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--675331596%22%20id%3D%22toc-hId--675331596%22%3EInstall%20OMS%20Agent%3C%2FH2%3E%0A%3CP%3EThe%20Operations%20Management%20Suite%20agent%20is%20used%20by%20Azure%20Sentinel%20to%20collect%20the%20syslog.%26nbsp%3B%20Installing%20it%20is%20straight%20forward%20and%20is%20covered%20in%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Flearn%2Fquick-collect-linux-computer%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ethis%20related%20blog%20post%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1812181237%22%20id%3D%22toc-hId-1812181237%22%3EInstall%20MSTIC-Research%20Branch%20of%20AUOMS%3C%2FH2%3E%0A%3CP%3EInstalling%20our%20research%20branch%20of%20AUOMS%20is%20a%20three%20step%20process%3A%20the%20first%20step%20is%20to%20install%20the%20required%20mainline%20packages%3B%20the%20second%20step%20is%20to%20download%20and%20compile%20the%20source%3B%20and%20the%20third%20step%20is%20to%20copy%20the%20programs%20and%20configuration%20files%20to%20the%20correct%20locations.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1792224585%22%20id%3D%22toc-hId--1792224585%22%3EPrerequisites%3C%2FH3%3E%0A%3CP%3EAUOMS%20requires%20the%20following%20packages%2C%20which%20can%20be%20installed%20as%20follows%20on%20Ubuntu%20Linux%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3Esudo%20apt%20install%20rapidjson-dev%20libmsgpack-dev%20libxml2-dev%20libboost-all-dev%20libaudit-dev%20libauparse-dev%20build-essential%20cmake%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOther%20distributions%20may%20require%20different%20commands%20and%20some%20of%20the%20packages%20may%20have%20slightly%20different%20names.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-695288248%22%20id%3D%22toc-hId-695288248%22%3EBuild%20MSTIC-Research%20Branch%20of%20AUOMS%3C%2FH3%3E%0A%3CP%3EThe%20source%20code%20of%20AUOMS%20is%20available%20on%20Github.%20Enter%20the%20following%20commands%20to%20download%20and%20build%20the%20project%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3Egit%20clone%20https%3A%2F%2Fgithub.com%2Fmicrosoft%2FOMS-Auditd-Plugin.git%0Acd%20OMS-Auditd-Plugin%0Agit%20checkout%20MSTIC-Research%0Acmake%20.%0Amake%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1112166215%22%20id%3D%22toc-hId--1112166215%22%3EInstall%3C%2FH3%3E%0A%3CP%3EOnce%20the%20source%20code%20has%20been%20compiled%2C%20the%20program%20and%20its%20configuration%20files%20need%20to%20be%20copied%20to%20the%20correct%20locations.%26nbsp%3B%20You%20shouldn%E2%80%99t%20need%20to%20edit%20the%20auoms.conf%20file%3B%20you%20may%20edit%20the%20syslog.conf%20file%20to%20modify%20the%20event%20filtering%20and%20processing%2C%20and%20you%20may%20edit%20the%20mstic-research.rules%20file%20to%20change%20which%20events%20are%20generated.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEnter%20the%20following%20commands%20to%20install%20the%20AUOMS%20agent%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3Esudo%20cp%20auoms%20auomscollect%20auomsctl%20%2Fopt%2Fmicrosoft%2Fauoms%2Fbin%0Asudo%20cp%20conf%2Fauoms.conf%20%2Fetc%2Fopt%2Fmicrosoft%2Fauoms%0Asudo%20cp%20conf%2Foutconf.d%2Ftestout.conf%20%2Fetc%2Fopt%2Fmicrosoft%2Fauoms%2Foutconf.d%2Fsyslog.conf%0Asudo%20cp%20rules%2Fmstic-research.rules%20%2Fetc%2Fopt%2Fmicrosoft%2Fauoms%2Frules.d%0Asudo%20service%20auoms%20start%0Asudo%20update-rc.d%20auoms%20defaults%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1375346618%22%20id%3D%22toc-hId-1375346618%22%3EIf%20Auditd%2FAudisp%20Was%20Already%20Installed%20Before%20the%20OMS%20Agent%3C%2FH3%3E%0A%3CP%3EIf%20you%20are%20installing%20OMS%20Agent%20and%20AUOMS%20on%20a%20computer%20that%20already%20has%20auditd%20(including%20audisp)%20installed%2C%20or%20you%20later%20install%20auditd%20on%20a%20computer%20after%20installing%20OMS%20Agent%20and%20AUOMS%2C%20then%20you%20will%20need%20the%20following%20additional%20configuration%20steps%20to%20use%20AUOMS%20in%20this%20scenario%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3Esudo%20service%20auoms%20stop%0Asudo%20service%20auditd%20stop%0Asudo%20sed%20-i%20-e%20's%2Factive%20%3D%20no%2Factive%20%3D%20yes%2F'%20%2Fetc%2Faudisp%2Fplugins.d%2Fauoms.conf%0Asudo%20update-rc.d%20auditd%20defaults%0Asudo%20service%20auditd%20start%0Asudo%20service%20auoms%20start%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENote%2C%20auditd%20can%20be%20installed%20with%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3Esudo%20apt%20install%20auditd%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--432107845%22%20id%3D%22toc-hId--432107845%22%3EDescription%20of%20Event%20Types%3C%2FH3%3E%0A%3CP%3EThe%20mstic-research.rules%20file%20(installed%20into%20%2Fetc%2Fopt%2Fmicrosoft%2Fauoms%2Frules.d)%20contains%20the%20kaudit%2Fauditd%20rules%20that%20generate%20event%20records.%26nbsp%3B%20These%20rules%20initially%20report%20on%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EProcess%20creations%20using%20execve%20and%20execveat%3C%2FLI%3E%0A%3CLI%3EKernel%20module%20loading%20and%20unloading%3C%2FLI%3E%0A%3CLI%3EUse%20of%20the%20%3CEM%3Eptrace%3C%2FEM%3E%20debugging%20interface%3C%2FLI%3E%0A%3CLI%3EMapping%20of%20memory%20pages%20with%20%3CEM%3Ewrite%3C%2FEM%3E%20and%20%3CEM%3Eexecute%3C%2FEM%3E%20permissions%20(excluding%20just-in-time%20compilation%20languages%2C%20such%20as%20Python)%3C%2FLI%3E%0A%3CLI%3EAggressive%20killing%20of%20processes%20using%20signal%209%20(kill)%20and%20pausing%20of%20processes%20with%20signal%2019%20(stop)%3C%2FLI%3E%0A%3CLI%3EChanges%20to%20a%20selection%20of%20critical%20system%20files%3C%2FLI%3E%0A%3CLI%3EChanges%20to%20the%20system%20clock%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EYou%20may%20edit%20this%20file%20to%20change%20these%20rules%20to%20suit%20your%20environment.%26nbsp%3B%20The%20AUOMS%20agent%20will%20automatically%20notice%20the%20change%20when%20the%20file%20is%20written%20and%20will%20load%20the%20new%20rules.%26nbsp%3B%20You%20can%20check%20which%20rules%20are%20in%20use%20with%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-bash%22%3E%3CCODE%3Esudo%20%2Fopt%2Fmicrosoft%2Fauoms%2Fbin%2Fauomsctl%20-l%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-2055404988%22%20id%3D%22toc-hId-2055404988%22%3EDescription%20of%20Process%20Filters%3C%2FH3%3E%0A%3CP%3EThe%20syslog.conf%20file%20(installed%20into%20%2Fetc%2Fopt%2Fmicrosoft%2Fauoms%2Foutconf.d)%20contains%20the%20filter%20descriptions%20that%20specify%20which%20processes%20and%20syscalls%20are%20excluded%20from%20being%20reported%20upon.%26nbsp%3B%20The%20initial%20configuration%20filters%20events%20from%20the%20following%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EThe%20Microsoft%20OMS%20software%3C%2FLI%3E%0A%3CLI%3EThe%20%3CEM%3Econnect%2C%20openat%2C%20unlink%2C%3C%2FEM%3E%20and%20%3CEM%3Efchown%3C%2FEM%3E%20syscalls%20for%20the%20%3CEM%3Edpkg%3C%2FEM%3E%20and%20%3CEM%3Erpm%3C%2FEM%3E%20package%20managers%3C%2FLI%3E%0A%3CLI%3EThe%20logrotate%20cron%20jobs%20that%20rotate%20the%20OMS%20logs%3C%2FLI%3E%0A%3CLI%3EThe%20%3CEM%3Econnect%3C%2FEM%3E%20syscall%20for%20the%20%3CEM%3Esystemd-resolved%3C%2FEM%3E%20and%20%3CEM%3Enscd%3C%2FEM%3E%20domain%20name%20resolvers%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3ENote%20that%20the%20provided%20rules%20aren%E2%80%99t%20configured%20to%20generate%20events%20from%20the%20%3CEM%3Econnect%3C%2FEM%3E%20syscall%20and%20that%20the%20filters%20to%20block%20it%20are%20provided%20as%20examples%20only.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--576295673%22%20id%3D%22toc-hId--576295673%22%3EConfigure%20Azure%20Sentinel%20To%20Collect%20Events%3C%2FH2%3E%0A%3CP%3ENow%20that%20AUOMS%20is%20generating%20audit%20events%20and%20sending%20them%20to%20the%20syslog%2C%20we%20need%20to%20configure%20Azure%20Sentinel%20to%20collect%20them.%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ELog%20into%20the%20Azure%20Portal%20at%20%3CSTRONG%3Eportal.azure.com%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3EType%20%3CEM%3Esentinel%3C%2FEM%3E%20into%20the%20search%20box%20and%20select%20%3CSTRONG%3EAzure%20Sentinel%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3EClick%20on%20your%20Sentinel%20workspace%2C%20then%20%3CSTRONG%3ESettings%3C%2FSTRONG%3E%2C%20then%20%3CSTRONG%3EWorkspace%20settings%3C%2FSTRONG%3E%2C%20and%20then%20%3CSTRONG%3EAdvanced%20settings%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3EClick%20on%20%3CSTRONG%3EData%3C%2FSTRONG%3E%2C%20then%20%3CSTRONG%3ESyslog%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3ECheck%20the%20%3CSTRONG%3EApply%20below%20configuration%20to%20my%20machines%20%3C%2FSTRONG%3Echeckbox%3C%2FLI%3E%0A%3CLI%3EType%20%3CEM%3Euser%3C%2FEM%3E%20into%20the%20box%20and%20click%20the%20%3CSTRONG%3E%2B%3C%2FSTRONG%3E%20button.%26nbsp%3B%20Ensure%20the%20%3CSTRONG%3EInfo%3C%2FSTRONG%3E%20level%20checkbox%20is%20checked%3C%2FLI%3E%0A%3CLI%3EClick%20%3CSTRONG%3ESave%3C%2FSTRONG%3E%20and%20then%20%3CSTRONG%3EOK%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1911217160%22%20id%3D%22toc-hId-1911217160%22%3EView%20Events%2C%20Build%20Functions%2C%20and%20Hunt%20Threats%3C%2FH2%3E%0A%3CP%3EThe%20events%20will%20start%20to%20be%20collected%20and%20may%20take%20fifteen%20minutes%20to%20arrive.%26nbsp%3B%20The%20raw%20events%20can%20be%20viewed%20as%20follows%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ENavigate%20to%20your%20Sentinel%20workspace%2C%20then%20click%20%3CSTRONG%3ELogs%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3EIf%20the%20example%20queries%20dialog%20is%20displayed%2C%20close%20it%20by%20clicking%20the%20%3CSTRONG%3EX%3C%2FSTRONG%3E%20in%20the%20top%20right%3C%2FLI%3E%0A%3CLI%3EIn%20the%20query%20box%2C%20type%20%3CEM%3ESyslog%3C%2FEM%3E%20and%20click%20the%20%3CSTRONG%3ERun%3C%2FSTRONG%3E%20button%3C%2FLI%3E%0A%3C%2FOL%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%20image-alt%3D%22AUOMS_Syslog2.png%22%20style%3D%22width%3A%20576px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F187223i15BC14205666CA77%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22AUOMS_Syslog2.png%22%20alt%3D%22AUOMS_Syslog2.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESyslog%20events%20will%20appear%20in%20the%20results%20window.%26nbsp%3B%20Note%20that%20the%20audit%20event%20data%20is%20contained%20in%20the%20%3CSTRONG%3ESyslogMessage%3C%2FSTRONG%3E%20column.%26nbsp%3B%20This%20column%20can%20be%20parsed%20to%20extract%20the%20%3CSTRONG%3EEventType%3C%2FSTRONG%3E.%26nbsp%3B%20Example%20parsers%20have%20been%20uploaded%20to%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Ftree%2Fmaster%2FParsers%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Sentinel%20GitHub%3C%2FA%3E%20to%20demonstrate%20how%20to%20parse%20process%20creations%20(execve)%2C%20syscalls%2C%20and%20user%20errors%20such%20as%20logon%20failures.%26nbsp%3B%20These%20can%20be%20saved%20as%20functions%20for%20use%20in%20hunting%20queries.%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%20image-alt%3D%22AUOMS_cmdline.png%22%20style%3D%22width%3A%20602px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F187211i66CCB4AA55050EFE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22AUOMS_cmdline.png%22%20alt%3D%22AUOMS_cmdline.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-232845416%22%20id%3D%22toc-hId-232845416%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--1574609047%22%20id%3D%22toc-hId--1574609047%22%3EThreat%20Hunting%20Example%3C%2FH3%3E%0A%3CP%3EAs%20an%20example%20of%20threat%20hunting%2C%20you%20can%20search%20for%20some%20popular%20crypto%20currency%20miners%20being%20downloaded%20using%20the%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2FAzure-Sentinel%2Fblob%2Fmaster%2FHunting%2520Queries%2FSyslog%2FCryptoCurrencyMiners.yaml%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3ECryptoCurrencyMiners.yaml%20hunting%20query%3C%2FA%3E%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22AUOMS_hunting.png%22%20style%3D%22width%3A%20602px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F187215iC7E0D63C335A9BD6%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22AUOMS_hunting.png%22%20alt%3D%22AUOMS_hunting.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-783821067%22%20id%3D%22toc-hId-783821067%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId--1023633396%22%20id%3D%22toc-hId--1023633396%22%3EConclusion%3C%2FH2%3E%0A%3CP%3EHopefully%2C%20this%20article%20has%20helped%20you%20understand%20how%20easy%20it%20is%20to%20use%20Azure%20Sentinel%20to%20obtain%20audit%20event%20data%20from%20Linux%20machines%20and%20to%20hunt%20for%20threats%20within%20it.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20will%20continue%20to%20develop%20the%20MSTIC-Research%20branch%20of%20the%20AUOMS%20agent%2C%20adding%20additional%20functionality%20and%20improving%20throughput.%20%26nbsp%3BWe%20will%20also%20update%20our%20mstic-research.rules%20file%20with%20extra%20event%20types%20to%20report%2C%20and%20our%20syslog.conf%20file%20with%20extra%20processes%20and%20syscalls%20to%20filter%20out.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1344431%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20to%20use%20AUOMS%20to%20get%20audit%20events%20from%20Linux%20into%20Azure%20Sentinel.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1344431%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Sentinel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EHunting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESecurity%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

Introduction

All sorts of activity and security data can be collected by Azure Sentinel for storage and mining.  The Syslog data collector is good for collecting data from Linux platforms but needs a helping hand to access information produced by the Linux kernel’s audit subsystem, kaudit, and the optional user-space  daemon, auditd.  These components can be configured to generate event data when syscalls are invoked, such as process creations, file access, and other telemetry that could be used to identify malicious activity.

 

While it is possible to use the audisp daemon to redirect auditd events to syslog, there are a couple of potential problems with this approach.  The first issue is that while kaudit is a standard component on most Linux distributions, the user-space daemon auditd is not, and audisp relies on auditd to work.  The second issue is that audisp simply forwards the auditd event data without any filtering or processing.

 

Filtering events is essential to reduce the noise generated by known system tools that run regularly; these include cron jobs to rotate logs and system tools that ensure software is kept up to date.  There is usually little need to see this data in your SIEM and filtering it at the source reduces bandwidth and storage requirements.

 

Similarly, event processing is important to enrich the data so that it makes more sense when it is mined.  The Linux audit sub-system uses numerical values for a range of identifiers, and these need to be converted into corresponding names for them to make sense.  It’s possible to do this in the SIEM but it is easier if this happens before the events leave the machine that generated them.

 

The Microsoft audit collection tool, AUOMS, includes configurable filtering and processing steps, collects events from either kaudit or auditd/audisp, and outputs them in a range of formats to specified locations and pipes.  The MSTIC (Microsoft Threat Intelligence Center) research branch of AUOMS can be used to forward events to the syslog, from where they can be collected by Azure Sentinel.  This blog post will describe how to install this branch of AUOMS and configure Azure Sentinel to collect the events.

 

In this blog post, we will cover how to:

  • Install the OMS (Operations Management Suite) agent that Azure Sentinel will use to collect the syslog
  • Install the MSTIC-Research branch of AUOMS
  • Configure Azure Sentinel to collect the events
  • Build useful functions in Azure Sentinel to aid threat hunting

Azure Sentinel also supports the use of Jupyter Notebooks and Ian Hellen has already written a great blog post Jupyter Notebooks in Sentinel which covers their use.

 

Create an Azure Sentinel Workspace

If you don’t already have an Azure Sentinel workspace, then you’ll need to create one.  The Quickstart guide provides details on the prerequisites and steps to create an Azure Sentinel workspace.

 

Install OMS Agent

The Operations Management Suite agent is used by Azure Sentinel to collect the syslog.  Installing it is straight forward and is covered in this related blog post.

 

Install MSTIC-Research Branch of AUOMS

Installing our research branch of AUOMS is a three step process: the first step is to install the required mainline packages; the second step is to download and compile the source; and the third step is to copy the programs and configuration files to the correct locations.

 

Prerequisites

AUOMS requires the following packages, which can be installed as follows on Ubuntu Linux:

 

sudo apt install rapidjson-dev libmsgpack-dev libxml2-dev libboost-all-dev libaudit-dev libauparse-dev build-essential cmake

 

Other distributions may require different commands and some of the packages may have slightly different names.

 

Build MSTIC-Research Branch of AUOMS

The source code of AUOMS is available on Github. Enter the following commands to download and build the project:

 

git clone https://github.com/microsoft/OMS-Auditd-Plugin.git
cd OMS-Auditd-Plugin
git checkout MSTIC-Research
cmake .
make

 

Install

Once the source code has been compiled, the program and its configuration files need to be copied to the correct locations.  You shouldn’t need to edit the auoms.conf file; you may edit the syslog.conf file to modify the event filtering and processing, and you may edit the mstic-research.rules file to change which events are generated.

 

Enter the following commands to install the AUOMS agent:

 

sudo cp auoms auomscollect auomsctl /opt/microsoft/auoms/bin
sudo cp conf/auoms.conf /etc/opt/microsoft/auoms
sudo cp conf/outconf.d/testout.conf /etc/opt/microsoft/auoms/outconf.d/syslog.conf
sudo cp rules/mstic-research.rules /etc/opt/microsoft/auoms/rules.d
sudo service auoms start
sudo update-rc.d auoms defaults

 

If Auditd/Audisp Was Already Installed Before the OMS Agent

If you are installing OMS Agent and AUOMS on a computer that already has auditd (including audisp) installed, or you later install auditd on a computer after installing OMS Agent and AUOMS, then you will need the following additional configuration steps to use AUOMS in this scenario:

 

sudo service auoms stop
sudo service auditd stop
sudo sed -i -e 's/active = no/active = yes/' /etc/audisp/plugins.d/auoms.conf
sudo update-rc.d auditd defaults
sudo service auditd start
sudo service auoms start

 

Note, auditd can be installed with:

 

sudo apt install auditd

 

Description of Event Types

The mstic-research.rules file (installed into /etc/opt/microsoft/auoms/rules.d) contains the kaudit/auditd rules that generate event records.  These rules initially report on:

  • Process creations using execve and execveat
  • Kernel module loading and unloading
  • Use of the ptrace debugging interface
  • Mapping of memory pages with write and execute permissions (excluding just-in-time compilation languages, such as Python)
  • Aggressive killing of processes using signal 9 (kill) and pausing of processes with signal 19 (stop)
  • Changes to a selection of critical system files
  • Changes to the system clock

You may edit this file to change these rules to suit your environment.  The AUOMS agent will automatically notice the change when the file is written and will load the new rules.  You can check which rules are in use with:

 

sudo /opt/microsoft/auoms/bin/auomsctl -l

 

Description of Process Filters

The syslog.conf file (installed into /etc/opt/microsoft/auoms/outconf.d) contains the filter descriptions that specify which processes and syscalls are excluded from being reported upon.  The initial configuration filters events from the following:

  • The Microsoft OMS software
  • The connect, openat, unlink, and fchown syscalls for the dpkg and rpm package managers
  • The logrotate cron jobs that rotate the OMS logs
  • The connect syscall for the systemd-resolved and nscd domain name resolvers

Note that the provided rules aren’t configured to generate events from the connect syscall and that the filters to block it are provided as examples only.

 

Configure Azure Sentinel To Collect Events

Now that AUOMS is generating audit events and sending them to the syslog, we need to configure Azure Sentinel to collect them.

  1. Log into the Azure Portal at portal.azure.com
  2. Type sentinel into the search box and select Azure Sentinel
  3. Click on your Sentinel workspace, then Settings, then Workspace settings, and then Advanced settings
  4. Click on Data, then Syslog
  5. Check the Apply below configuration to my machines checkbox
  6. Type user into the box and click the + button.  Ensure the Info level checkbox is checked
  7. Click Save and then OK

 

View Events, Build Functions, and Hunt Threats

The events will start to be collected and may take fifteen minutes to arrive.  The raw events can be viewed as follows:

  1. Navigate to your Sentinel workspace, then click Logs
  2. If the example queries dialog is displayed, close it by clicking the X in the top right
  3. In the query box, type Syslog and click the Run button

 

AUOMS_Syslog2.png

 

Syslog events will appear in the results window.  Note that the audit event data is contained in the SyslogMessage column.  This column can be parsed to extract the EventType.  Example parsers have been uploaded to the Azure Sentinel GitHub to demonstrate how to parse process creations (execve), syscalls, and user errors such as logon failures.  These can be saved as functions for use in hunting queries.

 

AUOMS_cmdline.png

 

Threat Hunting Example

As an example of threat hunting, you can search for some popular crypto currency miners being downloaded using the CryptoCurrencyMiners.yaml hunting query:

AUOMS_hunting.png

 

Conclusion

Hopefully, this article has helped you understand how easy it is to use Azure Sentinel to obtain audit event data from Linux machines and to hunt for threats within it.

 

We will continue to develop the MSTIC-Research branch of the AUOMS agent, adding additional functionality and improving throughput.  We will also update our mstic-research.rules file with extra event types to report, and our syslog.conf file with extra processes and syscalls to filter out.