File tree Expand file tree Collapse file tree 3 files changed +69
-0
lines changed
responders/DomainToolsIris_AddRiskyDNSTag Expand file tree Collapse file tree 3 files changed +69
-0
lines changed Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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 ()
You can’t perform that action at this time.
0 commit comments