taxii2client configuration

Learn how to use the minimal Python library from OASIS to set up a taxii2client to interact with the TAXII server from Nozomi Networks. This includes integration for software that does not support the TAXII 2.0 protocol.

The taxii2client is a minimal Python Trusted Automated Exchange of Indicator Information (TAXII) client from OASIS, which can be used to interact with the Nozomi Networks TAXII server. This library is useful if you want to integrate indicators that are pulled from the Nozomi Networks TAXII server with software which does not support the TAXII 2.0 protocol. For more detailed installation instructions and library documentation, see the OASIS TC Open Repository cti-taxii-client GitHub repository.

The code snippet below prints all indicator objects from the Operational Technology (OT) collection and calculates their total number:
from taxii2client.v20 import Collection, as_pages
            
COLLECTION_ID = 'thw2k6rf-w130-zaiv-i606-rsm42fk4dwms' # OT collection
TAXII_USER = 'REPLACE_WITH_PROVIDED_USERNAME_HERE'
TAXII_PASSWORD = 'REPLACE_WITH_PROVIDED_PASSWORD_HERE'
            
collection = Collection(f"https://ti-taxii.nws.nozominetworks.io/root/collections/{COLLECTION_ID}/", user=TAXII_USER, password=TAXII_PASSWORD)
total_indicators = 0
for page in as_pages(collection.get_objects, per_request=99):
    for o in page['objects']:
        if 'type' in o and o['type'] == 'indicator':
            total_indicators += 1
            print(o)
print(f"total indicators: {total_indicators}")