Skip to content

Commit 9e12508

Browse files
ChuckWoodraskanadouani
authored andcommitted
DomainTools add risky DNS tag to artifact and case depending on risk score tag from DomainTools. (#587)
1 parent c7337b1 commit 9e12508

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-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_AddRiskyDNSTag",
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 case contains a risky DNS.",
8+
"dataTypeList": ["thehive:case_artifact"],
9+
"command": "DomainToolsIris_AddRiskyDNSTag/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: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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"] == "Risk Score":
30+
if int(x["value"]) > int(self.get_param("config.high_risk_threshold")):
31+
build_list.append(
32+
self.build_operation("AddTagToCase", tag="DT:Risky DNS")
33+
)
34+
build_list.append(
35+
self.build_operation("AddTagToArtifact", tag="DT:Risky DNS")
36+
)
37+
return build_list
38+
39+
40+
if __name__ == "__main__":
41+
DomainToolsIris().run()

responders/DomainToolsIris_AddRiskyDNSTag/requirements.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)