certau.source Module

Classes that provide a source of STIX packages.

These classes should implement the next_stix_package() method.

class certau.source.StixSource

A base class for sources of STIX packages.

load_stix_package(stix_file)

Helper for loading and updating (if required) a STIX package.

next_stix_package()

Return the next STIX package available from the source (or None).

class certau.source.StixFileSource(files, recurse=False)

Return STIX packages from a file or directory.

Parameters:
  • files – an array containing the names of one or more files or directories
  • recurse – an optional boolean value (default False), which when set to True, will cause subdirectories to be searched recursively
class certau.source.SimpleTaxiiClient(hostname, path, collection, use_ssl=False, username=None, password=None, key_file=None, cert_file=None, begin_ts=None, end_ts=None, subscription_id=None)

A simple interface to the libtaxii libraries for polling a TAXII server.

The certau.client.SimpleTaxiiClient class provides a simple interface for polling a collection on a TAXII server and returning the response. It supports SSL (certificate-based) authentication in addition to a username and password.

Parameters:
  • hostname – the name of the TAXII server
  • path – the URL path for the collection
  • collection – the collection on the TAXII server to poll
  • use_ssl – use SSL when connecting to the TAXII server
  • username – a username for password-based authentication
  • password – a password for password-based authentication
  • key_file – a private key file for SSL certificate-based authentication
  • cert_file – a certificate file for SSL certificate-based authentication
  • begin_ts – a timestamp to describe the earliest content to be returned by the TAXII server
  • end_ts – a timestamp to describe the most recent content to be returned by the TAXII server
  • subscription_id – a subscription ID to include with the poll request
create_poll_request()

Create a poll request message using supplied parameters.

save_content_blocks(directory)

Save poll response content blocks to given directory.

send_poll_request()

Send the poll request to the TAXII server.