Skip to content

Commit a1d6aff

Browse files
author
Bryan Worrell
committed
fixed bug where title and description elements weren't being written. updated ex_02.py to include title and description on indicator
1 parent b93b5fd commit a1d6aff

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

examples/ex_02.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ def main():
2222
f.add_hash(h)
2323

2424
indicator = Indicator()
25+
indicator.title = "File Hash Example"
26+
indicator.description = "An indicator containing a File observable with an associated hash"
2527
indicator.set_producer_identity("The MITRE Corporation")
2628
indicator.set_produced_time(datetime.now())
2729
indicator.add_object(f)

stix/indicator/indicator.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,11 @@ def to_obj(self, return_obj=None):
138138
if self.id_:
139139
return_obj.set_id(self.id_)
140140

141-
'''most of this does not work because of the state of the cybox api development'''
141+
if self.description:
142+
return_obj.set_Description(self.description.to_obj())
143+
144+
return_obj.set_Title(self.title)
145+
142146
if self.observables:
143147
if len(self.observables) > 1:
144148
root_observable = self._merge_observables(self.observables)

0 commit comments

Comments
 (0)