From 4490fbe122d82673be310fdca0668cdfc8cbe7a2 Mon Sep 17 00:00:00 2001 From: Emmanuelle Vargas-Gonzalez Date: Thu, 28 Sep 2017 17:34:57 -0400 Subject: [PATCH] Update AIS example for STIX 1.1.1 --- docs/api/extensions/marking/ais.rst | 40 ++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/docs/api/extensions/marking/ais.rst b/docs/api/extensions/marking/ais.rst index 630a11c7..676b969b 100644 --- a/docs/api/extensions/marking/ais.rst +++ b/docs/api/extensions/marking/ais.rst @@ -53,9 +53,9 @@ function. add_ais_marking(stix_package, False, 'EVERYONE', 'GREEN', country_name_code='US', country_name_code_type='ISO 3166-1 alpha-2', - admin_area_name_code='US-DC', + admin_area_name_code='US-VA', admin_area_name_code_type='ISO 3166-2', - organisation_name='NCCIC', + organisation_name='Example Corporation', industry_type=[INFORMATION_TECHNOLOGY_SECTOR, COMMUNICATIONS_SECTOR] ) @@ -97,7 +97,7 @@ This corresponds to the XML result: \ - NCCIC + Example Corporation @@ -106,7 +106,7 @@ This corresponds to the XML result: - + @@ -152,10 +152,42 @@ consumer of AIS would parse the data. for marking in markings: print(marking) print(marking.marking_structures) + print("----------MARKING CONTENT----------") + ais_struct = marking.marking_structures[0] + print("OBJ: %s" % ais_struct) + print("NotProprietary OBJ: %s" % ais_struct.not_proprietary) + print("CISA_Proprietary: %s" % ais_struct.not_proprietary.cisa_proprietary) + print("Consent: %s" % ais_struct.not_proprietary.ais_consent.consent) + print("TLP color: %s" % ais_struct.not_proprietary.tlp_marking.color) + + print("----------INFORMATION SOURCE----------") + identity = marking.information_source.identity.specification + print("OBJ: %s" % identity) + print("Organization Name: %s" % identity.party_name.organisation_names[0].name_elements[0].value) + print("Country: %s" % identity.addresses[0].country.name_elements[0].name_code) + print("Country code type: %s" % identity.addresses[0].country.name_elements[0].name_code_type) + print("Administrative area: %s" % identity.addresses[0].administrative_area.name_elements[0].name_code) + print("Administrative area code type: %s" % identity.addresses[0].administrative_area.name_elements[0].name_code_type) + print("Industry Type: %s" % identity.organisation_info.industry_type) + >>> >>> >>> [, ...] + >>> ----------MARKING CONTENT---------- + >>> OBJ: + >>> NotProprietary OBJ: + >>> CISA_Proprietary: False + >>> Consent: EVERYONE + >>> TLP color: GREEN + >>> ----------INFORMATION SOURCE---------- + >>> OBJ: + >>> Organization Name: Example Corporation + >>> Country: US + >>> Country code type: ISO 3166-1 alpha-2 + >>> Administrative area: US-VA + >>> Administrative area code type: ISO 3166-2 + >>> Industry Type: Information Technology Sector|Communications Sector Constants ---------