Skip to content

Commit 034bc55

Browse files
authored
Merge pull request #328 from emmanvg/master
Update AIS example.
2 parents 15dabf1 + 9f9b7e2 commit 034bc55

1 file changed

Lines changed: 36 additions & 4 deletions

File tree

docs/api/extensions/marking/ais.rst

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ function.
5353
add_ais_marking(stix_package, False, 'EVERYONE', 'GREEN',
5454
country_name_code='US',
5555
country_name_code_type='ISO 3166-1 alpha-2',
56-
admin_area_name_code='US-DC',
56+
admin_area_name_code='US-VA',
5757
admin_area_name_code_type='ISO 3166-2',
58-
organisation_name='NCCIC',
58+
organisation_name='Example Corporation',
5959
industry_type=[INFORMATION_TECHNOLOGY_SECTOR, COMMUNICATIONS_SECTOR]
6060
)
6161
@@ -97,7 +97,7 @@ This corresponds to the XML result:
9797
<stix-ciqidentity:Specification xmlns:stix-ciqidentity="http://stix.mitre.org/extensions/Identity#CIQIdentity3.0-1">\
9898
<xpil:PartyName xmlns:xpil="urn:oasis:names:tc:ciq:xpil:3">
9999
<xnl:OrganisationName xmlns:xnl="urn:oasis:names:tc:ciq:xnl:3">
100-
<xnl:NameElement>NCCIC</xnl:NameElement>
100+
<xnl:NameElement>Example Corporation</xnl:NameElement>
101101
</xnl:OrganisationName>
102102
</xpil:PartyName>
103103
<xpil:Addresses xmlns:xpil="urn:oasis:names:tc:ciq:xpil:3">
@@ -106,7 +106,7 @@ This corresponds to the XML result:
106106
<xal:NameElement xal:NameCode="US" xal:NameCodeType="ISO 3166-1 alpha-2"/>
107107
</xal:Country>
108108
<xal:AdministrativeArea xmlns:xal="urn:oasis:names:tc:ciq:xal:3">
109-
<xal:NameElement xal:NameCode="US-DC" xal:NameCodeType="ISO 3166-2"/>
109+
<xal:NameElement xal:NameCode="US-VA" xal:NameCodeType="ISO 3166-2"/>
110110
</xal:AdministrativeArea>
111111
</xpil:Address>
112112
</xpil:Addresses>
@@ -152,10 +152,42 @@ consumer of AIS would parse the data.
152152
for marking in markings:
153153
print(marking)
154154
print(marking.marking_structures)
155+
print("----------MARKING CONTENT----------")
156+
ais_struct = marking.marking_structures[0]
157+
print("OBJ: %s" % ais_struct)
158+
print("NotProprietary OBJ: %s" % ais_struct.not_proprietary)
159+
print("CISA_Proprietary: %s" % ais_struct.not_proprietary.cisa_proprietary)
160+
print("Consent: %s" % ais_struct.not_proprietary.ais_consent.consent)
161+
print("TLP color: %s" % ais_struct.not_proprietary.tlp_marking.color)
162+
163+
print("----------INFORMATION SOURCE----------")
164+
identity = marking.information_source.identity.specification
165+
print("OBJ: %s" % identity)
166+
print("Organization Name: %s" % identity.party_name.organisation_names[0].name_elements[0].value)
167+
print("Country: %s" % identity.addresses[0].country.name_elements[0].name_code)
168+
print("Country code type: %s" % identity.addresses[0].country.name_elements[0].name_code_type)
169+
print("Administrative area: %s" % identity.addresses[0].administrative_area.name_elements[0].name_code)
170+
print("Administrative area code type: %s" % identity.addresses[0].administrative_area.name_elements[0].name_code_type)
171+
print("Industry Type: %s" % identity.organisation_info.industry_type)
172+
155173
156174
>>> <stix.indicator.indicator.Indicator object at 0x...>
157175
>>> <stix.data_marking.MarkingSpecification object at 0x...>
158176
>>> [<stix.extensions.marking.ais.AISMarkingStructure object at 0x...>, ...]
177+
>>> ----------MARKING CONTENT----------
178+
>>> OBJ: <stix.extensions.marking.ais.AISMarkingStructure object at 0x...>
179+
>>> NotProprietary OBJ: <stix.extensions.marking.ais.NotProprietary object at 0x...>
180+
>>> CISA_Proprietary: False
181+
>>> Consent: EVERYONE
182+
>>> TLP color: GREEN
183+
>>> ----------INFORMATION SOURCE----------
184+
>>> OBJ: <stix.extensions.identity.ciq_identity_3_0.STIXCIQIdentity3_0 object at 0x...>
185+
>>> Organization Name: Example Corporation
186+
>>> Country: US
187+
>>> Country code type: ISO 3166-1 alpha-2
188+
>>> Administrative area: US-VA
189+
>>> Administrative area code type: ISO 3166-2
190+
>>> Industry Type: Information Technology Sector|Communications Sector
159191
160192
Constants
161193
---------

0 commit comments

Comments
 (0)