Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit a58e9ca

Browse files
authored
Custom Rules (#38)
* Add API Documentation * Other Changes * Custom Rules
1 parent 0d22657 commit a58e9ca

File tree

4 files changed

+75
-49
lines changed

4 files changed

+75
-49
lines changed

Correlation Rules/CustomizableRules.md

Lines changed: 75 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,32 @@ nav_order: 3
77

88
# Customizable Rules
99

10-
UTMStack allows users to define customizable rules to enhance the monitoring and alerting based on specific requirements of their network environments. Below are a few examples of such customizable rules, each tailored for different use-cases:
10+
UTMStack allows users to define customizable rules to enhance the monitoring and alerting based on specific requirements of their network environments.
1111

12-
## Rule 1: Whitelist of Internal IPs
13-
Users can define a whitelist of internal IPs that are considered safe. Any activity detected from IPs not in this whitelist will trigger an alert.
12+
## Follow these steps:
13+
14+
1. Access the directory where the system correlation rules are located.
15+
<img title="Menu Correleation Rules" alt="Menu Correleation Rules" src="../Images/menu_custom_rules.png">
16+
17+
2. Select the folder named "custom", intended for custom rules.
18+
<img title="Directory Correleation Rules" alt="Directory Correleation Rules" src="../Images/directory_custom_rules.png">
19+
20+
3. Add, copy, paste or move your customized rules to this folder.
21+
<img title="Create Correleation Rules" alt="Create Correleation Rules" src="../Images/new_custom_rules.png">
22+
23+
4. Check that they are correctly placed and that their names match the system rules you want to modify.
24+
25+
## Modifying system rules:
26+
27+
If you need to adjust a system rule, simply create a new custom rule with the same name as the system rule you wish to modify. This will allow your custom rule to take precedence over the original system rule.
28+
29+
## Rule Priority:
30+
31+
Remember that if there is a custom rule and a system rule with the same name, the custom rule will be used instead of the system rule. This ensures that your settings take priority and are applied by the system instead of the default rules.
32+
33+
Below are a few examples of such customizable rules, each tailored for different use-cases:
34+
35+
## 1. Windows: Activity detected from non-whitelisted internal IPs
1436

1537
### YAML Configuration:
1638
```yaml
@@ -19,7 +41,8 @@ Users can define a whitelist of internal IPs that are considered safe. Any activ
1941
description: "Activity has been detected from an IP that is not on the whitelist of allowed internal IPs"
2042
solution: "We recommend carefully reviewing the logs to verify activity from an IP that is not on the whitelist of allowed internal IPs"
2143
category: "Connection from non-whitelisted"
22-
tactic: ""
44+
tactic: "Exfiltration"
45+
dataTypes: ["wineventlog"]
2346
reference:
2447
- "https://en.wikipedia.org/wiki/Whitelist"
2548
frequency: 60
@@ -36,26 +59,31 @@ Users can define a whitelist of internal IPs that are considered safe. Any activ
3659
save:
3760
- field: "logx.wineventlog.event_data.SubjectUserName"
3861
alias: "SourceUser"
62+
- field: "logx.wineventlog.host.name"
63+
alias: "DestinationHost"
64+
- field: "logx.wineventlog.event_data.IpAddress"
65+
alias: "DestinationIP"
66+
- field: "logx.wineventlog.event_data.IpPort"
67+
alias: "DestinationPort"
3968
- field: "logx.wineventlog.event_data.TargetUserName"
4069
alias: "DestinationUser"
41-
- field: "logx.wineventlog.host.name"
42-
alias: "SourceHost"
4370
```
4471
4572
### Example
46-
In this rule, an alert is generated if there is any activity detected from IPs not listed in the whitelist 10.0.2.27,192.168.22.128,fe80::97d1:5df4:10fe:7b8d.
73+
In this rule, users can define their whitelist of internal IPs. As an example, you have the internal IPs whitelist 10.0.2.27,192.168.22.128,fe80::97d1:5df4:10fe:7b8d Which you can change to your list
74+
4775
48-
## Rule 2: Whitelist of Allowed Applications
49-
Users can define a whitelist of applications that are permitted to run on the servers. Any activity detected from applications not in this whitelist will trigger an alert.
76+
## 2. Windows: Detected application that is not in the white list of allowed applications
5077
5178
### YAML Configuration:
52-
``` yml
79+
```yaml
5380
- name: "Windows: Detected application that is not in the white list of allowed applications"
5481
severity: "High"
5582
description: "This alert is generated when an application that is not on the white list of allowed applications is detected."
5683
solution: "We recommend carefully reviewing the logs to verify applications that are not whitelisted"
5784
category: "Connection from non-whitelisted"
5885
tactic: ""
86+
dataTypes: ["wineventlog"]
5987
reference:
6088
- "https://en.wikipedia.org/wiki/Whitelist"
6189
frequency: 60
@@ -78,28 +106,30 @@ Users can define a whitelist of applications that are permitted to run on the se
78106
save:
79107
- field: "logx.wineventlog.event_data.SubjectUserName"
80108
alias: "SourceUser"
109+
- field: "logx.wineventlog.host.name"
110+
alias: "DestinationHost"
111+
- field: "logx.wineventlog.event_data.IpAddress"
112+
alias: "DestinationIP"
113+
- field: "logx.wineventlog.event_data.IpPort"
114+
alias: "DestinationPort"
81115
- field: "logx.wineventlog.event_data.TargetUserName"
82116
alias: "DestinationUser"
83-
- field: "logx.wineventlog.host.name"
84-
alias: "SourceHost"
85117
```
86118
87-
### Example
88-
In this rule, an alert is generated if any application other than svchost.exe, services.exe, or poqexec.exe is detected running on the servers.
89-
90-
## Rule 3: Whitelist of IPs for Microsoft 365 Logins
119+
### Example
120+
In this rule, users can define their whitelist of applications that are allowed to be on the servers and have activity. As an example, you have the whitelist of applications (svchost.exe|services.exe|poqexec.exe), which you can change to your list
91121
92-
Users can define a whitelist of IPs from which logins to Microsoft 365 are allowed. Any login attempts from IPs not in this whitelist will trigger an alert.
122+
## 3. Microsoft 365: Login detected from non-whitelisted IP
93123
94124
### YAML Configuration:
95-
96-
``` yml
125+
```yaml
97126
- name: "Microsoft 365: Login detected from non-whitelisted IP"
98127
severity: "High"
99128
description: "A user is trying to login from an IP that is not on the whitelist"
100129
solution: "We recommend carefully reviewing the logs to verify users attempting to login from an IP that is not on the whitelist"
101130
category: "Connection from non-whitelisted"
102131
tactic: ""
132+
dataTypes: ["o365"]
103133
reference:
104134
- "https://en.wikipedia.org/wiki/Whitelist"
105135
frequency: 60
@@ -124,57 +154,51 @@ Users can define a whitelist of IPs from which logins to Microsoft 365 are allow
124154

125155
```
126156

127-
### Example
128-
In this rule, an alert is generated if a user tries to login to Microsoft 365 from any IP other than 163.225.184.79, 92.22.1.40, 19.144.24.179, 37e4:dd49:a173:02f4:3164:1df0:8849:6ef9.
129-
130-
131-
## Rule 4: Whitelist of Allowed Users for Microsoft 365 Activity
157+
### Example
158+
In this rule, you can define their whitelist of IPs. As an example, you have the ips whitelist 163.225.184.79,92.22.1.40,19.144.24.179,37e4:dd49:a173:02f4:3164:1df0:8849:6ef9 which you can change to your list
132159

133-
Users can define a whitelist of user accounts that are allowed to have activity in Microsoft 365. Any activity from user accounts not in this whitelist will trigger an alert.
160+
## 4. Microsoft 365: Detected user activity that is not in the white list of allowed users
134161

135162
### YAML Configuration:
136-
137-
``` yml
138-
- name: "Microsoft 365: Activity detected from non-whitelisted user"
163+
```yaml
164+
- name: "Microsoft 365: Detected user activity that is not in the white list of allowed users"
139165
severity: "High"
140-
description: "Activity has been detected from a user that is not on the whitelist"
141-
solution: "We recommend carefully reviewing the logs to verify activity from a user that is not on the whitelist"
166+
description: "This alert is generated when a user is detected that is not on the white list of allowed users."
167+
solution: "We recommend carefully reviewing the logs to verify users who are not whitelisted."
142168
category: "Connection from non-whitelisted"
143169
tactic: ""
170+
dataTypes: ["o365"]
144171
reference:
145172
- "https://en.wikipedia.org/wiki/Whitelist"
146173
frequency: 60
147174
cache:
148-
- allOf:
175+
- allOf:
149176
- field: "logx.o365.UserId"
150177
operator: "not in"
151-
value: "john.doe@example.com,jane.doe@example.com"
152-
- field: "logx.o365.ResultStatus"
153-
operator: "in"
154-
value: "Success,PartiallySucceeded,True"
178+
value: "cafroixeunnouxe-7608@yopmail.com,bineppohuno-6676@yopmail.com,keven_mohr@gmail.com"
155179
minCount: 1
156180
timeLapse: 60
157181
save:
158182
- field: "logx.o365.UserId"
159183
alias: "SourceUser"
160-
```
161-
162-
### Example:
163-
In this rule, an alert is generated if any activity is detected from user accounts other than john.doe@example.com or jane.doe@example.com in Microsoft 365.
184+
- field: "logx.o365.ClientIP"
185+
alias: "SourceIP"
164186

165-
## Rule 5: Windows User Activity Outside Whitelist Detected
187+
```
188+
### Example
189+
In this rule, you can define your whitelist of users who can have activity. As an example, you have the whitelist of users cafroixeunnouxe-7608@yopmail.com,bineppohuno-6676@yopmail.com,keven_mohr@gmail.com which you can change to your list
166190

167-
In this rule, you can define a whitelist of users who are authorized to carry out activities on the Windows environment. For instance, the whitelist of users is specified as cafroixeunnouxe-7608@yopmail.com, bineppohuno-6676@yopmail.com, and keven_mohr@gmail.com, which can be tailored to match your list of authorized users. Users should be delineated by commas.
191+
## 5. Windows: Detected user activity that is not in the white list of allowed users
168192

169193
### YAML Configuration:
170-
171-
``` yml
194+
```yaml
172195
- name: "Windows: Detected user activity that is not in the white list of allowed users"
173196
severity: "High"
174197
description: "This alert is generated when a user is detected that is not on the white list of allowed users."
175198
solution: "We recommend carefully reviewing the logs to verify users who are not whitelisted."
176199
category: "Connection from non-whitelisted"
177200
tactic: ""
201+
dataTypes: ["wineventlog"]
178202
reference:
179203
- "https://en.wikipedia.org/wiki/Whitelist"
180204
frequency: 60
@@ -188,12 +212,14 @@ In this rule, you can define a whitelist of users who are authorized to carry ou
188212
save:
189213
- field: "logx.wineventlog.event_data.SubjectUserName"
190214
alias: "SourceUser"
215+
- field: "logx.wineventlog.host.name"
216+
alias: "DestinationHost"
217+
- field: "logx.wineventlog.event_data.IpAddress"
218+
alias: "DestinationIP"
219+
- field: "logx.wineventlog.event_data.IpPort"
220+
alias: "DestinationPort"
191221
- field: "logx.wineventlog.event_data.TargetUserName"
192222
alias: "DestinationUser"
193-
- field: "logx.wineventlog.host.name"
194-
alias: "SourceHost"
195-
196223
```
197-
198-
### Example:
199-
In this rule configuration, an alert is triggered whenever user activity is detected from accounts other than those listed in the whitelist: cafroixeunnouxe-7608@yopmail.com, bineppohuno-6676@yopmail.com, and keven_mohr@gmail.com. The aim is to promptly identify and respond to potential unauthorized access or malicious activities by unlisted users within the Windows environment.
224+
### Example
225+
In this rule, you can define your whitelist of users who can have activity. As an example, you have the whitelist of users cafroixeunnouxe-7608@yopmail.com,bineppohuno-6676@yopmail.com,keven_mohr@gmail.com which you can change to your list

Images/directory_custom_rules.png

62.8 KB
Loading

Images/menu_custom_rules.png

124 KB
Loading

Images/new_custom_rules.png

44.5 KB
Loading

0 commit comments

Comments
 (0)