Skip to content

Commit

Permalink
AlertSchemaParsers
Browse files Browse the repository at this point in the history
  • Loading branch information
vakohl committed Nov 7, 2024
1 parent fc61be3 commit 9af7b5b
Show file tree
Hide file tree
Showing 33 changed files with 1,205 additions and 59 deletions.
1 change: 1 addition & 0 deletions .github/workflows/convertKqlFunctionYamlToArmTemplate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
- 'Parsers/ASimRegistryEvent/Parsers/**'
- 'Parsers/ASimUserManagement/Parsers/**'
- 'Parsers/ASimDhcpEvent/Parsers/**'
- 'Parsers/ASimAlertEvent/Parsers/**'

env:
GITHUB_APPS_ID: "${{ secrets.APPLICATION_ID }}"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/runAsimSchemaAndDataTesters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
- 'Parsers/ASimRegistryEvent/Parsers/**'
- 'Parsers/ASimUserManagement/Parsers/**'
- 'Parsers/ASimDhcpEvent/Parsers/**'
- 'Parsers/ASimAlertEvent/Parsers/**'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion .script/getModifiedASimSchemas.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function getModifiedAsimSchemas() {
$schemas = ("ASimDns", "ASimWebSession", "ASimNetworkSession", "ASimProcessEvent", "ASimAuditEvent", "ASimAuthentication", "ASimFileEvent", "ASimRegistryEvent","ASimUserManagement","ASimDhcpEvent")
$schemas = ("ASimDns", "ASimWebSession", "ASimNetworkSession", "ASimProcessEvent", "ASimAuditEvent", "ASimAuthentication", "ASimFileEvent", "ASimRegistryEvent","ASimUserManagement","ASimDhcpEvent","ASimAlertEvent")
$modifiedSchemas = @()
foreach ($schema in $schemas) {
$filesThatWereChanged= Invoke-Expression "git diff origin/master --name-only -- $($PSScriptRoot)/../Parsers/$($schema)/Parsers"
Expand Down
14 changes: 14 additions & 0 deletions .script/tests/asimParsersTest/ASimFilteringTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,20 @@ def send_query(self, query_str):
"targetappname_has_any" : "TargetAppName",
"username_has_any" : "User"
},
"AlertEvent" :
{
"disabled" : "",
"endtime" : "EventEndTime",
"starttime" : "EventStartTime",
"ipaddr_has_any_prefix" : "DvcIpAddr",
"hostname_has_any" : "DvcHostname",
"username_has_any" : "Username",
"attacktactics_has_any" : "AttackTactics",
"attacktechniques_has_any" : "AttackTechniques",
"threatcategory_has_any" : "ThreatCategory",
"alertverdict_has_any" : "AlertVerdict",
"eventseverity_has_any" : "EventSeverity",
},
"DhcpEvent" :
{
"disabled" : "",
Expand Down
30 changes: 30 additions & 0 deletions ASIM/dev/Parser YAML templates/ASimAlertTemplate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Parser:
Title: Alert event ASIM parser for <product name>
Version: '0.1.0'
LastUpdated: <MMM DD, YYYY>
Product:
Name: <product name>
Normalization:
Schema: AlertEvent
Version: '<current schema version>'
References:
- Title: ASIM Alert Schema
Link: https://aka.ms/ASimAlertEventDoc
- Title: ASIM
Link: https:/aka.ms/AboutASIM
Description: |
This ASIM parser supports normalizing the <product name> logs to the ASIM 'Alert' normalized schema.
ParserName: <ASimAlertEventVendor+Product>
EquivalentBuiltInParser: <_ASim_AlertEvent_Vendor+Product>
ParserParams:
- Name: disabled
Type: bool
Default: false
ParserQuery: |
let parser = (
disabled:bool = false
)
{
<parser query body>
};
parser (disabled = disabled)
6 changes: 3 additions & 3 deletions ASIM/dev/Parser YAML templates/ASimAuditEventTemplate.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Parser:
Title: ASIM Audit Event parser for <product name>
Version: '<parser version>'
Version: '0.1.0'
LastUpdated: <MMM DD, YYYY>
Product:
Name: <product name>
Expand All @@ -14,8 +14,8 @@ References:
Link: https:/aka.ms/AboutASIM
Description: |
This ASIM parser supports normalizing the <product name> logs to the ASIM Audit Event normalized schema.
ParserName: <parser function name>
EquivalentBuiltInParser: <_ASim_AuditEvent_Product>
ParserName: <ASimAuditEventVendor+Product>
EquivalentBuiltInParser: <_ASim_AuditEvent_Vendor+Product>
ParserParams:
- Name: disabled
Type: bool
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Parser:
Title: ASIM Authentication parser for <product name>
Version: '<parser version>'
Version: '0.1.0'
LastUpdated: <MMM DD, YYYY>
Product:
Name: <product name>
Expand All @@ -14,8 +14,8 @@ References:
Link: https:/aka.ms/AboutASIM
Description: |
This ASIM parser supports normalizing the <product name> logs to the ASIM Authentication normalized schema.
ParserName: <parser function name>
EquivalentBuiltInParser: <_ASim_Authentication_Product>
ParserName: <ASimAuthenticationVendor+Product>
EquivalentBuiltInParser: <_ASim_Authentication_Vendor+Product>
ParserParams:
- Name: disabled
Type: bool
Expand Down
4 changes: 2 additions & 2 deletions ASIM/dev/Parser YAML templates/ASimDhcpEventTemplate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ References:
Link: https:/aka.ms/AboutASIM
Description: |
This ASIM parser supports normalizing <product name> logs to the ASIM Dhcp normalized schema.
ParserName: <ASimDhcpEventProduct>
EquivalentBuiltInParser: <_ASim_DhcpEvent_Product>
ParserName: <ASimDhcpEventVendor+Product>
EquivalentBuiltInParser: <_ASim_DhcpEvent_Vendor+Product
ParserParams:
- Name: disabled
Type: bool
Expand Down
6 changes: 3 additions & 3 deletions ASIM/dev/Parser YAML templates/ASimDnsTemplate.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Parser:
Title: DNS activity ASIM parser for <product name>
Version: '<parser version>'
Version: '0.1.0'
LastUpdated: <MMM DD, YYYY>
Product:
Name: <product name>
Expand All @@ -14,8 +14,8 @@ References:
Link: https://aka.ms/AboutASIM
Description: |
This ASIM parser supports normalizing the <product name> logs to the ASIM DNS activity normalized schema.
ParserName: <parser function name>
EquivalentBuiltInParser: <_ASim_Dns_Product>
ParserName: <ASimDnsVendor+Product>
EquivalentBuiltInParser: <_ASim_Dns_Vendor+Product>
ParserParams:
- Name: disabled
Type: bool
Expand Down
6 changes: 3 additions & 3 deletions ASIM/dev/Parser YAML templates/ASimFileEventTemplate.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Parser:
Title: File events ASIM parser for <product name>
Version: '<parser version>'
Version: '0.1.0'
LastUpdated: <MMM DD, YYYY>
Product:
Name: <product name>
Expand All @@ -14,8 +14,8 @@ References:
Link: https://aka.ms/AboutASIM
Description: |
This ASIM parser supports normalizing the <product name> logs to the ASIM file activity normalized schema.
ParserName: <parser function name>
EquivalentBuiltInParser: <_ASim_FileEvent_Product>
ParserName: <ASimFileEventVendor+Product>
EquivalentBuiltInParser: <_ASim_FileEvent_Vendor+Product>
ParserParams:
- Name: disabled
Type: bool
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Parser:
Title: Network Session ASIM parser for <product name>
Version: '<parser version>'
Version: '0.1.0'
LastUpdated: <MMM DD, YYYY>
Product:
Name: <product name>
Expand All @@ -14,8 +14,8 @@ References:
Link: https:/aka.ms/AboutASIM
Description: |
This ASIM parser supports normalizing <product name> logs to the ASIM Network Session normalized schema.
ParserName: <parser function name>
EquivalentBuiltInParser: <_ASim_NetworkSession_Product>
ParserName: <ASimNetworkSessionVendor+Product>
EquivalentBuiltInParser: <_ASim_NetworkSession_Vendor+Product>
ParserParams:
- Name: disabled
Type: bool
Expand Down
6 changes: 3 additions & 3 deletions ASIM/dev/Parser YAML templates/ASimProcessEventTemplate.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Parser:
Title: Process event ASIM parser for <product name>
Version: '<parser version>'
Version: '0.1.0'
LastUpdated: <MMM DD, YYYY>
Product:
Name: <product name>
Expand All @@ -14,8 +14,8 @@ references:
Link: https:/aka.ms/AboutASIM
Description:
This ASIM parser supports normalizing the <product name> logs to the ASIM process event normalized schema.
ParserName: <parser function name>
EquivalentBuiltInParser: <_ASim_ProcessEvent_Product>
ParserName: <ASimProcessEventVendor+Product>
EquivalentBuiltInParser: <_ASim_ProcessEvent_Vendor+Product>
ParserParams:
- Name: disabled
Type: bool
Expand Down
6 changes: 3 additions & 3 deletions ASIM/dev/Parser YAML templates/ASimRegistryEventTemplate.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Parser:
Title: Registry Event ASIM parser for <product name>
Version: '<parser version>'
Version: '0.1.0'
LastUpdated: <MMM DD, YYYY>
Product:
Name: <product name>
Expand All @@ -14,8 +14,8 @@ References:
Link: https:/aka.ms/AboutASIM
Description: |
This ASIM parser supports normalizing <product name> logs to the ASIM Registry event normalized schema.
ParserName: <parser function name>
EquivalentBuiltInParser: <_ASim_RegistryEvent_Product>
ParserName: <ASimRegistryEventVendor+Product>
EquivalentBuiltInParser: <_ASim_RegistryEvent_Vendor+Product>
ParserParams:
- Name: disabled
Type: bool
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Parser:
Title: User Management activity ASIM parser for <product name>
Version: '<parser version>'
Version: '0.1.0'
LastUpdated: <MMM DD, YYYY>
Product:
Name: <product name>
Expand All @@ -14,8 +14,8 @@ References:
Link: https://aka.ms/AboutASIM
Description: |
This ASIM parser supports normalizing the <product name> logs to the ASIM User Management activity normalized schema.
ParserName: <parser function name>
EquivalentBuiltInParser: <_ASim_UserManagement_Product>
ParserName: <ASimUserManagementVendor+Product>
EquivalentBuiltInParser: <_ASim_UserManagement_Vendor+Product>
ParserParams:
- Name: disabled
Type: bool
Expand Down
6 changes: 3 additions & 3 deletions ASIM/dev/Parser YAML templates/ASimWebSessionTemplate.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Parser:
Title: Web Session ASIM parser for <product name>
Version: '<parser version>'
Version: '0.1.0'
LastUpdated: <MMM DD, YYYY>
Product:
Name: <product name>
Expand All @@ -14,8 +14,8 @@ References:
Link: https:/aka.ms/AboutASIM
Description: |
This ASIM parser supports normalizing <product name> logs to the ASIM Web Session normalized schema.
ParserName: <parser function name>
EquivalentBuiltInParser: <_ASim_WebSession_Product>
ParserName: <ASimWebSessionVendor+Product>
EquivalentBuiltInParser: <_ASim_WebSession_Vendor+Product
ParserParams:
- Name: disabled
Type: bool
Expand Down
82 changes: 82 additions & 0 deletions ASIM/dev/Parser YAML templates/vimAlertTemplate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
Parser:
Title: Alert Event ASIM filtering parser for <product name>
Version: '0.1.0'
LastUpdated: <MMM DD, YYYY>
Product:
Name: <product name>
Normalization:
Schema: AlertEvent
Version: '<current schema version>'
References:
- Title: ASIM Alert Schema
Link: https://aka.ms/ASimAlertEventDoc
- Title: ASIM
Link: https:/aka.ms/AboutASIM
Description: |
This ASIM filtering parser supports normalizing the <product name> logs to the ASIM Alert normalized schema.
ParserName: <vimAlertEventVendor+Product>
EquivalentBuiltInParser: <_Im_AlertEvent_Vendor+Product>
ParserParams:
- Name: starttime
Type: datetime
Default: datetime(null)
- Name: endtime
Type: datetime
Default: datetime(null)
- Name: ipaddr_has_any_prefix
Type: dynamic
Default: dynamic([])
- Name: hostname_has_any
Type: dynamic
Default: dynamic([])
- Name: username_has_any
Type: dynamic
Default: dynamic([])
- Name: attacktactics_has_any
Type: dynamic
Default: dynamic([])
- Name: attacktechniques_has_any
Type: dynamic
Default: dynamic([])
- Name: threatcategory_has_any
Type: dynamic
Default: dynamic([])
- Name: alertverdict_has_any
Type: dynamic
Default: dynamic([])
- Name: eventseverity_has_any
Type: dynamic
Default: dynamic([])
- Name: disabled
Type: bool
Default: false
ParserQuery: |
let parser = (
starttime: datetime=datetime(null),
endtime: datetime=datetime(null),
ipaddr_has_any_prefix: dynamic=dynamic([]),
hostname_has_any: dynamic=dynamic([]),
username_has_any: dynamic=dynamic([]),
attacktactics_has_any: dynamic=dynamic([]),
attacktechniques_has_any: dynamic=dynamic([]),
threatcategory_has_any: dynamic=dynamic([]),
alertverdict_has_any: dynamic=dynamic([]),
eventseverity_has_any: dynamic=dynamic([]),
disabled:bool=false
)
{
<parser query body>
};
parser (
starttime = starttime,
endtime = endtime,
ipaddr_has_any_prefix = ipaddr_has_any_prefix,
hostname_has_any = hostname_has_any,
username_has_any = username_has_any,
attacktactics_has_any = attacktactics_has_any,
attacktechniques_has_any = attacktechniques_has_any,
threatcategory_has_any = threatcategory_has_any,
alertverdict_has_any = alertverdict_has_any,
eventseverity_has_any = eventseverity_has_any,
disabled = disabled
)
6 changes: 3 additions & 3 deletions ASIM/dev/Parser YAML templates/vimAuditEventTemplate.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Parser:
Title: Audit Event ASIM filtering parser for <product name>
Version: '<parser version>'
Version: '0.1.0'
LastUpdated: <MMM DD, YYYY>
Product:
Name: <product name>
Expand All @@ -14,8 +14,8 @@ References:
Link: https:/aka.ms/AboutASIM
Description: |
This ASIM filtering parser supports normalizing the <product name> logs to the ASIM Audit Event normalized schema.
ParserName: <parser function name>
EquivalentBuiltInParser: <_Im_AuditEvent_Product>
ParserName: <ASimAuditEventVendor+Product>
EquivalentBuiltInParser: <_Im_AuditEvent_Vendor+Product>
ParserParams:
- Name: starttime
Type: datetime
Expand Down
6 changes: 3 additions & 3 deletions ASIM/dev/Parser YAML templates/vimAuthenticationTemplate.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Parser:
Title: Authentication ASIM filtering parser for <product name>
Version: '<parser version>'
Version: '0.1.0'
LastUpdated: <MMM DD, YYYY>
Product:
Name: <product name>
Expand All @@ -14,8 +14,8 @@ References:
Link: https:/aka.ms/AboutASIM
Description: |
This ASIM filtering parser supports filtering and normalizing the <product name> logs to the ASIM authentication normalized schema.
ParserName: <parser function name>
EquivalentBuiltInParser: <_Im_Authentication_Product>
ParserName: <ASimAuthenticationVendor+Product>
EquivalentBuiltInParser: <_Im_Authentication_Vendor+Product>
ParserParams:
- Name: starttime
Type: datetime
Expand Down
4 changes: 2 additions & 2 deletions ASIM/dev/Parser YAML templates/vimDhcpEventTemplate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ References:
Link: https:/aka.ms/AboutASIM
Description: |
This ASIM filtering parser supports filtering and normalizing the <product name> logs to the ASIM authentication normalized schema.
ParserName: <vimDhcpEventProduct>
EquivalentBuiltInParser: <_Im_DhcpEvent_Product>
ParserName: <ASimDhcpEventVendor+Product>
EquivalentBuiltInParser: <_Im_DhcpEvent_Vendor+Product>
ParserParams:
- Name: starttime
Type: datetime
Expand Down
Loading

0 comments on commit 9af7b5b

Please sign in to comment.