Skip to content

Commit c7337b1

Browse files
ChuckWoodraskanadouani
authored andcommitted
DomainTools check for malicious tags depending on iris tags from DomainTools and add a tag to artifact and case. (#588)
1 parent 801a7b4 commit c7337b1

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "DomainToolsIris_CheckMaliciousTags",
3+
"version": "1.0",
4+
"author": "DomainTools",
5+
"url": "https://github.com/TheHive-Project/Cortex-Analyzers",
6+
"license": "AGPL-V3",
7+
"description": "Add Tag saying that the observable and case have a malicious tag in their Iris Tags.",
8+
"dataTypeList": ["thehive:case_artifact"],
9+
"command": "DomainToolsIris_CheckMaliciousTags/domaintoolsiris_responder.py",
10+
"baseConfig": "DomainToolsIris",
11+
"configurationItems": [
12+
{
13+
"name": "high_risk_threshold",
14+
"description": "Risk score threshold to be considered high risk.",
15+
"type": "number",
16+
"multi": false,
17+
"required": false,
18+
"defaultValue": 70
19+
},
20+
{
21+
"name": "monitored_iris_tags",
22+
"description": "Monitored Iris tags.",
23+
"type": "string",
24+
"multi": true,
25+
"required": false
26+
}
27+
]
28+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/usr/bin/env python3
2+
# encoding: utf-8
3+
4+
5+
from cortexutils.responder import Responder
6+
7+
8+
class DomainToolsIris(Responder):
9+
def __init__(self):
10+
Responder.__init__(self)
11+
12+
def run(self):
13+
Responder.run(self)
14+
if self.get_param("data.dataType") == "domain":
15+
self.report({"data": self.get_data()})
16+
else:
17+
self.report({"data": 'Can only operate on "domain" observables'})
18+
19+
def operations(self, raw):
20+
build_list = []
21+
taxonomies = (
22+
raw.get("data", {})
23+
.get("reports", {})
24+
.get("DomainToolsIris_Investigate_1_0", {})
25+
.get("taxonomies", None)
26+
)
27+
28+
for x in taxonomies:
29+
if x["predicate"] == "IrisTags":
30+
malicious_tags_set = set(self.get_param("config.monitored_iris_tags"))
31+
domain_tags_set = set(x["value"].split(","))
32+
33+
if len(malicious_tags_set.intersection(domain_tags_set)):
34+
build_list.append(
35+
self.build_operation(
36+
"AddTagToArtifact", tag="DT:Malicious Domain"
37+
)
38+
)
39+
build_list.append(
40+
self.build_operation("AddTagToCase", tag="DT:Malicious Domain")
41+
)
42+
return build_list
43+
44+
45+
if __name__ == "__main__":
46+
DomainToolsIris().run()

responders/DomainToolsIris_CheckMaliciousTags/requirements.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)