-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added tools member to stix.common.information_source. Closes #18
- Loading branch information
Bryan Worrell
committed
Jun 5, 2013
1 parent
5b10e15
commit 207b68a
Showing
3 changed files
with
61 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright (c) 2013, The MITRE Corporation. All rights reserved. | ||
# See LICENSE.txt for complete terms. | ||
''' | ||
File: ex_04.py | ||
Description: Build a STIX Document with Tool Information | ||
''' | ||
|
||
from stix.core import STIXPackage, STIXHeader | ||
from stix.common import InformationSource | ||
from cybox.common import ToolInformationList, ToolInformation | ||
|
||
def main(): | ||
stix_package = STIXPackage() | ||
stix_header = STIXHeader() | ||
|
||
# Add tool information | ||
stix_header.information_source = InformationSource() | ||
stix_header.information_source.tools = ToolInformationList() | ||
stix_header.information_source.tools.append(ToolInformation("python-stix ex_04.py", "The MITRE Corporation")) | ||
|
||
stix_header.description = "Example 04" | ||
stix_package.stix_header = stix_header | ||
|
||
print(stix_package.to_xml()) | ||
print(stix_package.to_dict()) | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters