@@ -25,7 +25,8 @@ def buildDetection(self)->dict[str,Any]:
25
25
answers ['date' ] = datetime .today ().strftime ('%Y-%m-%d' )
26
26
answers ['author' ] = answers ['detection_author' ]
27
27
del answers ['detection_author' ]
28
- answers ['data_source' ] = answers ['data_source' ]
28
+ answers ['data_sources' ] = answers ['data_source' ]
29
+ del answers ['data_source' ]
29
30
answers ['type' ] = answers ['detection_type' ]
30
31
del answers ['detection_type' ]
31
32
answers ['status' ] = "production" #start everything as production since that's what we INTEND the content to become
@@ -49,6 +50,7 @@ def buildDetection(self)->dict[str,Any]:
49
50
answers ['tags' ]['required_fields' ] = ['UPDATE' ]
50
51
answers ['tags' ]['risk_score' ] = 'UPDATE (impact * confidence)/100'
51
52
answers ['tags' ]['security_domain' ] = answers ['security_domain' ]
53
+ del answers ["security_domain" ]
52
54
answers ['tags' ]['cve' ] = ['UPDATE WITH CVE(S) IF APPLICABLE' ]
53
55
54
56
#generate the tests section
@@ -64,6 +66,7 @@ def buildDetection(self)->dict[str,Any]:
64
66
]
65
67
}
66
68
]
69
+ del answers ["mitre_attack_ids" ]
67
70
return answers
68
71
69
72
def buildStory (self )-> dict [str ,Any ]:
@@ -111,12 +114,12 @@ def writeObjectNewContent(self, object: dict, subdirectory_name: str, type: NewC
111
114
#make sure the output folder exists for this detection
112
115
output_folder .mkdir (exist_ok = True )
113
116
114
- YmlWriter .writeYmlFile (file_path , object )
117
+ YmlWriter .writeDetection (file_path , object )
115
118
print ("Successfully created detection " + file_path )
116
119
117
120
elif type == NewContentType .story :
118
121
file_path = os .path .join (self .output_path , 'stories' , self .convertNameToFileName (object ['name' ], object ['tags' ]['product' ]))
119
- YmlWriter .writeYmlFile (file_path , object )
122
+ YmlWriter .writeStory (file_path , object )
120
123
print ("Successfully created story " + file_path )
121
124
122
125
else :
0 commit comments