stix_schema_spy 1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +24 -0
- data/README.md +41 -0
- data/Rakefile +3 -0
- data/config/1.0.1/stix/README.md +20 -0
- data/config/1.0.1/stix/campaign.xsd +210 -0
- data/config/1.0.1/stix/course_of_action.xsd +166 -0
- data/config/1.0.1/stix/cybox/README.md +13 -0
- data/config/1.0.1/stix/cybox/cybox_common.xsd +2319 -0
- data/config/1.0.1/stix/cybox/cybox_core.xsd +1095 -0
- data/config/1.0.1/stix/cybox/cybox_default_vocabularies.xsd +3326 -0
- data/config/1.0.1/stix/cybox/extensions/platform/README.txt +1 -0
- data/config/1.0.1/stix/cybox/extensions/platform/cpe-language_2.3.xsd +234 -0
- data/config/1.0.1/stix/cybox/extensions/platform/cpe-naming_2.3.xsd +45 -0
- data/config/1.0.1/stix/cybox/extensions/platform/cpe2.3.xsd +40 -0
- data/config/1.0.1/stix/cybox/extensions/platform/xml.xsd +145 -0
- data/config/1.0.1/stix/cybox/objects/API_Object.xsd +55 -0
- data/config/1.0.1/stix/cybox/objects/Account_Object.xsd +50 -0
- data/config/1.0.1/stix/cybox/objects/Address_Object.xsd +122 -0
- data/config/1.0.1/stix/cybox/objects/Artifact_Object.xsd +206 -0
- data/config/1.0.1/stix/cybox/objects/Code_Object.xsd +417 -0
- data/config/1.0.1/stix/cybox/objects/Custom_Object.xsd +43 -0
- data/config/1.0.1/stix/cybox/objects/DNS_Cache_Object.xsd +53 -0
- data/config/1.0.1/stix/cybox/objects/DNS_Query_Object.xsd +159 -0
- data/config/1.0.1/stix/cybox/objects/DNS_Record_Object.xsd +87 -0
- data/config/1.0.1/stix/cybox/objects/Device_Object.xsd +55 -0
- data/config/1.0.1/stix/cybox/objects/Disk_Object.xsd +117 -0
- data/config/1.0.1/stix/cybox/objects/Disk_Partition_Object.xsd +199 -0
- data/config/1.0.1/stix/cybox/objects/Email_Message_Object.xsd +273 -0
- data/config/1.0.1/stix/cybox/objects/File_Object.xsd +359 -0
- data/config/1.0.1/stix/cybox/objects/GUI_Dialogbox_Object.xsd +41 -0
- data/config/1.0.1/stix/cybox/objects/GUI_Object.xsd +40 -0
- data/config/1.0.1/stix/cybox/objects/GUI_Window_Object.xsd +46 -0
- data/config/1.0.1/stix/cybox/objects/HTTP_Session_Object.xsd +623 -0
- data/config/1.0.1/stix/cybox/objects/Library_Object.xsd +114 -0
- data/config/1.0.1/stix/cybox/objects/Link_Object.xsd +36 -0
- data/config/1.0.1/stix/cybox/objects/Linux_Package_Object.xsd +119 -0
- data/config/1.0.1/stix/cybox/objects/Memory_Object.xsd +70 -0
- data/config/1.0.1/stix/cybox/objects/Mutex_Object.xsd +40 -0
- data/config/1.0.1/stix/cybox/objects/Network_Connection_Object.xsd +609 -0
- data/config/1.0.1/stix/cybox/objects/Network_Flow_Object.xsd +1559 -0
- data/config/1.0.1/stix/cybox/objects/Network_Packet_Object.xsd +2948 -0
- data/config/1.0.1/stix/cybox/objects/Network_Route_Entry_Object.xsd +155 -0
- data/config/1.0.1/stix/cybox/objects/Network_Route_Object.xsd +93 -0
- data/config/1.0.1/stix/cybox/objects/Network_Socket_Object.xsd +524 -0
- data/config/1.0.1/stix/cybox/objects/Network_Subnet_Object.xsd +64 -0
- data/config/1.0.1/stix/cybox/objects/PDF_File_Object.xsd +601 -0
- data/config/1.0.1/stix/cybox/objects/Pipe_Object.xsd +40 -0
- data/config/1.0.1/stix/cybox/objects/Port_Object.xsd +74 -0
- data/config/1.0.1/stix/cybox/objects/Process_Object.xsd +197 -0
- data/config/1.0.1/stix/cybox/objects/Product_Object.xsd +60 -0
- data/config/1.0.1/stix/cybox/objects/Semaphore_Object.xsd +50 -0
- data/config/1.0.1/stix/cybox/objects/Socket_Address_Object.xsd +42 -0
- data/config/1.0.1/stix/cybox/objects/System_Object.xsd +409 -0
- data/config/1.0.1/stix/cybox/objects/URI_Object.xsd +62 -0
- data/config/1.0.1/stix/cybox/objects/Unix_File_Object.xsd +164 -0
- data/config/1.0.1/stix/cybox/objects/Unix_Network_Route_Entry_Object.xsd +56 -0
- data/config/1.0.1/stix/cybox/objects/Unix_Pipe_Object.xsd +36 -0
- data/config/1.0.1/stix/cybox/objects/Unix_Process_Object.xsd +143 -0
- data/config/1.0.1/stix/cybox/objects/Unix_User_Account_Object.xsd +78 -0
- data/config/1.0.1/stix/cybox/objects/Unix_Volume_Object.xsd +41 -0
- data/config/1.0.1/stix/cybox/objects/User_Account_Object.xsd +110 -0
- data/config/1.0.1/stix/cybox/objects/User_Session_Object.xsd +60 -0
- data/config/1.0.1/stix/cybox/objects/Volume_Object.xsd +235 -0
- data/config/1.0.1/stix/cybox/objects/Whois_Object.xsd +456 -0
- data/config/1.0.1/stix/cybox/objects/Win_Computer_Account_Object.xsd +135 -0
- data/config/1.0.1/stix/cybox/objects/Win_Critical_Section_Object.xsd +40 -0
- data/config/1.0.1/stix/cybox/objects/Win_Driver_Object.xsd +269 -0
- data/config/1.0.1/stix/cybox/objects/Win_Event_Log_Object.xsd +137 -0
- data/config/1.0.1/stix/cybox/objects/Win_Event_Object.xsd +80 -0
- data/config/1.0.1/stix/cybox/objects/Win_Executable_File_Object.xsd +1333 -0
- data/config/1.0.1/stix/cybox/objects/Win_File_Object.xsd +269 -0
- data/config/1.0.1/stix/cybox/objects/Win_Handle_Object.xsd +186 -0
- data/config/1.0.1/stix/cybox/objects/Win_Kernel_Hook_Object.xsd +109 -0
- data/config/1.0.1/stix/cybox/objects/Win_Kernel_Object.xsd +128 -0
- data/config/1.0.1/stix/cybox/objects/Win_Mailslot_Object.xsd +56 -0
- data/config/1.0.1/stix/cybox/objects/Win_Memory_Page_Region_Object.xsd +198 -0
- data/config/1.0.1/stix/cybox/objects/Win_Mutex_Object.xsd +42 -0
- data/config/1.0.1/stix/cybox/objects/Win_Network_Route_Entry_Object.xsd +200 -0
- data/config/1.0.1/stix/cybox/objects/Win_Network_Share_Object.xsd +205 -0
- data/config/1.0.1/stix/cybox/objects/Win_Pipe_Object.xsd +73 -0
- data/config/1.0.1/stix/cybox/objects/Win_Prefetch_Object.xsd +113 -0
- data/config/1.0.1/stix/cybox/objects/Win_Process_Object.xsd +167 -0
- data/config/1.0.1/stix/cybox/objects/Win_Registry_Key_Object.xsd +290 -0
- data/config/1.0.1/stix/cybox/objects/Win_Semaphore_Object.xsd +42 -0
- data/config/1.0.1/stix/cybox/objects/Win_Service_Object.xsd +287 -0
- data/config/1.0.1/stix/cybox/objects/Win_System_Object.xsd +126 -0
- data/config/1.0.1/stix/cybox/objects/Win_System_Restore_Object.xsd +199 -0
- data/config/1.0.1/stix/cybox/objects/Win_Task_Object.xsd +755 -0
- data/config/1.0.1/stix/cybox/objects/Win_Thread_Object.xsd +146 -0
- data/config/1.0.1/stix/cybox/objects/Win_User_Account_Object.xsd +73 -0
- data/config/1.0.1/stix/cybox/objects/Win_Volume_Object.xsd +161 -0
- data/config/1.0.1/stix/cybox/objects/Win_Waitable_Timer_Object.xsd +90 -0
- data/config/1.0.1/stix/cybox/objects/X509_Certificate_Object.xsd +270 -0
- data/config/1.0.1/stix/data_marking.xsd +92 -0
- data/config/1.0.1/stix/exploit_target.xsd +224 -0
- data/config/1.0.1/stix/extensions/address/ciq_address_3.0.xsd +27 -0
- data/config/1.0.1/stix/extensions/address/readme.txt +1 -0
- data/config/1.0.1/stix/extensions/attack_pattern/capec_2.6.1.xsd +31 -0
- data/config/1.0.1/stix/extensions/attack_pattern/readme.txt +1 -0
- data/config/1.0.1/stix/extensions/identity/ciq_identity_3.0.xsd +108 -0
- data/config/1.0.1/stix/extensions/identity/readme.txt +1 -0
- data/config/1.0.1/stix/extensions/malware/maec_4.0.1.xsd +31 -0
- data/config/1.0.1/stix/extensions/malware/readme.txt +1 -0
- data/config/1.0.1/stix/extensions/marking/simple_marking.xsd +30 -0
- data/config/1.0.1/stix/extensions/marking/tlp.xsd +39 -0
- data/config/1.0.1/stix/extensions/structured_coa/generic.xsd +46 -0
- data/config/1.0.1/stix/extensions/test_mechanism/generic.xsd +46 -0
- data/config/1.0.1/stix/extensions/test_mechanism/open_ioc_2010.xsd +32 -0
- data/config/1.0.1/stix/extensions/test_mechanism/oval_5.10.xsd +37 -0
- data/config/1.0.1/stix/extensions/test_mechanism/snort.xsd +36 -0
- data/config/1.0.1/stix/extensions/test_mechanism/yara.xsd +36 -0
- data/config/1.0.1/stix/extensions/vulnerability/cvrf_1.1.xsd +33 -0
- data/config/1.0.1/stix/extensions/vulnerability/readme.txt +1 -0
- data/config/1.0.1/stix/external/capec_2.6.1/ap_schema_v2.6.1.xsd +3618 -0
- data/config/1.0.1/stix/external/cvrf_1.1/common.xsd +176 -0
- data/config/1.0.1/stix/external/cvrf_1.1/cpe-language_2.2a.xsd +182 -0
- data/config/1.0.1/stix/external/cvrf_1.1/cvrf.xsd +487 -0
- data/config/1.0.1/stix/external/cvrf_1.1/cvss-v2_0.9.xsd +415 -0
- data/config/1.0.1/stix/external/cvrf_1.1/dc.xsd +118 -0
- data/config/1.0.1/stix/external/cvrf_1.1/prod.xsd +292 -0
- data/config/1.0.1/stix/external/cvrf_1.1/scap-core_0.9.xsd +170 -0
- data/config/1.0.1/stix/external/cvrf_1.1/vuln.xsd +631 -0
- data/config/1.0.1/stix/external/cvrf_1.1/xml.xsd +287 -0
- data/config/1.0.1/stix/external/maec_4.0.1/maec_bundle_schema.xsd +1139 -0
- data/config/1.0.1/stix/external/maec_4.0.1/maec_package_schema.xsd +938 -0
- data/config/1.0.1/stix/external/maec_4.0.1/metadataSharing.xsd +1712 -0
- data/config/1.0.1/stix/external/oasis_ciq_3.0/CommonTypes.xsd +104 -0
- data/config/1.0.1/stix/external/oasis_ciq_3.0/xAL-types.xsd +511 -0
- data/config/1.0.1/stix/external/oasis_ciq_3.0/xAL.xsd +672 -0
- data/config/1.0.1/stix/external/oasis_ciq_3.0/xNAL-types.xsd +36 -0
- data/config/1.0.1/stix/external/oasis_ciq_3.0/xNAL.xsd +126 -0
- data/config/1.0.1/stix/external/oasis_ciq_3.0/xNL-types.xsd +222 -0
- data/config/1.0.1/stix/external/oasis_ciq_3.0/xNL.xsd +284 -0
- data/config/1.0.1/stix/external/oasis_ciq_3.0/xPIL-types.xsd +854 -0
- data/config/1.0.1/stix/external/oasis_ciq_3.0/xPIL.xsd +1621 -0
- data/config/1.0.1/stix/external/oasis_ciq_3.0/xlink-2003-12-31.xsd +90 -0
- data/config/1.0.1/stix/external/open_ioc_2010/ioc-TR.xsd +25 -0
- data/config/1.0.1/stix/external/open_ioc_2010/ioc.xsd +105 -0
- data/config/1.0.1/stix/external/oval_5.10/oval-common-schema.xsd +781 -0
- data/config/1.0.1/stix/external/oval_5.10/oval-definitions-schema.xsd +1608 -0
- data/config/1.0.1/stix/external/oval_5.10/oval-variables-schema.xsd +84 -0
- data/config/1.0.1/stix/external/oval_5.10/xmldsig-core-schema.xsd +309 -0
- data/config/1.0.1/stix/incident.xsd +787 -0
- data/config/1.0.1/stix/indicator.xsd +310 -0
- data/config/1.0.1/stix/stix_common.xsd +762 -0
- data/config/1.0.1/stix/stix_core.xsd +218 -0
- data/config/1.0.1/stix/stix_default_vocabularies.xsd +1684 -0
- data/config/1.0.1/stix/threat_actor.xsd +174 -0
- data/config/1.0.1/stix/ttp.xsd +341 -0
- data/config/1.0/stix/campaign.xsd +209 -0
- data/config/1.0/stix/course_of_action.xsd +165 -0
- data/config/1.0/stix/cybox/cybox_common.xsd +2319 -0
- data/config/1.0/stix/cybox/cybox_core.xsd +1090 -0
- data/config/1.0/stix/cybox/cybox_default_vocabularies.xsd +3106 -0
- data/config/1.0/stix/cybox/extensions/platform/README.txt +1 -0
- data/config/1.0/stix/cybox/extensions/platform/cpe2.3.xsd +40 -0
- data/config/1.0/stix/cybox/objects/API_Object.xsd +55 -0
- data/config/1.0/stix/cybox/objects/Account_Object.xsd +50 -0
- data/config/1.0/stix/cybox/objects/Address_Object.xsd +122 -0
- data/config/1.0/stix/cybox/objects/Artifact_Object.xsd +206 -0
- data/config/1.0/stix/cybox/objects/Code_Object.xsd +417 -0
- data/config/1.0/stix/cybox/objects/Custom_Object.xsd +43 -0
- data/config/1.0/stix/cybox/objects/DNS_Cache_Object.xsd +53 -0
- data/config/1.0/stix/cybox/objects/DNS_Query_Object.xsd +159 -0
- data/config/1.0/stix/cybox/objects/DNS_Record_Object.xsd +87 -0
- data/config/1.0/stix/cybox/objects/Device_Object.xsd +55 -0
- data/config/1.0/stix/cybox/objects/Disk_Object.xsd +117 -0
- data/config/1.0/stix/cybox/objects/Disk_Partition_Object.xsd +199 -0
- data/config/1.0/stix/cybox/objects/Email_Message_Object.xsd +273 -0
- data/config/1.0/stix/cybox/objects/File_Object.xsd +359 -0
- data/config/1.0/stix/cybox/objects/GUI_Dialogbox_Object.xsd +41 -0
- data/config/1.0/stix/cybox/objects/GUI_Object.xsd +40 -0
- data/config/1.0/stix/cybox/objects/GUI_Window_Object.xsd +46 -0
- data/config/1.0/stix/cybox/objects/HTTP_Session_Object.xsd +623 -0
- data/config/1.0/stix/cybox/objects/Library_Object.xsd +114 -0
- data/config/1.0/stix/cybox/objects/Link_Object.xsd +24 -0
- data/config/1.0/stix/cybox/objects/Linux_Package_Object.xsd +119 -0
- data/config/1.0/stix/cybox/objects/Memory_Object.xsd +70 -0
- data/config/1.0/stix/cybox/objects/Mutex_Object.xsd +40 -0
- data/config/1.0/stix/cybox/objects/Network_Connection_Object.xsd +609 -0
- data/config/1.0/stix/cybox/objects/Network_Flow_Object.xsd +1559 -0
- data/config/1.0/stix/cybox/objects/Network_Packet_Object.xsd +2948 -0
- data/config/1.0/stix/cybox/objects/Network_Route_Entry_Object.xsd +155 -0
- data/config/1.0/stix/cybox/objects/Network_Route_Object.xsd +93 -0
- data/config/1.0/stix/cybox/objects/Network_Socket_Object.xsd +524 -0
- data/config/1.0/stix/cybox/objects/Network_Subnet_Object.xsd +64 -0
- data/config/1.0/stix/cybox/objects/PDF_File_Object.xsd +601 -0
- data/config/1.0/stix/cybox/objects/Pipe_Object.xsd +40 -0
- data/config/1.0/stix/cybox/objects/Port_Object.xsd +74 -0
- data/config/1.0/stix/cybox/objects/Process_Object.xsd +197 -0
- data/config/1.0/stix/cybox/objects/Product_Object.xsd +60 -0
- data/config/1.0/stix/cybox/objects/Semaphore_Object.xsd +50 -0
- data/config/1.0/stix/cybox/objects/Socket_Address_Object.xsd +42 -0
- data/config/1.0/stix/cybox/objects/System_Object.xsd +409 -0
- data/config/1.0/stix/cybox/objects/URI_Object.xsd +62 -0
- data/config/1.0/stix/cybox/objects/Unix_File_Object.xsd +164 -0
- data/config/1.0/stix/cybox/objects/Unix_Network_Route_Entry_Object.xsd +56 -0
- data/config/1.0/stix/cybox/objects/Unix_Pipe_Object.xsd +36 -0
- data/config/1.0/stix/cybox/objects/Unix_Process_Object.xsd +143 -0
- data/config/1.0/stix/cybox/objects/Unix_User_Account_Object.xsd +78 -0
- data/config/1.0/stix/cybox/objects/Unix_Volume_Object.xsd +41 -0
- data/config/1.0/stix/cybox/objects/User_Account_Object.xsd +110 -0
- data/config/1.0/stix/cybox/objects/User_Session_Object.xsd +60 -0
- data/config/1.0/stix/cybox/objects/Volume_Object.xsd +235 -0
- data/config/1.0/stix/cybox/objects/Whois_Object.xsd +456 -0
- data/config/1.0/stix/cybox/objects/Win_Computer_Account_Object.xsd +135 -0
- data/config/1.0/stix/cybox/objects/Win_Critical_Section_Object.xsd +40 -0
- data/config/1.0/stix/cybox/objects/Win_Driver_Object.xsd +269 -0
- data/config/1.0/stix/cybox/objects/Win_Event_Log_Object.xsd +137 -0
- data/config/1.0/stix/cybox/objects/Win_Event_Object.xsd +80 -0
- data/config/1.0/stix/cybox/objects/Win_Executable_File_Object.xsd +1333 -0
- data/config/1.0/stix/cybox/objects/Win_File_Object.xsd +269 -0
- data/config/1.0/stix/cybox/objects/Win_Handle_Object.xsd +186 -0
- data/config/1.0/stix/cybox/objects/Win_Kernel_Hook_Object.xsd +109 -0
- data/config/1.0/stix/cybox/objects/Win_Kernel_Object.xsd +128 -0
- data/config/1.0/stix/cybox/objects/Win_Mailslot_Object.xsd +56 -0
- data/config/1.0/stix/cybox/objects/Win_Memory_Page_Region_Object.xsd +198 -0
- data/config/1.0/stix/cybox/objects/Win_Mutex_Object.xsd +42 -0
- data/config/1.0/stix/cybox/objects/Win_Network_Route_Entry_Object.xsd +200 -0
- data/config/1.0/stix/cybox/objects/Win_Network_Share_Object.xsd +205 -0
- data/config/1.0/stix/cybox/objects/Win_Pipe_Object.xsd +73 -0
- data/config/1.0/stix/cybox/objects/Win_Prefetch_Object.xsd +113 -0
- data/config/1.0/stix/cybox/objects/Win_Process_Object.xsd +167 -0
- data/config/1.0/stix/cybox/objects/Win_Registry_Key_Object.xsd +290 -0
- data/config/1.0/stix/cybox/objects/Win_Semaphore_Object.xsd +42 -0
- data/config/1.0/stix/cybox/objects/Win_Service_Object.xsd +287 -0
- data/config/1.0/stix/cybox/objects/Win_System_Object.xsd +126 -0
- data/config/1.0/stix/cybox/objects/Win_System_Restore_Object.xsd +199 -0
- data/config/1.0/stix/cybox/objects/Win_Task_Object.xsd +755 -0
- data/config/1.0/stix/cybox/objects/Win_Thread_Object.xsd +146 -0
- data/config/1.0/stix/cybox/objects/Win_User_Account_Object.xsd +73 -0
- data/config/1.0/stix/cybox/objects/Win_Volume_Object.xsd +161 -0
- data/config/1.0/stix/cybox/objects/Win_Waitable_Timer_Object.xsd +90 -0
- data/config/1.0/stix/cybox/objects/X509_Certificate_Object.xsd +270 -0
- data/config/1.0/stix/data_marking.xsd +92 -0
- data/config/1.0/stix/exploit_target.xsd +223 -0
- data/config/1.0/stix/extensions/address/ciq_address_3.0.xsd +27 -0
- data/config/1.0/stix/extensions/address/readme.txt +1 -0
- data/config/1.0/stix/extensions/attack_pattern/capec_2.5.xsd +31 -0
- data/config/1.0/stix/extensions/identity/ciq_identity_3.0.xsd +108 -0
- data/config/1.0/stix/extensions/identity/readme.txt +1 -0
- data/config/1.0/stix/extensions/malware/maec_4.0.xsd +32 -0
- data/config/1.0/stix/extensions/malware/readme.txt +3 -0
- data/config/1.0/stix/extensions/marking/simple_marking.xsd +30 -0
- data/config/1.0/stix/extensions/marking/tlp.xsd +39 -0
- data/config/1.0/stix/extensions/structured_coa/generic.xsd +46 -0
- data/config/1.0/stix/extensions/test_mechanism/generic.xsd +46 -0
- data/config/1.0/stix/extensions/test_mechanism/open_ioc_2010.xsd +32 -0
- data/config/1.0/stix/extensions/test_mechanism/oval_5.10.xsd +37 -0
- data/config/1.0/stix/extensions/test_mechanism/snort.xsd +36 -0
- data/config/1.0/stix/extensions/test_mechanism/yara.xsd +36 -0
- data/config/1.0/stix/extensions/vulnerability/cvrf_1.1.xsd +33 -0
- data/config/1.0/stix/extensions/vulnerability/readme.txt +1 -0
- data/config/1.0/stix/external/capec_2.5/ap_schema_v2.5.xsd +2671 -0
- data/config/1.0/stix/external/cvrf_1.1/common.xsd +176 -0
- data/config/1.0/stix/external/cvrf_1.1/cpe-language_2.2a.xsd +182 -0
- data/config/1.0/stix/external/cvrf_1.1/cvrf.xsd +487 -0
- data/config/1.0/stix/external/cvrf_1.1/cvss-v2_0.9.xsd +415 -0
- data/config/1.0/stix/external/cvrf_1.1/dc.xsd +118 -0
- data/config/1.0/stix/external/cvrf_1.1/prod.xsd +292 -0
- data/config/1.0/stix/external/cvrf_1.1/scap-core_0.9.xsd +170 -0
- data/config/1.0/stix/external/cvrf_1.1/vuln.xsd +631 -0
- data/config/1.0/stix/external/cvrf_1.1/xml.xsd +287 -0
- data/config/1.0/stix/external/oasis_ciq_3.0/CommonTypes.xsd +104 -0
- data/config/1.0/stix/external/oasis_ciq_3.0/xAL-types.xsd +511 -0
- data/config/1.0/stix/external/oasis_ciq_3.0/xAL.xsd +672 -0
- data/config/1.0/stix/external/oasis_ciq_3.0/xNAL-types.xsd +36 -0
- data/config/1.0/stix/external/oasis_ciq_3.0/xNAL.xsd +126 -0
- data/config/1.0/stix/external/oasis_ciq_3.0/xNL-types.xsd +222 -0
- data/config/1.0/stix/external/oasis_ciq_3.0/xNL.xsd +284 -0
- data/config/1.0/stix/external/oasis_ciq_3.0/xPIL-types.xsd +854 -0
- data/config/1.0/stix/external/oasis_ciq_3.0/xPIL.xsd +1621 -0
- data/config/1.0/stix/external/oasis_ciq_3.0/xlink-2003-12-31.xsd +90 -0
- data/config/1.0/stix/external/open_ioc_2010/ioc-TR.xsd +25 -0
- data/config/1.0/stix/external/open_ioc_2010/ioc.xsd +105 -0
- data/config/1.0/stix/external/oval_5.10/oval-common-schema.xsd +781 -0
- data/config/1.0/stix/external/oval_5.10/oval-definitions-schema.xsd +1608 -0
- data/config/1.0/stix/external/oval_5.10/oval-variables-schema.xsd +84 -0
- data/config/1.0/stix/external/oval_5.10/xmldsig-core-schema.xsd +309 -0
- data/config/1.0/stix/incident.xsd +786 -0
- data/config/1.0/stix/indicator.xsd +309 -0
- data/config/1.0/stix/stix_common.xsd +762 -0
- data/config/1.0/stix/stix_core.xsd +217 -0
- data/config/1.0/stix/stix_default_vocabularies.xsd +1578 -0
- data/config/1.0/stix/threat_actor.xsd +173 -0
- data/config/1.0/stix/ttp.xsd +340 -0
- data/config/1.1/stix/campaign.xsd +223 -0
- data/config/1.1/stix/course_of_action.xsd +190 -0
- data/config/1.1/stix/cybox/cybox_common.xsd +2700 -0
- data/config/1.1/stix/cybox/cybox_core.xsd +1145 -0
- data/config/1.1/stix/cybox/cybox_default_vocabularies.xsd +5180 -0
- data/config/1.1/stix/cybox/extensions/location/ciq_address_3.0.xsd +27 -0
- data/config/1.1/stix/cybox/extensions/platform/README.txt +1 -0
- data/config/1.1/stix/cybox/extensions/platform/cpe2.3.xsd +34 -0
- data/config/1.1/stix/cybox/external/cpe_2.3/cpe-language_2.3.xsd +234 -0
- data/config/1.1/stix/cybox/external/cpe_2.3/cpe-naming_2.3.xsd +45 -0
- data/config/1.1/stix/cybox/external/cpe_2.3/xml.xsd +145 -0
- data/config/1.1/stix/cybox/external/oasis_ciq_3.0/CommonTypes.xsd +104 -0
- data/config/1.1/stix/cybox/external/oasis_ciq_3.0/xAL-types.xsd +511 -0
- data/config/1.1/stix/cybox/external/oasis_ciq_3.0/xAL.xsd +672 -0
- data/config/1.1/stix/cybox/external/oasis_ciq_3.0/xNAL-types.xsd +36 -0
- data/config/1.1/stix/cybox/external/oasis_ciq_3.0/xNAL.xsd +126 -0
- data/config/1.1/stix/cybox/external/oasis_ciq_3.0/xNL-types.xsd +222 -0
- data/config/1.1/stix/cybox/external/oasis_ciq_3.0/xNL.xsd +284 -0
- data/config/1.1/stix/cybox/external/oasis_ciq_3.0/xPIL-types.xsd +854 -0
- data/config/1.1/stix/cybox/external/oasis_ciq_3.0/xPIL.xsd +1621 -0
- data/config/1.1/stix/cybox/external/oasis_ciq_3.0/xlink-2003-12-31.xsd +90 -0
- data/config/1.1/stix/cybox/objects/API_Object.xsd +55 -0
- data/config/1.1/stix/cybox/objects/ARP_Cache_Object.xsd +98 -0
- data/config/1.1/stix/cybox/objects/AS_Object.xsd +50 -0
- data/config/1.1/stix/cybox/objects/Account_Object.xsd +501 -0
- data/config/1.1/stix/cybox/objects/Address_Object.xsd +127 -0
- data/config/1.1/stix/cybox/objects/Archive_File_Object.xsd +134 -0
- data/config/1.1/stix/cybox/objects/Artifact_Object.xsd +212 -0
- data/config/1.1/stix/cybox/objects/Code_Object.xsd +417 -0
- data/config/1.1/stix/cybox/objects/Custom_Object.xsd +42 -0
- data/config/1.1/stix/cybox/objects/DNS_Cache_Object.xsd +53 -0
- data/config/1.1/stix/cybox/objects/DNS_Query_Object.xsd +164 -0
- data/config/1.1/stix/cybox/objects/DNS_Record_Object.xsd +92 -0
- data/config/1.1/stix/cybox/objects/Device_Object.xsd +65 -0
- data/config/1.1/stix/cybox/objects/Disk_Object.xsd +117 -0
- data/config/1.1/stix/cybox/objects/Disk_Partition_Object.xsd +199 -0
- data/config/1.1/stix/cybox/objects/Domain_Name_Object.xsd +57 -0
- data/config/1.1/stix/cybox/objects/Email_Message_Object.xsd +278 -0
- data/config/1.1/stix/cybox/objects/File_Object.xsd +397 -0
- data/config/1.1/stix/cybox/objects/GUI_Dialogbox_Object.xsd +41 -0
- data/config/1.1/stix/cybox/objects/GUI_Object.xsd +40 -0
- data/config/1.1/stix/cybox/objects/GUI_Window_Object.xsd +46 -0
- data/config/1.1/stix/cybox/objects/HTTP_Session_Object.xsd +633 -0
- data/config/1.1/stix/cybox/objects/Hostname_Object.xsd +45 -0
- data/config/1.1/stix/cybox/objects/Image_File_Object.xsd +124 -0
- data/config/1.1/stix/cybox/objects/Library_Object.xsd +114 -0
- data/config/1.1/stix/cybox/objects/Link_Object.xsd +36 -0
- data/config/1.1/stix/cybox/objects/Linux_Package_Object.xsd +75 -0
- data/config/1.1/stix/cybox/objects/Memory_Object.xsd +141 -0
- data/config/1.1/stix/cybox/objects/Mutex_Object.xsd +40 -0
- data/config/1.1/stix/cybox/objects/Network_Connection_Object.xsd +540 -0
- data/config/1.1/stix/cybox/objects/Network_Flow_Object.xsd +1559 -0
- data/config/1.1/stix/cybox/objects/Network_Packet_Object.xsd +2934 -0
- data/config/1.1/stix/cybox/objects/Network_Route_Entry_Object.xsd +155 -0
- data/config/1.1/stix/cybox/objects/Network_Route_Object.xsd +93 -0
- data/config/1.1/stix/cybox/objects/Network_Socket_Object.xsd +529 -0
- data/config/1.1/stix/cybox/objects/Network_Subnet_Object.xsd +64 -0
- data/config/1.1/stix/cybox/objects/PDF_File_Object.xsd +595 -0
- data/config/1.1/stix/cybox/objects/Pipe_Object.xsd +40 -0
- data/config/1.1/stix/cybox/objects/Port_Object.xsd +40 -0
- data/config/1.1/stix/cybox/objects/Process_Object.xsd +199 -0
- data/config/1.1/stix/cybox/objects/Product_Object.xsd +65 -0
- data/config/1.1/stix/cybox/objects/SMS_Message_Object.xsd +79 -0
- data/config/1.1/stix/cybox/objects/Semaphore_Object.xsd +50 -0
- data/config/1.1/stix/cybox/objects/Socket_Address_Object.xsd +50 -0
- data/config/1.1/stix/cybox/objects/System_Object.xsd +410 -0
- data/config/1.1/stix/cybox/objects/URI_Object.xsd +62 -0
- data/config/1.1/stix/cybox/objects/URL_History_Object.xsd +104 -0
- data/config/1.1/stix/cybox/objects/Unix_File_Object.xsd +164 -0
- data/config/1.1/stix/cybox/objects/Unix_Network_Route_Entry_Object.xsd +56 -0
- data/config/1.1/stix/cybox/objects/Unix_Pipe_Object.xsd +36 -0
- data/config/1.1/stix/cybox/objects/Unix_Process_Object.xsd +143 -0
- data/config/1.1/stix/cybox/objects/Unix_User_Account_Object.xsd +78 -0
- data/config/1.1/stix/cybox/objects/Unix_Volume_Object.xsd +41 -0
- data/config/1.1/stix/cybox/objects/User_Account_Object.xsd +110 -0
- data/config/1.1/stix/cybox/objects/User_Session_Object.xsd +60 -0
- data/config/1.1/stix/cybox/objects/Volume_Object.xsd +235 -0
- data/config/1.1/stix/cybox/objects/Whois_Object.xsd +430 -0
- data/config/1.1/stix/cybox/objects/Win_Computer_Account_Object.xsd +135 -0
- data/config/1.1/stix/cybox/objects/Win_Critical_Section_Object.xsd +40 -0
- data/config/1.1/stix/cybox/objects/Win_Driver_Object.xsd +270 -0
- data/config/1.1/stix/cybox/objects/Win_Event_Log_Object.xsd +137 -0
- data/config/1.1/stix/cybox/objects/Win_Event_Object.xsd +80 -0
- data/config/1.1/stix/cybox/objects/Win_Executable_File_Object.xsd +1311 -0
- data/config/1.1/stix/cybox/objects/Win_File_Object.xsd +269 -0
- data/config/1.1/stix/cybox/objects/Win_Filemapping_Object.xsd +175 -0
- data/config/1.1/stix/cybox/objects/Win_Handle_Object.xsd +351 -0
- data/config/1.1/stix/cybox/objects/Win_Hook_Object.xsd +152 -0
- data/config/1.1/stix/cybox/objects/Win_Kernel_Hook_Object.xsd +109 -0
- data/config/1.1/stix/cybox/objects/Win_Kernel_Object.xsd +128 -0
- data/config/1.1/stix/cybox/objects/Win_Mailslot_Object.xsd +56 -0
- data/config/1.1/stix/cybox/objects/Win_Memory_Page_Region_Object.xsd +198 -0
- data/config/1.1/stix/cybox/objects/Win_Mutex_Object.xsd +42 -0
- data/config/1.1/stix/cybox/objects/Win_Network_Route_Entry_Object.xsd +200 -0
- data/config/1.1/stix/cybox/objects/Win_Network_Share_Object.xsd +205 -0
- data/config/1.1/stix/cybox/objects/Win_Pipe_Object.xsd +73 -0
- data/config/1.1/stix/cybox/objects/Win_Prefetch_Object.xsd +113 -0
- data/config/1.1/stix/cybox/objects/Win_Process_Object.xsd +174 -0
- data/config/1.1/stix/cybox/objects/Win_Registry_Key_Object.xsd +290 -0
- data/config/1.1/stix/cybox/objects/Win_Semaphore_Object.xsd +42 -0
- data/config/1.1/stix/cybox/objects/Win_Service_Object.xsd +287 -0
- data/config/1.1/stix/cybox/objects/Win_System_Object.xsd +126 -0
- data/config/1.1/stix/cybox/objects/Win_System_Restore_Object.xsd +207 -0
- data/config/1.1/stix/cybox/objects/Win_Task_Object.xsd +755 -0
- data/config/1.1/stix/cybox/objects/Win_Thread_Object.xsd +146 -0
- data/config/1.1/stix/cybox/objects/Win_User_Account_Object.xsd +73 -0
- data/config/1.1/stix/cybox/objects/Win_Volume_Object.xsd +161 -0
- data/config/1.1/stix/cybox/objects/Win_Waitable_Timer_Object.xsd +90 -0
- data/config/1.1/stix/cybox/objects/X509_Certificate_Object.xsd +275 -0
- data/config/1.1/stix/data_marking.xsd +96 -0
- data/config/1.1/stix/exploit_target.xsd +323 -0
- data/config/1.1/stix/extensions/address/ciq_3.0_address.xsd +27 -0
- data/config/1.1/stix/extensions/address/readme.txt +1 -0
- data/config/1.1/stix/extensions/attack_pattern/capec_2.7_attack_pattern.xsd +31 -0
- data/config/1.1/stix/extensions/attack_pattern/readme.txt +1 -0
- data/config/1.1/stix/extensions/identity/ciq_3.0_identity.xsd +113 -0
- data/config/1.1/stix/extensions/identity/readme.txt +1 -0
- data/config/1.1/stix/extensions/malware/maec_4.1_malware.xsd +31 -0
- data/config/1.1/stix/extensions/malware/readme.txt +1 -0
- data/config/1.1/stix/extensions/marking/simple_marking.xsd +31 -0
- data/config/1.1/stix/extensions/marking/terms_of_use_marking.xsd +31 -0
- data/config/1.1/stix/extensions/marking/tlp_marking.xsd +40 -0
- data/config/1.1/stix/extensions/structured_coa/generic_structured_coa.xsd +46 -0
- data/config/1.1/stix/extensions/test_mechanism/generic_test_mechanism.xsd +46 -0
- data/config/1.1/stix/extensions/test_mechanism/open_ioc_2010_test_mechanism.xsd +32 -0
- data/config/1.1/stix/extensions/test_mechanism/oval_5.10_test_mechanism.xsd +37 -0
- data/config/1.1/stix/extensions/test_mechanism/snort_test_mechanism.xsd +56 -0
- data/config/1.1/stix/extensions/test_mechanism/yara_test_mechanism.xsd +36 -0
- data/config/1.1/stix/extensions/vulnerability/cvrf_1.1_vulnerability.xsd +33 -0
- data/config/1.1/stix/extensions/vulnerability/readme.txt +1 -0
- data/config/1.1/stix/external/capec_2.7/ap_schema_v2.7.xsd +3618 -0
- data/config/1.1/stix/external/cvrf_1.1/common.xsd +176 -0
- data/config/1.1/stix/external/cvrf_1.1/cpe-language_2.2a.xsd +182 -0
- data/config/1.1/stix/external/cvrf_1.1/cvrf.xsd +487 -0
- data/config/1.1/stix/external/cvrf_1.1/cvss-v2_0.9.xsd +415 -0
- data/config/1.1/stix/external/cvrf_1.1/dc.xsd +118 -0
- data/config/1.1/stix/external/cvrf_1.1/prod.xsd +292 -0
- data/config/1.1/stix/external/cvrf_1.1/scap-core_0.9.xsd +170 -0
- data/config/1.1/stix/external/cvrf_1.1/vuln.xsd +631 -0
- data/config/1.1/stix/external/cvrf_1.1/xml.xsd +287 -0
- data/config/1.1/stix/external/maec_4.1/maec_bundle_schema.xsd +1228 -0
- data/config/1.1/stix/external/maec_4.1/maec_container_schema.xsd +62 -0
- data/config/1.1/stix/external/maec_4.1/maec_default_vocabularies.xsd +5325 -0
- data/config/1.1/stix/external/maec_4.1/maec_package_schema.xsd +1095 -0
- data/config/1.1/stix/external/maec_4.1/metadataSharing.xsd +1712 -0
- data/config/1.1/stix/external/oasis_ciq_3.0/CommonTypes.xsd +104 -0
- data/config/1.1/stix/external/oasis_ciq_3.0/xAL-types.xsd +511 -0
- data/config/1.1/stix/external/oasis_ciq_3.0/xAL.xsd +672 -0
- data/config/1.1/stix/external/oasis_ciq_3.0/xNAL-types.xsd +36 -0
- data/config/1.1/stix/external/oasis_ciq_3.0/xNAL.xsd +126 -0
- data/config/1.1/stix/external/oasis_ciq_3.0/xNL-types.xsd +222 -0
- data/config/1.1/stix/external/oasis_ciq_3.0/xNL.xsd +284 -0
- data/config/1.1/stix/external/oasis_ciq_3.0/xPIL-types.xsd +854 -0
- data/config/1.1/stix/external/oasis_ciq_3.0/xPIL.xsd +1621 -0
- data/config/1.1/stix/external/oasis_ciq_3.0/xlink-2003-12-31.xsd +90 -0
- data/config/1.1/stix/external/open_ioc_2010/ioc-TR.xsd +25 -0
- data/config/1.1/stix/external/open_ioc_2010/ioc.xsd +105 -0
- data/config/1.1/stix/external/oval_5.10/oval-common-schema.xsd +781 -0
- data/config/1.1/stix/external/oval_5.10/oval-definitions-schema.xsd +1608 -0
- data/config/1.1/stix/external/oval_5.10/oval-variables-schema.xsd +84 -0
- data/config/1.1/stix/external/oval_5.10/xmldsig-core-schema.xsd +309 -0
- data/config/1.1/stix/incident.xsd +759 -0
- data/config/1.1/stix/indicator.xsd +367 -0
- data/config/1.1/stix/stix_common.xsd +932 -0
- data/config/1.1/stix/stix_core.xsd +253 -0
- data/config/1.1/stix/stix_default_vocabularies.xsd +2015 -0
- data/config/1.1/stix/threat_actor.xsd +181 -0
- data/config/1.1/stix/ttp.xsd +429 -0
- data/config/1.1/uber_schema.xsd +149 -0
- data/config/mappings.json +30 -0
- data/lib/stix_schema_spy.rb +18 -0
- data/lib/stix_schema_spy/models/attribute.rb +20 -0
- data/lib/stix_schema_spy/models/complex_type.rb +50 -0
- data/lib/stix_schema_spy/models/element.rb +26 -0
- data/lib/stix_schema_spy/models/external_type.rb +48 -0
- data/lib/stix_schema_spy/models/has_children.rb +83 -0
- data/lib/stix_schema_spy/models/node.rb +71 -0
- data/lib/stix_schema_spy/models/schema.rb +217 -0
- data/lib/stix_schema_spy/models/simple_type.rb +47 -0
- data/lib/stix_schema_spy/models/special_field.rb +21 -0
- data/lib/stix_schema_spy/models/type.rb +106 -0
- data/lib/stix_schema_spy/util/schema_naming.rb +106 -0
- data/lib/stix_schema_spy/util/tasks.rb +69 -0
- data/lib/stix_schema_spy/version.rb +3 -0
- data/spec/lib/schema_naming_spec.rb +190 -0
- data/spec/models/complex_type_spec.rb +68 -0
- data/spec/models/node_spec.rb +47 -0
- data/spec/models/schema_spec.rb +63 -0
- data/spec/models/simple_type_spec.rb +38 -0
- data/spec/models/type_spec.rb +43 -0
- data/spec/spec_helper.rb +8 -0
- data/stix_schema_spy.gemspec +27 -0
- metadata +602 -0
@@ -0,0 +1,69 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'nokogiri'
|
3
|
+
|
4
|
+
namespace :stix_schema_spy do
|
5
|
+
|
6
|
+
desc "Generate the uber-schema that can be used to validate against a single file"
|
7
|
+
task :generate_schemas, :output_dir do |task, args|
|
8
|
+
output_dir = args[:output_dir] ? File.expand_path(args[:output_dir]) : nil
|
9
|
+
|
10
|
+
import_chains = Hash.new([])
|
11
|
+
namespace_map = {}
|
12
|
+
schema_dir = File.join(File.dirname(__FILE__), '..', '..', '..', 'config', 'schemas')
|
13
|
+
|
14
|
+
# Create the output directory if we need one
|
15
|
+
FileUtils.mkdir_p(output_dir) if output_dir
|
16
|
+
|
17
|
+
# Collect each of the necessary schemas
|
18
|
+
Dir.chdir(schema_dir) do
|
19
|
+
namespace_map = Dir.glob('**/*.xsd').each_with_object({}) do |schema_location, coll|
|
20
|
+
next if schema_location =~ /uber_schema/
|
21
|
+
puts "Processing #{schema_location}"
|
22
|
+
filename = schema_location.split('/').last
|
23
|
+
|
24
|
+
File.open(schema_location, 'r:bom|utf-8') do |file| # This discards the UTF BOM, which will choke libxml/nokogiri
|
25
|
+
|
26
|
+
# Get the schema text
|
27
|
+
schema = file.read
|
28
|
+
|
29
|
+
# Parse the document and grab the namespace
|
30
|
+
src = Nokogiri::XML::Document.parse(schema, nil, nil, Nokogiri::XML::ParseOptions::PEDANTIC)
|
31
|
+
namespace = src.root.attributes['targetNamespace'].value
|
32
|
+
|
33
|
+
# If there are any includes, we need to start tracking them
|
34
|
+
src.root.xpath('xs:include', {'xs' => 'http://www.w3.org/2001/XMLSchema'}).each do |import|
|
35
|
+
import_chains[namespace] << import.attributes['schemaLocation'].value.split('/').last
|
36
|
+
end
|
37
|
+
|
38
|
+
# Add the schema if it's the top level of the include chain
|
39
|
+
coll[namespace] = schema_location unless import_chains[namespace].include?(filename) # Set this namespace's parent to the current schema unless any other includes point to it
|
40
|
+
|
41
|
+
# Write the schema out to the target directory
|
42
|
+
if output_dir
|
43
|
+
directory = schema_location.split('/')[0..-2].join('/')
|
44
|
+
Dir.chdir(output_dir) {
|
45
|
+
FileUtils.mkdir_p(directory)
|
46
|
+
File.open(schema_location, "w") {|f| f.write(schema)}
|
47
|
+
}
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# Then build them into a series of import statements
|
54
|
+
doc = Nokogiri::XML::Builder.new do |xml|
|
55
|
+
xml.schema('xmlns' => 'http://www.w3.org/2001/XMLSchema') do |root|
|
56
|
+
namespace_map.each do |namespace, schema_location|
|
57
|
+
root.import('namespace' => namespace, 'schemaLocation' => "#{schema_location}")
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Write the schema
|
63
|
+
Dir.chdir(output_dir || 'config/schemas') {
|
64
|
+
File.open("uber_schema.xsd", "w") {|f| f.write(doc.to_xml)}
|
65
|
+
}
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
end
|
@@ -0,0 +1,190 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Util::SchemaNaming do
|
4
|
+
|
5
|
+
before do
|
6
|
+
@class = Class.new
|
7
|
+
@class.send(:include, Util::SchemaNaming)
|
8
|
+
|
9
|
+
@schema = @class.new
|
10
|
+
@schema.stub(:config).and_return({})
|
11
|
+
|
12
|
+
def type_for(namespace)
|
13
|
+
@schema.stub(:namespace).and_return(namespace)
|
14
|
+
@schema.type
|
15
|
+
end
|
16
|
+
|
17
|
+
def project_for(namespace)
|
18
|
+
@schema.stub(:namespace).and_return(namespace)
|
19
|
+
@schema.project
|
20
|
+
end
|
21
|
+
|
22
|
+
def name_for(namespace)
|
23
|
+
@schema.stub(:namespace).and_return(namespace)
|
24
|
+
@schema.title
|
25
|
+
end
|
26
|
+
|
27
|
+
def location_for(namespace, version="1.1")
|
28
|
+
@schema.stub(:namespace).and_return(namespace)
|
29
|
+
@schema.stub(:version).and_return(version)
|
30
|
+
@schema.schema_location
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
context "#type" do
|
35
|
+
it "should find core" do
|
36
|
+
type_for("http://stix.mitre.org/stix-1").should == :core
|
37
|
+
type_for("http://cybox.mitre.org/cybox-2").should == :core
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should find common" do
|
41
|
+
type_for("http://stix.mitre.org/common-1").should == :common
|
42
|
+
type_for("http://cybox.mitre.org/common-2").should == :common
|
43
|
+
end
|
44
|
+
|
45
|
+
it "should find vocabularies" do
|
46
|
+
type_for("http://stix.mitre.org/default_vocabularies-1").should == :vocabularies
|
47
|
+
type_for("http://cybox.mitre.org/default_vocabularies-2").should == :vocabularies
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should find objects" do
|
51
|
+
type_for("http://cybox.mitre.org/objects#AddressObject-2").should == :object
|
52
|
+
type_for("http://cybox.mitre.org/objects#WinNetworkShareObject-2").should == :object
|
53
|
+
type_for("http://cybox.mitre.org/objects#FileObject-2").should == :object
|
54
|
+
type_for("http://cybox.mitre.org/objects#SocketAddressObject-1").should == :object
|
55
|
+
end
|
56
|
+
|
57
|
+
it "should find extensions" do
|
58
|
+
type_for("http://stix.mitre.org/extensions/TestMechanism#Snort-1").should == :extension
|
59
|
+
type_for("http://cybox.mitre.org/extensions/Address#CIQAddress3.0-1").should == :extension
|
60
|
+
type_for("http://stix.mitre.org/extensions/Address#CIQAddress3.0-1").should == :extension
|
61
|
+
type_for("http://stix.mitre.org/extensions/Malware#MAEC4.1-1").should == :extension
|
62
|
+
end
|
63
|
+
|
64
|
+
it "should find components" do
|
65
|
+
type_for("http://stix.mitre.org/Campaign-1").should == :component
|
66
|
+
type_for("http://stix.mitre.org/TTP-1").should == :component
|
67
|
+
type_for("http://stix.mitre.org/Indicator-2").should == :component
|
68
|
+
type_for("http://stix.mitre.org/CourseOfAction-1").should == :component
|
69
|
+
end
|
70
|
+
|
71
|
+
it "should find data markings" do
|
72
|
+
type_for("http://data-marking.mitre.org/Marking-1").should == :marking
|
73
|
+
end
|
74
|
+
|
75
|
+
it "should not recognize anything else" do
|
76
|
+
type_for("http://google.com/schemas/4").should == nil
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
context "#project" do
|
81
|
+
it "should detect STIX" do
|
82
|
+
project_for("http://stix.mitre.org/Campaign-1").should == :stix
|
83
|
+
project_for("http://data-marking.mitre.org/Marking-1").should == :stix
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should detect CybOX" do
|
87
|
+
project_for("http://cybox.mitre.org/default_vocabularies-2").should == :cybox
|
88
|
+
end
|
89
|
+
|
90
|
+
it "should detect no known project" do
|
91
|
+
project_for("http://maec.mitre.org/default_vocabularies-2").should == nil
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
context "#name" do
|
96
|
+
it "should find the name for core, common, and vocabs" do
|
97
|
+
name_for("http://stix.mitre.org/stix-1").should == "STIX Core"
|
98
|
+
name_for("http://cybox.mitre.org/cybox-2").should == "CybOX Core"
|
99
|
+
|
100
|
+
name_for("http://stix.mitre.org/common-1").should == "STIX Common"
|
101
|
+
name_for("http://cybox.mitre.org/common-2").should == "CybOX Common"
|
102
|
+
|
103
|
+
name_for("http://stix.mitre.org/default_vocabularies-1").should == "STIX Vocabularies"
|
104
|
+
name_for("http://cybox.mitre.org/default_vocabularies-2").should == "CybOX Vocabularies"
|
105
|
+
end
|
106
|
+
|
107
|
+
it "should find the name for objects" do
|
108
|
+
@schema.stub(:xpath_name).and_return("Address_Object")
|
109
|
+
name_for("http://cybox.mitre.org/objects#AddressObject-2").should == "Address Object"
|
110
|
+
end
|
111
|
+
|
112
|
+
it "should find the name for components" do
|
113
|
+
@schema.stub(:xpath_name).and_return("STIX Campaign")
|
114
|
+
name_for("http://stix.mitre.org/Campaign-1").should == "Campaign"
|
115
|
+
|
116
|
+
@schema.stub(:xpath_name).and_return("STIX COA")
|
117
|
+
name_for("http://stix.mitre.org/CourseOfAction-1").should == "Course of Action"
|
118
|
+
end
|
119
|
+
|
120
|
+
it "should find the name for extensions" do
|
121
|
+
@schema.stub(:xpath_name).and_return("STIX Extension - Snort Test Mechanism Instance")
|
122
|
+
name_for("http://stix.mitre.org/extensions/TestMechanism#Snort-1").should == "Snort Test Mechanism"
|
123
|
+
end
|
124
|
+
|
125
|
+
it "should find the name for extensions" do
|
126
|
+
name_for("http://data-marking.mitre.org/Marking-1").should == "Data Markings"
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|
130
|
+
|
131
|
+
context "#schema_location" do
|
132
|
+
it "should get schema location for core and common" do
|
133
|
+
location_for("http://stix.mitre.org/stix-1", '1.1').should == "http://stix.mitre.org/XMLSchema/core/1.1/stix_core.xsd"
|
134
|
+
location_for("http://cybox.mitre.org/cybox-2", '2.1').should == "http://cybox.mitre.org/XMLSchema/core/2.1/cybox_core.xsd"
|
135
|
+
|
136
|
+
location_for("http://stix.mitre.org/common-1", '1.1').should == "http://stix.mitre.org/XMLSchema/common/1.1/stix_common.xsd"
|
137
|
+
location_for("http://cybox.mitre.org/common-2", '2.1').should == "http://cybox.mitre.org/XMLSchema/common/2.1/cybox_common.xsd"
|
138
|
+
end
|
139
|
+
|
140
|
+
it "should get schema location for vocabularies" do
|
141
|
+
location_for("http://stix.mitre.org/default_vocabularies-1", '1.1').should == "http://stix.mitre.org/XMLSchema/default_vocabularies/1.1/stix_default_vocabularies.xsd"
|
142
|
+
location_for("http://cybox.mitre.org/default_vocabularies-2", '2.1').should == "http://cybox.mitre.org/XMLSchema/default_vocabularies/2.1/cybox_default_vocabularies.xsd"
|
143
|
+
end
|
144
|
+
|
145
|
+
it "should get schema location for components" do
|
146
|
+
@schema.stub(:title).and_return("Indicator")
|
147
|
+
location_for("http://stix.mitre.org/Indicator-2", '2.1').should == "http://stix.mitre.org/XMLSchema/indicator/2.1/indicator.xsd"
|
148
|
+
|
149
|
+
@schema.stub(:title).and_return("Threat Actor")
|
150
|
+
location_for("http://stix.mitre.org/ThreatActor-2", '1.1').should == "http://stix.mitre.org/XMLSchema/threat_actor/1.1/threat_actor.xsd"
|
151
|
+
|
152
|
+
@schema.stub(:title).and_return("Course of Action")
|
153
|
+
location_for("http://stix.mitre.org/CourseOfAction-1", '1.1').should == "http://stix.mitre.org/XMLSchema/course_of_action/1.1/course_of_action.xsd"
|
154
|
+
end
|
155
|
+
|
156
|
+
it "should get schema location for objects" do
|
157
|
+
location_for("http://cybox.mitre.org/objects#AddressObject-2", '2.1').should == "http://cybox.mitre.org/XMLSchema/objects/Address/2.1/Address_Object.xsd"
|
158
|
+
location_for("http://cybox.mitre.org/objects#WinNetworkShareObject-2", '2.1').should == "http://cybox.mitre.org/XMLSchema/objects/Win_Network_Share/2.1/Win_Network_Share_Object.xsd"
|
159
|
+
location_for("http://cybox.mitre.org/objects#FileObject-2", '2.1').should == "http://cybox.mitre.org/XMLSchema/objects/File/2.1/File_Object.xsd"
|
160
|
+
location_for("http://cybox.mitre.org/objects#SocketAddressObject-1", '1.1').should == "http://cybox.mitre.org/XMLSchema/objects/Socket_Address/1.1/Socket_Address_Object.xsd"
|
161
|
+
end
|
162
|
+
|
163
|
+
it "should get schema location for extensions" do
|
164
|
+
@schema.stub(:filename).and_return("snort_test_mechanism.xsd")
|
165
|
+
location_for("http://stix.mitre.org/extensions/TestMechanism#Snort-1").should ==
|
166
|
+
"http://stix.mitre.org/XMLSchema/extensions/test_mechanism/snort/1.1/snort_test_mechanism.xsd"
|
167
|
+
|
168
|
+
@schema.stub(:filename).and_return("capec_2.7_attack_pattern.xsd")
|
169
|
+
location_for("http://stix.mitre.org/extensions/AP#CAPEC2.7-1").should ==
|
170
|
+
"http://stix.mitre.org/XMLSchema/extensions/attack_pattern/capec_2.7/1.1/capec_2.7_attack_pattern.xsd"
|
171
|
+
|
172
|
+
@schema.stub(:filename).and_return("terms_of_use_marking.xsd")
|
173
|
+
location_for("http://data-marking.mitre.org/extensions/MarkingStructure#Terms_Of_Use-1").should ==
|
174
|
+
"http://stix.mitre.org/XMLSchema/extensions/marking/terms_of_use/1.1/terms_of_use_marking.xsd"
|
175
|
+
|
176
|
+
@schema.stub(:filename).and_return("generic_structured_coa.xsd")
|
177
|
+
location_for("http://stix.mitre.org/extensions/StructuredCOA#Generic-1").should ==
|
178
|
+
"http://stix.mitre.org/XMLSchema/extensions/structured_coa/generic/1.1/generic_structured_coa.xsd"
|
179
|
+
end
|
180
|
+
|
181
|
+
it "should get schema location for markings" do
|
182
|
+
location_for("http://data-marking.mitre.org/Marking-1").should == "http://stix.mitre.org/XMLSchema/data_marking/1.1/data_marking.xsd"
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
it "should get the xpath schema name" do
|
187
|
+
Schema.new('config/schemas/stix/campaign.xsd').xpath_name.should == 'STIX Campaign'
|
188
|
+
Schema.new('config/schemas/stix/cybox/objects/Address_Object.xsd').xpath_name.should == 'Address_Object'
|
189
|
+
end
|
190
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ComplexType do
|
4
|
+
context "The class" do
|
5
|
+
it "should be able to create a new complex type from schema" do
|
6
|
+
doc = Nokogiri::XML(open('config/schemas/stix/stix_core.xsd'))
|
7
|
+
type = ComplexType.new(doc.xpath('//xs:complexType').first, self)
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should create appropriate subclasses" do
|
11
|
+
schema = Schema.build('config/schemas/stix/stix_core.xsd')
|
12
|
+
doc = Nokogiri::XML(open('config/schemas/stix/stix_core.xsd'))
|
13
|
+
|
14
|
+
type = ComplexType.build(doc.xpath('//xs:complexType')[1], schema)
|
15
|
+
type.should be_kind_of ComplexType
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
context "instances" do
|
20
|
+
before do
|
21
|
+
@stix_type = Schema.build('config/schemas/stix/stix_core.xsd').find_type('STIXType')
|
22
|
+
@ttp_type = Schema.build('config/schemas/stix/ttp.xsd').find_type('TTPType')
|
23
|
+
@indicator_type_vocab = Schema.build('config/schemas/stix/stix_default_vocabularies.xsd').find_type('IndicatorTypeVocab-1.0')
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should list its own fields" do
|
27
|
+
@stix_type.own_fields.length.should == 14
|
28
|
+
@ttp_type.own_fields.length.should == 15
|
29
|
+
|
30
|
+
@stix_type.own_fields.first.should be_kind_of(Node)
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should list all of its fields (including inherited)" do
|
34
|
+
@stix_type.fields.length.should == 14
|
35
|
+
@ttp_type.fields.length.should == 18
|
36
|
+
|
37
|
+
@stix_type.fields.first.should be_kind_of(Node)
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should list elements" do
|
41
|
+
@stix_type.elements.length.should == 10
|
42
|
+
@ttp_type.elements.length.should == 14
|
43
|
+
|
44
|
+
@stix_type.elements.first.should be_kind_of(Element)
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should list attributes" do
|
48
|
+
@stix_type.attributes.length.should == 4
|
49
|
+
@ttp_type.attributes.length.should == 4
|
50
|
+
|
51
|
+
@stix_type.attributes.first.should be_kind_of(Attribute)
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should indicate that it's a complex type" do
|
55
|
+
@stix_type.should be_complex
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should be a vocabulary as appropriate" do
|
59
|
+
@stix_type.should_not be_vocab
|
60
|
+
@indicator_type_vocab.should be_vocab
|
61
|
+
end
|
62
|
+
|
63
|
+
it "should find values for a vocabulary" do
|
64
|
+
@indicator_type_vocab.vocab_values.length.should == 10
|
65
|
+
expect {@stix_type.vocab_values}.to raise_error
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Node do
|
4
|
+
context "The Node class" do
|
5
|
+
it "should be able to create itself from schema" do
|
6
|
+
@doc = Nokogiri::XML(open('config/schemas/stix/stix_core.xsd'))
|
7
|
+
node = Node.new(@doc.xpath('//xs:element').first, self)
|
8
|
+
|
9
|
+
node.documentation.should == "The STIX_Package field contains a bundle of information characterized in the Structured Threat Information eXpression (STIX) language."
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
context "A node with a defined type" do
|
14
|
+
before do
|
15
|
+
@schema = Schema.build('config/schemas/stix/stix_core.xsd')
|
16
|
+
@stix_package = @schema.find_element('STIX_Package')
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should be able to find its type" do
|
20
|
+
@stix_package.type.should == @schema.find_type('STIXType')
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should be an element or attribute as appropriate" do
|
24
|
+
@stix_package.should be_element
|
25
|
+
@stix_package.type.attributes.first.should be_attribute
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should have the given name" do
|
29
|
+
@stix_package.name.should == "STIX_Package"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
context "A node with a referenced type" do
|
34
|
+
before do
|
35
|
+
@schema = Schema.build("config/schemas/cybox/cybox_core.xsd")
|
36
|
+
@observable = @schema.find_type("ObservablesType").find_element('Observable')
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should have an anonymous type" do
|
40
|
+
@observable.type.should == @schema.find_type("ObservableType")
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
context "A node with an inline type" do
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Schema do
|
4
|
+
context "The Schema class" do
|
5
|
+
it "should parse a schema" do
|
6
|
+
schema = Schema.build('config/schemas/stix/stix_core.xsd')
|
7
|
+
schema.should_not be_nil
|
8
|
+
|
9
|
+
schema.namespace.should == "http://stix.mitre.org/stix-1"
|
10
|
+
schema.prefix.should == "stix"
|
11
|
+
Schema.find('stix').should == schema
|
12
|
+
|
13
|
+
schema.types.length.should == 11
|
14
|
+
schema.elements.length.should == 1
|
15
|
+
schema.attributes.length.should == 0
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should default the blacklist to true" do
|
19
|
+
Schema.blacklist_enabled?.should == true
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should be able to enable and disable the blacklist (schemas to ignore)" do
|
23
|
+
Schema.blacklist_enabled = false
|
24
|
+
Schema.blacklist_enabled?.should == false
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should indicate whether a schema is blacklisted" do
|
28
|
+
Schema.blacklist_enabled = false
|
29
|
+
Schema.blacklisted?("http://stix.mitre.org").should == false
|
30
|
+
Schema.blacklisted?("http://iodef.ietf.org").should == false
|
31
|
+
Schema.blacklist_enabled = true
|
32
|
+
Schema.blacklisted?("http://stix.mitre.org").should == false
|
33
|
+
Schema.blacklisted?("http://cybox.ietf.org").should == false
|
34
|
+
Schema.blacklisted?("http://data-marking.mitre.org").should == false
|
35
|
+
Schema.blacklisted?("http://iodef.ietf.org").should == true
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should return namespace mappings" do
|
39
|
+
Schema.build('config/schemas/stix/stix_common.xsd')
|
40
|
+
|
41
|
+
Schema.namespaces['xs'].should == 'http://www.w3.org/2001/XMLSchema'
|
42
|
+
Schema.namespaces['stixCommon'].should == 'http://stix.mitre.org/common-1'
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
context "A schema instance" do
|
47
|
+
before do
|
48
|
+
@schema = Schema.build('config/schemas/stix/stix_core.xsd')
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should be able to find an element" do
|
52
|
+
@schema.find_element('STIX_Package').should_not be_nil
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should be able to list global elements" do
|
56
|
+
@schema.elements.should == [@schema.find_element('STIX_Package')]
|
57
|
+
end
|
58
|
+
|
59
|
+
it "should be able to find the schema location" do
|
60
|
+
@schema.schema_location.should == 'http://stix.mitre.org/XMLSchema/core/1.1/stix_core.xsd'
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|