Forum Discussion
Qusai_Ismail
May 18, 2022Brass Contributor
Analytic Rule does not display incident while In hunting there is events.
Hello, There is a problem with an analytic rule i have created to correlate between ThreatIntelligenceIndicator & DeviceNetworkEvents, when i run the KQL query of the analytic in Log Hunting ther...
- May 18, 2022IIRC, the "time set in query" will be overruled by the analytics rule time settings. To do something similar to alert on potential C2C comms (compare NetworkIPs from ThreatIntelligenceIndicator to FW logs) I had to use a join.
ThreatIntelligenceIndicator | where NetworkIP != "" | join (FW_DATA_Table_or_Function | where TimeGenerated >= now()-1d | project-rename NetworkIP = Dst_IP) on NetworkIP
| project TimeGenerated1, Name, Src_IP, NetworkIP, Dst_Port, Protocol | sort by TimeGenerated1 desc
JKatzmandu
May 18, 2022Brass Contributor
IIRC, the "time set in query" will be overruled by the analytics rule time settings. To do something similar to alert on potential C2C comms (compare NetworkIPs from ThreatIntelligenceIndicator to FW logs) I had to use a join.
ThreatIntelligenceIndicator | where NetworkIP != "" | join (FW_DATA_Table_or_Function | where TimeGenerated >= now()-1d | project-rename NetworkIP = Dst_IP) on NetworkIP
| project TimeGenerated1, Name, Src_IP, NetworkIP, Dst_Port, Protocol | sort by TimeGenerated1 desc
ThreatIntelligenceIndicator | where NetworkIP != "" | join (FW_DATA_Table_or_Function | where TimeGenerated >= now()-1d | project-rename NetworkIP = Dst_IP) on NetworkIP
| project TimeGenerated1, Name, Src_IP, NetworkIP, Dst_Port, Protocol | sort by TimeGenerated1 desc
Qusai_Ismail
May 23, 2022Brass Contributor
This is another example i'm trying to do.
ThreatIntelligenceIndicator
| where TimeGenerated > ago(360d)
| where isnotempty(Url)
| join (EmailUrlInfo
| where TimeGenerated >= now()-1d) on Url
| join (EmailEvents | where TimeGenerated >= now()-1d) on NetworkMessageId
| project TimeGenerated , NetworkMessageId, SenderFromAddress, RecipientEmailAddress, Url , DeliveryAction, DeliveryLocation
The analytic rule is for checking IOC URLs in EmailsEvents that have URLs.
Analytic rule settings are :
Run Query every : 5 minutes
Lookup data from the last: 1 Day
When i tested the KQL Query in Log hunting, there is an event in the result, but when trying to test it in Analytic , Simulating result has no result, and no incident generated.
Thank you.
ThreatIntelligenceIndicator
| where TimeGenerated > ago(360d)
| where isnotempty(Url)
| join (EmailUrlInfo
| where TimeGenerated >= now()-1d) on Url
| join (EmailEvents | where TimeGenerated >= now()-1d) on NetworkMessageId
| project TimeGenerated , NetworkMessageId, SenderFromAddress, RecipientEmailAddress, Url , DeliveryAction, DeliveryLocation
The analytic rule is for checking IOC URLs in EmailsEvents that have URLs.
Analytic rule settings are :
Run Query every : 5 minutes
Lookup data from the last: 1 Day
When i tested the KQL Query in Log hunting, there is an event in the result, but when trying to test it in Analytic , Simulating result has no result, and no incident generated.
Thank you.
- JKatzmanduMay 23, 2022Brass ContributorSwap the join around? I'm thinking the analytic rule test may be limiting things. So put your EmailEvents first with 1d, and then do a join to ThreatIntelligenceIndicator with ago(360) and it may work.
- Qusai_IsmailMay 23, 2022Brass ContributorThanks , as you said the set time in query is overruled by rule setting, so i changed the query to be like this
let dt_lookBack = 1h;
let ioc_lookBack = 14d;
ThreatIntelligenceIndicator
| where TimeGenerated >= ago(ioc_lookBack) and ExpirationDateTime > now()
| summarize LatestIndicatorTime = arg_max(TimeGenerated, *) by IndicatorId
| where Active == true
| where isnotempty(Url)
| join kind=innerunique (
EmailUrlInfo
| extend IngestionTime = ingestion_time()
| where IngestionTime > ago(dt_lookBack)
) on $left.Url == $right.Url
and RULE SETTINGS
Run query every 1 hour
Lookup data from the last 14 days
All is done and it's worked.
thank you.