Home
%3CP%3E%3C%2FP%3E%0A%3CP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EA%20variation%20on%20this%20configuration%20is%20where%20we%20might%20have%20include%20and%20exclude%20rules%20on%20the%20same%20event.%20Here%20exclude%20rules%20will%20always%20take%20precedence.%20Thus%20in%20the%20following%20example%20we%20will%20omit%20our%20browser%20events%20when%20the%20browser%20was%20launched%20by%20explorer.exe.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEVENTFILTERING%3E%3C%2FEVENTFILTERING%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CPROCESSCREATE%20onmatch%3D%22%26quot%3Binclude%26quot%3B%22%3E%3C%2FPROCESSCREATE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CCOMMANDLINE%20condition%3D%22%26quot%3Bcontains%26quot%3B%22%3Eiexplore.exe%3C%2FCOMMANDLINE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CCOMMANDLINE%20condition%3D%22%26quot%3Bcontains%26quot%3B%22%3Efirefox.exe%3C%2FCOMMANDLINE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CPROCESSCREATE%20onmatch%3D%22%26quot%3Bexclude%26quot%3B%22%3E%3C%2FPROCESSCREATE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CPARENTIMAGE%20condition%3D%22%26quot%3Bis%26quot%3B%22%3Ec%3A%5Cwindows%5Cexplorer.exe%3C%2FPARENTIMAGE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%20far%20so%20good.%20Most%20users%20I%20speak%20with%20are%20happy%20with%20this.%20Where%20they%20are%20less%20comfortable%20is%20how%20rules%20for%20different%20fields%20are%20combined.%20%26nbsp%3B%26nbsp%3BSo%20let%E2%80%99s%20talk%20about%20that%20next%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1177759619%22%20id%3D%22toc-hId-1177762494%22%20id%3D%22toc-hId-1987109120%22%3E%26nbsp%3B%3C%2FH1%3E%0A%3CH1%20id%3D%22toc-hId--1374397342%22%20id%3D%22toc-hId--1374394467%22%20id%3D%22toc-hId--565047841%22%3EMultiple%20rules%20on%20different%20fields%3C%2FH1%3E%0A%3CP%3EFor%20reasons%20that%20are%20multiple%20and%20largely%20self-inflicted%2C%20this%20is%20the%20main%20source%20of%20confusion.%20The%20documentation%20has%20always%20stated%20that%20rules%20on%20different%20fields%20would%20be%20combined%20using%20%E2%80%98AND%E2%80%99%20and%20in%20some%20cases%20this%20was%20true%20but%20in%20others%20it%20was%20not.%20Over%20the%20years%20we%20have%20tried%20to%20address%20some%20of%20the%20edge%20cases%20but%20generally%20this%20has%20been%20a%20non-deterministic%20hybrid%20of%20both%20depending%20on%20which%20combinations%20of%20fields%20were%20being%20used%20and%20which%20events%20they%20were%20applied%20to.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAll%20this%20changed%20in%20Sysmon%208.02.%20In%20response%20to%20repeated%20requests%20to%20make%20this%20behaviour%20match%20the%20documentation%20I%20resolved%20the%20hybrid%20AND%2FOR%20filtering%20once%20and%20for%20all%20so%20that%20the%20%E2%80%98AND%E2%80%99%20logic%20worked%20consistently.%20%26nbsp%3BThis%20now%20matched%20the%20documentation%20and%20everybody%20was%20happy.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOr%20not.%20Although%20the%20implementation%20was%20now%20consistent%20with%20the%20documentation%2C%20it%20turned%20out%20that%20prior%20to%20this%20change%2C%20many%20of%20the%20most%20commonly%20used%20fields%20were%20previously%20being%20combined%20using%20%E2%80%98OR%E2%80%99.%20Users%20were%20aware%20that%20this%20was%20contrary%20to%20the%20documentation%20but%20since%20this%20is%20the%20way%20it%20worked%20in%20practice%20they%20had%20no%20choice%20but%20to%20assume%20%E2%80%98OR%E2%80%99%20anyway%20and%20had%20come%20to%20rely%20on%20it%20working%20that%20way.%20Thus%20for%20these%20users%208.02%20broke%20their%20existing%20configurations%20and%20broke%20them%20badly.%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-368412993%22%20id%3D%22toc-hId-368415868%22%20id%3D%22toc-hId-1177762494%22%3E%26nbsp%3B%3C%2FH1%3E%0A%3CH1%20id%3D%22toc-hId-2111223328%22%20id%3D%22toc-hId-2111226203%22%20id%3D%22toc-hId--1374394467%22%3ERule%20groups%3C%2FH1%3E%0A%3CP%3EIn%20Sysmon%209.0%20we%20introduced%20the%20concept%20of%20Rule%20Groups%20as%20a%20response%20to%20satisfy%20the%20competing%20demands%20of%20one%20set%20of%20users%20who%20wanted%20to%20combine%20their%20rules%20using%20%E2%80%98AND%E2%80%99%20along%20with%20those%20who%20wanted%20to%20continue%20using%20%E2%80%98OR%E2%80%99.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERule%20groups%20are%20completely%20optional%20and%20can%20be%20used%20to%20explicitly%20define%20the%20way%20that%20rules%20on%20different%20fields%20are%20combined.%20%26nbsp%3BAt%20the%20most%20basic%20level%20a%20single%20rule%20group%20with%20or%20without%20an%20optional%20name%20attribute%20can%20be%20applied%20to%20the%20entire%20configuration%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEVENTFILTERING%3E%3C%2FEVENTFILTERING%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CRULEGROUP%20grouprelation%3D%22%26quot%3Bor%26quot%3B%22%3E%3C%2FRULEGROUP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CPROCESSCREATE%20onmatch%3D%22%26quot%3Bexclude%26quot%3B%2F%22%3E%3C%2FPROCESSCREATE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CIMAGELOAD%20onmatch%3D%22%26quot%3Bexclude%26quot%3B%2F%22%3E%3C%2FIMAGELOAD%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAlternatively%20multiple%20rule%20groups%20%26nbsp%3Bcan%20be%20used%20for%20different%20events%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEVENTFILTERING%3E%3C%2FEVENTFILTERING%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CRULEGROUP%20name%3D%22%E2%80%9Dgroup1%E2%80%9D%26nbsp%3BgroupRelation%3D%26quot%3Bor%26quot%3B%22%3E%3C%2FRULEGROUP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CPROCESSCREATE%20onmatch%3D%22%26quot%3Bexclude%26quot%3B%2F%22%3E%3C%2FPROCESSCREATE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CRULEGROUP%20name%3D%22%E2%80%9Dgroup2%E2%80%9D%26nbsp%3BgroupRelation%3D%26quot%3Band%26quot%3B%22%3E%3C%2FRULEGROUP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CIMAGELOAD%20onmatch%3D%22%26quot%3Bexclude%26quot%3B%2F%22%3E%3C%2FIMAGELOAD%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20is%20also%20possible%20to%20exclude%20events%20from%20the%20rule%20group%20completely%20such%20as%20the%20NetworkConnect%20events%20in%20the%20following%20example%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEVENTFILTERING%3E%3C%2FEVENTFILTERING%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CRULEGROUP%20name%3D%22%E2%80%9Dgroup1%E2%80%9D%26nbsp%3BgroupRelation%3D%26quot%3Bor%26quot%3B%22%3E%3C%2FRULEGROUP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CPROCESSCREATE%20onmatch%3D%22%26quot%3Bexclude%26quot%3B%2F%22%3E%3C%2FPROCESSCREATE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CRULEGROUP%20name%3D%22%E2%80%9Dgroup2%E2%80%9D%26nbsp%3BgroupRelation%3D%26quot%3Band%26quot%3B%22%3E%3C%2FRULEGROUP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CIMAGELOAD%20onmatch%3D%22%26quot%3Bexclude%26quot%3B%2F%22%3E%3C%2FIMAGELOAD%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CNETWORKCONNECT%20onmatch%3D%22%26quot%3Bexclude%26quot%3B%2F%22%3E%3C%2FNETWORKCONNECT%3E%3C%2FP%3E%0A%3CP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--440933633%22%20id%3D%22toc-hId--440930758%22%20id%3D%22toc-hId-368415868%22%3EDefault%20values%3C%2FH1%3E%0A%3CP%3ESince%20rule%20groups%20are%20optional%20and%20because%20events%20may%20be%20omitted%20from%20a%20rule%20group%2C%20we%20had%20to%20pick%20a%20default%20value%20for%20these%20rules.%20In%20light%20of%20our%20experience%20when%20switching%20from%20%E2%80%98OR%E2%80%99%20to%20%E2%80%98AND%E2%80%99%20in%20Sysmon%208.02%2C%20we%20opted%20to%20revert%20to%20%E2%80%98OR%E2%80%99%20for%20this%20default.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20is%20important%20to%20note%20however%20that%20this%20is%20for%20backwards%20compatibility%20purposes%20only%20so%20that%20users%20are%20able%20to%20move%20to%20Sysmon%209.0%20and%20later%20without%20modifying%20their%20configuration%20files.%20%26nbsp%3BThe%20desire%20is%20to%20reinstate%20the%20intended%20default%20value%20of%20%E2%80%98AND%E2%80%99%20as%20stated%20in%20the%20documentation%20and%20for%20this%20reason%20we%20have%20linked%20the%20default%20value%20to%20the%20schemaversion.%20%26nbsp%3B%3CSTRONG%3E%3CFONT%20color%3D%22%23FF0000%22%3ESysmon%209.0%20was%20released%20with%20a%20schema%20version%20of%204.1%20so%20anything%20with%204.1%20and%20lower%20will%20default%20to%20%E2%80%98OR%E2%80%99%20and%20anything%20with%20a%20schema%20version%20greater%20than%204.1%20will%20default%20to%20%E2%80%98AND%E2%80%99.%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThus%20in%20the%20following%20example%2C%20we%20will%20record%20process%20creation%20events%20when%20either%20the%20command%20line%20contains%20iexplore.exe%20OR%20the%20parent%20command%20line%20contains%20explorer.exe%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSYSMON%20schemaversion%3D%22%26quot%3B4.1%26quot%3B%22%3E%3C%2FSYSMON%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CEVENTFILTERING%3E%3C%2FEVENTFILTERING%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CPROCESSCREATE%20onmatch%3D%22%26quot%3Binclude%26quot%3B%22%3E%3C%2FPROCESSCREATE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CCOMMANDLINE%20condition%3D%22%26quot%3Bcontains%26quot%3B%22%3Eiexplore.exe%3C%2FCOMMANDLINE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CPARENTCOMMANDLINE%20condition%3D%22%26quot%3Bcontains%26quot%3B%22%3Eexplorer.exe%3C%2FPARENTCOMMANDLINE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSYSMON%3E%3C%2FSYSMON%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhereas%20in%20this%20example%20example%20we%20will%20only%20record%20events%20when%20both%20the%20command%20line%20AND%20the%20parent%20command%20line%20match.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSYSMON%20schemaversion%3D%22%26quot%3B4.21%26quot%3B%22%3E%3C%2FSYSMON%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CEVENTFILTERING%3E%3C%2FEVENTFILTERING%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CPROCESSCREATE%20onmatch%3D%22%26quot%3Binclude%26quot%3B%22%3E%3C%2FPROCESSCREATE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CCOMMANDLINE%20condition%3D%22%26quot%3Bcontains%26quot%3B%22%3Eiexplore.exe%3C%2FCOMMANDLINE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CPARENTCOMMANDLINE%20condition%3D%22%26quot%3Bcontains%26quot%3B%22%3Eexplorer.exe%3C%2FPARENTCOMMANDLINE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSYSMON%3E%3C%2FSYSMON%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERecently%20we%20added%20DNS%20logging%20to%20Sysmon.%20This%20has%20been%20a%20popular%20feature%20but%20to%20take%20advantage%20of%20it%20you%20need%20to%20increment%20the%20schema%20version%20to%204.21.%20Several%20users%20have%20reported%20issues%20with%20their%20configuration%20files%20after%20enabling%20DNS%20so%20hopefully%20the%20reasons%20for%20this%20are%20now%20clear.%20If%20your%20configuration%20relied%20on%20the%20legacy%20%E2%80%98OR%E2%80%99%20behaviour%20the%20solution%20is%20to%20add%20a%20top%20level%20rule%20group%20that%20defines%20this%20explicitly%20as%20shown%20in%20the%20following%20example.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSYSMON%20schemaversion%3D%22%26quot%3B4.21%26quot%3B%22%3E%3C%2FSYSMON%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CEVENTFILTERING%3E%3C%2FEVENTFILTERING%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CRULEGROUP%20grouprelation%3D%22%26quot%3Bor%26quot%3B%22%3E%3C%2FRULEGROUP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CPROCESSCREATE%20onmatch%3D%22%26quot%3Binclude%26quot%3B%22%3E%3C%2FPROCESSCREATE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CCOMMANDLINE%20condition%3D%22%26quot%3Bcontains%26quot%3B%22%3Eiexplore.exe%3C%2FCOMMANDLINE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CPARENTCOMMANDLINE%20condition%3D%22%26quot%3Bcontains%26quot%3B%22%3Eexplorer.exe%3C%2FPARENTCOMMANDLINE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CRULEGROUP%20grouprelation%3D%22%26quot%3Bor%26quot%3B%22%3E%3C%2FRULEGROUP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSYSMON%3E%3C%2FSYSMON%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhile%20we%20continue%20to%20evolve%20the%20rule%20structure%20and%20flexibility%2C%20we%20have%20to%20be%20sensitive%20to%20any%20additional%20performance%20impact.%20Nevertheless%20if%20you%20have%20comments%20or%20suggestions%20on%20how%20we%20might%20be%20able%20to%20make%20this%20work%20better%20in%20your%20environment%20then%20we%20would%20love%20to%20hear%20from%20you%20at%20%3CA%20href%3D%22mailto%3Asyssite%40microsoft.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Esyssite%40microsoft.com%3C%2FA%3E.%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%26nbsp%3B%3C%2FP%3E%3CLINGO-SUB%20id%3D%22lingo-sub-733649%22%20slang%3D%22en-US%22%3ESysmon%20-%20The%20rules%20about%20rules%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-733649%22%20slang%3D%22en-US%22%3E%3CP%3EThose%20who%20have%20been%20using%20Sysmon%20for%20a%20while%20will%20be%20aware%20that%20for%20some%20time%20now%20there%20has%20been%20a%20disparity%20between%20how%20filter%20rules%20were%20intended%20to%20work%20and%20how%20they%20worked%20in%20practice.%20The%20purpose%20of%20this%20post%20is%20to%20hopefully%20clarify%20some%20of%20the%20%26nbsp%3Bcommon%20sources%20of%20confusion%20and%20to%20explain%20why%20things%20are%20the%20way%20they%20are.%20With%20that%20said%2C%20let%E2%80%99s%20dive%20straight%20in.%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1987109120%22%20id%3D%22toc-hId-2111226203%22%3E%26nbsp%3B%3C%2FH1%3E%0A%3CH1%20id%3D%22toc-hId--565047841%22%20id%3D%22toc-hId--440930758%22%3EMultiple%20rules%20on%20the%20same%20field%3C%2FH1%3E%0A%3CP%3EThis%20is%20the%20most%20basic%20case%20and%20the%20least%20confusing%20because%20it%20has%20always%20been%20and%20remains%20the%20case%20today%20that%20these%20will%20be%20combined%20using%20%E2%80%98OR%E2%80%99.%20So%20the%20following%20example%20will%20cause%20Sysmon%20to%20log%20a%20process%20creation%20event%20only%20when%20the%20command%20line%20contains%20iexplore.exe%20OR%20firefox.exe%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEVENTFILTERING%3E%3C%2FEVENTFILTERING%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CPROCESSCREATE%20onmatch%3D%22%26quot%3Binclude%26quot%3B%22%3E%3C%2FPROCESSCREATE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CCOMMANDLINE%20condition%3D%22%26quot%3Bcontains%26quot%3B%22%3Eiexplore.exe%3C%2FCOMMANDLINE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CCOMMANDLINE%20condition%3D%22%26quot%3Bcontains%26quot%3B%22%3Efirefox.exe%3C%2FCOMMANDLINE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CP%3E%3C%2FP%3E%0A%3CP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EA%20variation%20on%20this%20configuration%20is%20where%20we%20might%20have%20include%20and%20exclude%20rules%20on%20the%20same%20event.%20Here%20exclude%20rules%20will%20always%20take%20precedence.%20Thus%20in%20the%20following%20example%20we%20will%20omit%20our%20browser%20events%20when%20the%20browser%20was%20launched%20by%20explorer.exe.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEVENTFILTERING%3E%3C%2FEVENTFILTERING%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CPROCESSCREATE%20onmatch%3D%22%26quot%3Binclude%26quot%3B%22%3E%3C%2FPROCESSCREATE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CCOMMANDLINE%20condition%3D%22%26quot%3Bcontains%26quot%3B%22%3Eiexplore.exe%3C%2FCOMMANDLINE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CCOMMANDLINE%20condition%3D%22%26quot%3Bcontains%26quot%3B%22%3Efirefox.exe%3C%2FCOMMANDLINE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CPROCESSCREATE%20onmatch%3D%22%26quot%3Bexclude%26quot%3B%22%3E%3C%2FPROCESSCREATE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3Bc%3A%5Cwindows%5Cexplorer.exe%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%20far%20so%20good.%20Most%20users%20I%20speak%20with%20are%20happy%20with%20this.%20Where%20they%20are%20less%20comfortable%20is%20how%20rules%20for%20different%20fields%20are%20combined.%20%26nbsp%3B%26nbsp%3BSo%20let%E2%80%99s%20talk%20about%20that%20next%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1177762494%22%20id%3D%22toc-hId-1301879577%22%3E%26nbsp%3B%3C%2FH1%3E%0A%3CH1%20id%3D%22toc-hId--1374394467%22%20id%3D%22toc-hId--1250277384%22%3EMultiple%20rules%20on%20different%20fields%3C%2FH1%3E%0A%3CP%3EFor%20reasons%20that%20are%20multiple%20and%20largely%20self-inflicted%2C%20this%20is%20the%20main%20source%20of%20confusion.%20The%20documentation%20has%20always%20stated%20that%20rules%20on%20different%20fields%20would%20be%20combined%20using%20%E2%80%98AND%E2%80%99%20and%20in%20some%20cases%20this%20was%20true%20but%20in%20others%20it%20was%20not.%20Over%20the%20years%20we%20have%20tried%20to%20address%20some%20of%20the%20edge%20cases%20but%20generally%20this%20has%20been%20a%20non-deterministic%20hybrid%20of%20both%20depending%20on%20which%20combinations%20of%20fields%20were%20being%20used%20and%20which%20events%20they%20were%20applied%20to.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAll%20this%20changed%20in%20Sysmon%208.02.%20In%20response%20to%20repeated%20requests%20to%20make%20this%20behaviour%20match%20the%20documentation%20I%20resolved%20the%20hybrid%20AND%2FOR%20filtering%20once%20and%20for%20all%20so%20that%20the%20%E2%80%98AND%E2%80%99%20logic%20worked%20consistently.%20%26nbsp%3BThis%20now%20matched%20the%20documentation%20and%20everybody%20was%20happy.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOr%20not.%20Although%20the%20implementation%20was%20now%20consistent%20with%20the%20documentation%2C%20it%20turned%20out%20that%20prior%20to%20this%20change%2C%20many%20of%20the%20most%20commonly%20used%20fields%20were%20previously%20being%20combined%20using%20%E2%80%98OR%E2%80%99.%20Users%20were%20aware%20that%20this%20was%20contrary%20to%20the%20documentation%20but%20since%20this%20is%20the%20way%20it%20worked%20in%20practice%20they%20had%20no%20choice%20but%20to%20assume%20%E2%80%98OR%E2%80%99%20anyway%20and%20had%20come%20to%20rely%20on%20it%20working%20that%20way.%20Thus%20for%20these%20users%208.02%20broke%20their%20existing%20configurations%20and%20broke%20them%20badly.%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-368415868%22%20id%3D%22toc-hId-492532951%22%3E%26nbsp%3B%3C%2FH1%3E%0A%3CH1%20id%3D%22toc-hId-2111226203%22%20id%3D%22toc-hId-426090409%22%3ERule%20groups%3C%2FH1%3E%0A%3CP%3EIn%20Sysmon%209.0%20we%20introduced%20the%20concept%20of%20Rule%20Groups%20as%20a%20response%20to%20satisfy%20the%20competing%20demands%20of%20one%20set%20of%20users%20who%20wanted%20to%20combine%20their%20rules%20using%20%E2%80%98AND%E2%80%99%20along%20with%20those%20who%20wanted%20to%20continue%20using%20%E2%80%98OR%E2%80%99.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERule%20groups%20are%20completely%20optional%20and%20can%20be%20used%20to%20explicitly%20define%20the%20way%20that%20rules%20on%20different%20fields%20are%20combined.%20%26nbsp%3BAt%20the%20most%20basic%20level%20a%20single%20rule%20group%20with%20or%20without%20an%20optional%20name%20attribute%20can%20be%20applied%20to%20the%20entire%20configuration%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEVENTFILTERING%3E%3C%2FEVENTFILTERING%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CRULEGROUP%20grouprelation%3D%22%26quot%3Bor%26quot%3B%22%3E%3C%2FRULEGROUP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CPROCESSCREATE%20onmatch%3D%22%26quot%3Bexclude%26quot%3B%2F%22%3E%3C%2FPROCESSCREATE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CIMAGELOAD%20onmatch%3D%22%26quot%3Bexclude%26quot%3B%2F%22%3E%3C%2FIMAGELOAD%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAlternatively%20multiple%20rule%20groups%20%26nbsp%3Bcan%20be%20used%20for%20different%20events%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEVENTFILTERING%3E%3C%2FEVENTFILTERING%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CRULEGROUP%20name%3D%22%E2%80%9Dgroup1%E2%80%9D%26nbsp%3BgroupRelation%3D%26quot%3Bor%26quot%3B%22%3E%3C%2FRULEGROUP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CPROCESSCREATE%20onmatch%3D%22%26quot%3Bexclude%26quot%3B%2F%22%3E%3C%2FPROCESSCREATE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CRULEGROUP%20name%3D%22%E2%80%9Dgroup2%E2%80%9D%26nbsp%3BgroupRelation%3D%26quot%3Band%26quot%3B%22%3E%3C%2FRULEGROUP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CIMAGELOAD%20onmatch%3D%22%26quot%3Bexclude%26quot%3B%2F%22%3E%3C%2FIMAGELOAD%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20is%20also%20possible%20to%20exclude%20events%20from%20the%20rule%20group%20completely%20such%20as%20the%20NetworkConnect%20events%20in%20the%20following%20example%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CEVENTFILTERING%3E%3C%2FEVENTFILTERING%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CRULEGROUP%20name%3D%22%E2%80%9Dgroup1%E2%80%9D%26nbsp%3BgroupRelation%3D%26quot%3Bor%26quot%3B%22%3E%3C%2FRULEGROUP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CPROCESSCREATE%20onmatch%3D%22%26quot%3Bexclude%26quot%3B%2F%22%3E%3C%2FPROCESSCREATE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CRULEGROUP%20name%3D%22%E2%80%9Dgroup2%E2%80%9D%26nbsp%3BgroupRelation%3D%26quot%3Band%26quot%3B%22%3E%3C%2FRULEGROUP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CIMAGELOAD%20onmatch%3D%22%26quot%3Bexclude%26quot%3B%2F%22%3E%3C%2FIMAGELOAD%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CNETWORKCONNECT%20onmatch%3D%22%26quot%3Bexclude%26quot%3B%2F%22%3E%3C%2FNETWORKCONNECT%3E%3C%2FP%3E%0A%3CP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--440930758%22%20id%3D%22toc-hId--2126066552%22%3EDefault%20values%3C%2FH1%3E%0A%3CP%3ESince%20rule%20groups%20are%20optional%20and%20because%20events%20may%20be%20omitted%20from%20a%20rule%20group%2C%20we%20had%20to%20pick%20a%20default%20value%20for%20these%20rules.%20In%20light%20of%20our%20experience%20when%20switching%20from%20%E2%80%98OR%E2%80%99%20to%20%E2%80%98AND%E2%80%99%20in%20Sysmon%208.02%2C%20we%20opted%20to%20revert%20to%20%E2%80%98OR%E2%80%99%20for%20this%20default.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIt%20is%20important%20to%20note%20however%20that%20this%20is%20for%20backwards%20compatibility%20purposes%20only%20so%20that%20users%20are%20able%20to%20move%20to%20Sysmon%209.0%20and%20later%20without%20modifying%20their%20configuration%20files.%20%26nbsp%3BThe%20desire%20is%20to%20reinstate%20the%20intended%20default%20value%20of%20%E2%80%98AND%E2%80%99%20as%20stated%20in%20the%20documentation%20and%20for%20this%20reason%20we%20have%20linked%20the%20default%20value%20to%20the%20schemaversion.%20%26nbsp%3B%3CSTRONG%3E%3CFONT%20color%3D%22%23FF0000%22%3ESysmon%209.0%20was%20released%20with%20a%20schema%20version%20of%204.1%20so%20anything%20with%204.1%20and%20lower%20will%20default%20to%20%E2%80%98OR%E2%80%99%20and%20anything%20with%20a%20schema%20version%20greater%20than%204.1%20will%20default%20to%20%E2%80%98AND%E2%80%99.%3C%2FFONT%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThus%20in%20the%20following%20example%2C%20we%20will%20record%20process%20creation%20events%20when%20either%20the%20command%20line%20contains%20iexplore.exe%20OR%20the%20parent%20command%20line%20contains%20explorer.exe%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSYSMON%20schemaversion%3D%22%26quot%3B4.1%26quot%3B%22%3E%3C%2FSYSMON%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CEVENTFILTERING%3E%3C%2FEVENTFILTERING%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CPROCESSCREATE%20onmatch%3D%22%26quot%3Binclude%26quot%3B%22%3E%3C%2FPROCESSCREATE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CCOMMANDLINE%20condition%3D%22%26quot%3Bcontains%26quot%3B%22%3Eiexplore.exe%3C%2FCOMMANDLINE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CPARENTCOMMANDLINE%20condition%3D%22%26quot%3Bcontains%26quot%3B%22%3Eexplorer.exe%3C%2FPARENTCOMMANDLINE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSYSMON%3E%3C%2FSYSMON%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhereas%20in%20this%20example%20example%20we%20will%20only%20record%20events%20when%20both%20the%20command%20line%20AND%20the%20parent%20command%20line%20match.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSYSMON%20schemaversion%3D%22%26quot%3B4.21%26quot%3B%22%3E%3C%2FSYSMON%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CEVENTFILTERING%3E%3C%2FEVENTFILTERING%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CPROCESSCREATE%20onmatch%3D%22%26quot%3Binclude%26quot%3B%22%3E%3C%2FPROCESSCREATE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CCOMMANDLINE%20condition%3D%22%26quot%3Bcontains%26quot%3B%22%3Eiexplore.exe%3C%2FCOMMANDLINE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CPARENTCOMMANDLINE%20condition%3D%22%26quot%3Bcontains%26quot%3B%22%3Eexplorer.exe%3C%2FPARENTCOMMANDLINE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSYSMON%3E%3C%2FSYSMON%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERecently%20we%20added%20DNS%20logging%20to%20Sysmon.%20This%20has%20been%20a%20popular%20feature%20but%20to%20take%20advantage%20of%20it%20you%20need%20to%20increment%20the%20schema%20version%20to%204.21.%20Several%20users%20have%20reported%20issues%20with%20their%20configuration%20files%20after%20enabling%20DNS%20so%20hopefully%20the%20reasons%20for%20this%20are%20now%20clear.%20If%20your%20configuration%20relied%20on%20the%20legacy%20%E2%80%98OR%E2%80%99%20behaviour%20the%20solution%20is%20to%20add%20a%20top%20level%20rule%20group%20that%20defines%20this%20explicitly%20as%20shown%20in%20the%20following%20example.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSYSMON%20schemaversion%3D%22%26quot%3B4.21%26quot%3B%22%3E%3C%2FSYSMON%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3CEVENTFILTERING%3E%3C%2FEVENTFILTERING%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CRULEGROUP%20grouprelation%3D%22%26quot%3Bor%26quot%3B%22%3E%3C%2FRULEGROUP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CPROCESSCREATE%20onmatch%3D%22%26quot%3Binclude%26quot%3B%22%3E%3C%2FPROCESSCREATE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CCOMMANDLINE%20condition%3D%22%26quot%3Bcontains%26quot%3B%22%3Eiexplore.exe%3C%2FCOMMANDLINE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CPARENTCOMMANDLINE%20condition%3D%22%26quot%3Bcontains%26quot%3B%22%3Eexplorer.exe%3C%2FPARENTCOMMANDLINE%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSYSMON%3E%3C%2FSYSMON%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhile%20we%20continue%20to%20evolve%20the%20rule%20structure%20and%20flexibility%2C%20we%20have%20to%20be%20sensitive%20to%20any%20additional%20performance%20impact.%20Nevertheless%20if%20you%20have%20comments%20or%20suggestions%20on%20how%20we%20might%20be%20able%20to%20make%20this%20work%20better%20in%20your%20environment%20then%20we%20would%20love%20to%20hear%20from%20you%20at%20%3CA%20href%3D%22mailto%3Asyssite%40microsoft.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Esyssite%40microsoft.com%3C%2FA%3E.%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%26nbsp%3B%3C%2FP%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-733649%22%20slang%3D%22en-US%22%3E%3CP%3EDid%20your%20filter%20rules%20stop%20working%20after%20you%20upgraded%20your%20version%20of%20Sysmon%3F%20Did%20you%20lose%20your%20process%20create%20events%20after%20you%20enabled%20DNS%20Logging%3F%26nbsp%3B%20Or%20perhaps%20you%20are%20new%20to%20Sysmon%20rules%20or%20would%20like%20an%20update%20on%20what's%20new%3F%20In%20this%20article%20I%20attempt%20to%20clear%20up%20some%20of%20the%20confusion%20that%20surrounds%20Sysmon%20rules.%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Microsoft

Those who have been using Sysmon for a while will be aware that for some time now there has been a disparity between how filter rules were intended to work and how they worked in practice. The purpose of this post is to hopefully clarify some of the  common sources of confusion and to explain why things are the way they are. With that said, let’s dive straight in.

 

Multiple rules on the same field

This is the most basic case and the least confusing because it has always been and remains the case today that these will be combined using ‘OR’. So the following example will cause Sysmon to log a process creation event only when the command line contains iexplore.exe OR firefox.exe

 

<EventFiltering>

      <ProcessCreate onmatch="include">

          <CommandLine condition="contains">iexplore.exe</CommandLine>

          <CommandLine condition="contains">firefox.exe</CommandLine>

     </ProcessCreate>

</EventFiltering>

 

A variation on this configuration is where we might have include and exclude rules on the same event. Here exclude rules will always take precedence. Thus in the following example we will omit our browser events when the browser was launched by explorer.exe.

 

<EventFiltering>

      <ProcessCreate onmatch="include">

          <CommandLine condition="contains">iexplore.exe</CommandLine>

          <CommandLine condition="contains">firefox.exe</CommandLine>

     </ProcessCreate>

     <ProcessCreate onmatch="exclude">

        c:\windows\explorer.exe

     </ProcessCreate>

</EventFiltering>

 

 

So far so good. Most users I speak with are happy with this. Where they are less comfortable is how rules for different fields are combined.   So let’s talk about that next

 

Multiple rules on different fields

For reasons that are multiple and largely self-inflicted, this is the main source of confusion. The documentation has always stated that rules on different fields would be combined using ‘AND’ and in some cases this was true but in others it was not. Over the years we have tried to address some of the edge cases but generally this has been a non-deterministic hybrid of both depending on which combinations of fields were being used and which events they were applied to.

 

All this changed in Sysmon 8.02. In response to repeated requests to make this behaviour match the documentation I resolved the hybrid AND/OR filtering once and for all so that the ‘AND’ logic worked consistently.  This now matched the documentation and everybody was happy.

 

Or not. Although the implementation was now consistent with the documentation, it turned out that prior to this change, many of the most commonly used fields were previously being combined using ‘OR’. Users were aware that this was contrary to the documentation but since this is the way it worked in practice they had no choice but to assume ‘OR’ anyway and had come to rely on it working that way. Thus for these users 8.02 broke their existing configurations and broke them badly.

 

Rule groups

In Sysmon 9.0 we introduced the concept of Rule Groups as a response to satisfy the competing demands of one set of users who wanted to combine their rules using ‘AND’ along with those who wanted to continue using ‘OR’.

 

Rule groups are completely optional and can be used to explicitly define the way that rules on different fields are combined.  At the most basic level a single rule group with or without an optional name attribute can be applied to the entire configuration

 

<EventFiltering>

    <RuleGroup groupRelation="or">

      <ProcessCreate onmatch="exclude"/>

      <ImageLoad onmatch="exclude"/>

    </RuleGroup>

</EventFiltering>

 

Alternatively multiple rule groups  can be used for different events

 

<EventFiltering>

    <RuleGroup name=”group1” groupRelation="or">

      <ProcessCreate onmatch="exclude"/>

    </RuleGroup>

    <RuleGroup name=”group2” groupRelation="and">

      <ImageLoad onmatch="exclude"/>

    </RuleGroup>

</EventFiltering>

 

 

It is also possible to exclude events from the rule group completely such as the NetworkConnect events in the following example

 

<EventFiltering>

    <RuleGroup name=”group1” groupRelation="or">

      <ProcessCreate onmatch="exclude"/>

    </RuleGroup>

    <RuleGroup name=”group2” groupRelation="and">

      <ImageLoad onmatch="exclude"/>

    </RuleGroup>

    <NetworkConnect onmatch="exclude"/>

</EventFiltering>

 

Default values

Since rule groups are optional and because events may be omitted from a rule group, we had to pick a default value for these rules. In light of our experience when switching from ‘OR’ to ‘AND’ in Sysmon 8.02, we opted to revert to ‘OR’ for this default.

 

It is important to note however that this is for backwards compatibility purposes only so that users are able to move to Sysmon 9.0 and later without modifying their configuration files.  The desire is to reinstate the intended default value of ‘AND’ as stated in the documentation and for this reason we have linked the default value to the schemaversion.  Sysmon 9.0 was released with a schema version of 4.1 so anything with 4.1 and lower will default to ‘OR’ and anything with a schema version greater than 4.1 will default to ‘AND’.

 

Thus in the following example, we will record process creation events when either the command line contains iexplore.exe OR the parent command line contains explorer.exe

 

<Sysmon schemaversion="4.1">

    <EventFiltering>

      <ProcessCreate onmatch="include">

        <CommandLine condition="contains">iexplore.exe</CommandLine>

        <ParentCommandLine condition="contains">explorer.exe</CommandLine>

      </ProcessCreate/>

    </EventFiltering>

<Sysmon>

 

Whereas in this example example we will only record events when both the command line AND the parent command line match.

 

<Sysmon schemaversion="4.21">

    <EventFiltering>

      <ProcessCreate onmatch="include">

        <CommandLine condition="contains">iexplore.exe</CommandLine>

        <ParentCommandLine condition="contains">explorer.exe</CommandLine>

      </ProcessCreate/>

    </EventFiltering>

<Sysmon>

 

Recently we added DNS logging to Sysmon. This has been a popular feature but to take advantage of it you need to increment the schema version to 4.21. Several users have reported issues with their configuration files after enabling DNS so hopefully the reasons for this are now clear. If your configuration relied on the legacy ‘OR’ behaviour the solution is to add a top level rule group that defines this explicitly as shown in the following example.

 

<Sysmon schemaversion="4.21">

    <EventFiltering>

       <RuleGroup groupRelation="or">

          <ProcessCreate onmatch="include">

           <CommandLine condition="contains">iexplore.exe</CommandLine>

           <ParentCommandLine condition="contains">explorer.exe</CommandLine>

         </ProcessCreate/>

       </RuleGroup>

    </EventFiltering>

<Sysmon>

 

While we continue to evolve the rule structure and flexibility, we have to be sensitive to any additional performance impact. Nevertheless if you have comments or suggestions on how we might be able to make this work better in your environment then we would love to hear from you at syssite@microsoft.com.