django-restit 4.2.77__py3-none-any.whl → 4.2.78__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {django_restit-4.2.77.dist-info → django_restit-4.2.78.dist-info}/METADATA +1 -1
- {django_restit-4.2.77.dist-info → django_restit-4.2.78.dist-info}/RECORD +5 -5
- incident/parsers/ossec.py +18 -7
- {django_restit-4.2.77.dist-info → django_restit-4.2.78.dist-info}/LICENSE.md +0 -0
- {django_restit-4.2.77.dist-info → django_restit-4.2.78.dist-info}/WHEEL +0 -0
@@ -114,7 +114,7 @@ incident/models/ossec.py,sha256=p1ptr-8lnaj1EP_VmPR58b2LmaYBGaYYKAMqhWK5yZM,2227
|
|
114
114
|
incident/models/rules.py,sha256=SMlDRw_r3fGv-vmRojRLmsklqRRxDcjrSLVBIz-gadA,6884
|
115
115
|
incident/models/ticket.py,sha256=S3kqGQpYLE6Y4M9IKu_60sgW-f592xNr8uufqHnvDoU,2302
|
116
116
|
incident/parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
117
|
-
incident/parsers/ossec.py,sha256=
|
117
|
+
incident/parsers/ossec.py,sha256=uh9LFLUa0uL7a-3l9w3Kd7YmTZGYbS24uoDwPWM_s58,8415
|
118
118
|
incident/periodic.py,sha256=eX1rQK6v65A9ugofTvJPSmAWei6C-3EYgzCMuGZ03jM,381
|
119
119
|
incident/rpc.py,sha256=3y0rfxRR9DikmCmj3IRcMaCLtzLCMrtH64lrjY1w2Og,7992
|
120
120
|
incident/templates/email/incident_change.html,sha256=tQYphypwLukkVdwH0TB2Szz2VEJ7GnsfRS3_ZJ-MYeE,13895
|
@@ -502,7 +502,7 @@ ws4redis/servers/uwsgi.py,sha256=VyhoCI1DnVFqBiJYHoxqn5Idlf6uJPHvfBKgkjs34mo,172
|
|
502
502
|
ws4redis/settings.py,sha256=K0yBiLUuY81iDM4Yr-k8hbvjn5VVHu5zQhmMK8Dtz0s,1536
|
503
503
|
ws4redis/utf8validator.py,sha256=S0OlfjeGRP75aO6CzZsF4oTjRQAgR17OWE9rgZdMBZA,5122
|
504
504
|
ws4redis/websocket.py,sha256=R0TUyPsoVRD7Y_oU7w2I6NL4fPwiz5Vl94-fUkZgLHA,14848
|
505
|
-
django_restit-4.2.
|
506
|
-
django_restit-4.2.
|
507
|
-
django_restit-4.2.
|
508
|
-
django_restit-4.2.
|
505
|
+
django_restit-4.2.78.dist-info/LICENSE.md,sha256=VHN4hhEeVOoFjtG-5fVv4jesA4SWi0Z-KgOzzN6a1ps,1068
|
506
|
+
django_restit-4.2.78.dist-info/METADATA,sha256=wKYW-bztLqxjiqvXiiFHkxyo4_uLm5shsfOU3xnJnbE,7645
|
507
|
+
django_restit-4.2.78.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
508
|
+
django_restit-4.2.78.dist-info/RECORD,,
|
incident/parsers/ossec.py
CHANGED
@@ -45,7 +45,7 @@ def extractUrlPath(text):
|
|
45
45
|
|
46
46
|
def extractMetaData(alert):
|
47
47
|
irule = int(alert.rule_id)
|
48
|
-
if irule
|
48
|
+
if irule in [31301, 31302, 31303]:
|
49
49
|
patterns = {
|
50
50
|
"src_ip": re.compile(r"Src IP: (\S+)"),
|
51
51
|
"path": re.compile(r"request: (\S+ \S+)"),
|
@@ -171,13 +171,24 @@ def parseAlert(request, data):
|
|
171
171
|
remote_file = m.group(1)
|
172
172
|
alert.title = f"New file detected: '{remote_file}'"
|
173
173
|
elif irule == 31101:
|
174
|
-
m = re.search(r"GET\s+(http://[^\s]+)\s+HTTP/\d\.\d\s+(\d+)", data.text)
|
174
|
+
m = re.search(r"(GET|POST|DELETE|PUT)\s+(http://[^\s]+)\s+HTTP/\d\.\d\s+(\d+)", data.text)
|
175
175
|
if m and m.groups():
|
176
|
-
code = m.group(
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
176
|
+
code = m.group(3)
|
177
|
+
method = m.group(1)
|
178
|
+
request_path = m.group(2)
|
179
|
+
alert.title = f"HTTP {code}: {METHOD} {request_path}"
|
180
|
+
elif irule == 31104 or irule == 31516:
|
181
|
+
m = re.search(r"(GET|POST|DELETE|PUT)\s+(http://[^\s]+)\s+HTTP/\d\.\d\s+(\d+)", data.text)
|
182
|
+
if m and m.groups():
|
183
|
+
code = m.group(3)
|
184
|
+
method = m.group(1)
|
185
|
+
request_path = m.group(2)
|
186
|
+
kind = "Common"
|
187
|
+
if irule == 31516:
|
188
|
+
kind = "Suspect"
|
189
|
+
alert.title = f"{kind} Attack {code}: {METHOD} {request_path}"
|
190
|
+
elif irule in [31301, 31302, 31303]:
|
191
|
+
m = re.search(r"(\[error\]|\[crit\])[^\*]*\*\d*\s+(.*?),", data.text)
|
181
192
|
if m and len(m.groups()) >=2:
|
182
193
|
alert.title = error
|
183
194
|
elif irule == 100020:
|
File without changes
|
File without changes
|