TAXII 1: Services and Collections
Services and Collections can be created with CLI commands
opentaxii-sync-data or with custom code talking to a specific Persistence API
implementation/backend.
Note
The services and collections created with CLI command opentaxii-sync-data are only available with TAXII 1.
Step 1
Create YAML file with collections/services/accounts configuration. See provided example from OpenTAXII git repo — file examples/data-configuration.yml that contains:
- Services:
2 Inbox Services (with ids
inbox_aandinbox_b),1 Discovery Service (with id
discovery_a),1 Collection Management Service (with id
collection_management_a),1 Poll Service (with id
poll_a).
Note
Services have relative path in the address field, which means OpenTAXII will prepend it with domain configured in server configuration file (localhost:9000 in Default configuration).
- Collections:
collection-athat has typeDATA_SET, accepts all content types and is attached to servicesinbox_a,collection_management_a, andpoll_a.collection-bthat accepts only content types specified in fieldcontent_bindingsand is attached to servicesinbox_a,inbox_b,collection_management_aandpoll_a.collection-cthat accepts not only STIX v1.1.1 content type but also custom content typeurn:custom.bindings.com:json:0.0.1. It is attached to servicesinbox_a,collection_management_aandpoll_a.col-not-availablethat is marked as not available, even though it is attached toinbox_bandcollection_management_a.
- Accounts:
account with username
testand passwordtest, with ability to modify collectioncollection-a, readcollection-bandcoll-stix-and-custom, and unknown permissionsomefor non-existing collectioncollection-xyz. Incorrect settings will be ignored during sync.account with username
adminand passwordadminthat has admin permissions becauseis_adminis set toyes.
Note
Without an account you can’t access services with authentication_required enabled.
Step 2
Use opentaxii-sync-data command to synchronize data configuration in provided file and in DB.
Usage help:
(venv) $ opentaxii-sync-data --help
usage: opentaxii-sync-data [-h] [-f] config
Create services/collections/accounts
positional arguments:
config YAML file with data configuration
optional arguments:
-h, --help show this help message and exit
-f, --force-delete force deletion of collections and their content blocks
if collection is not defined in configuration file
(default: False)
To sync data run:
(venv) $ opentaxii-sync-data examples/data-configuration.yml
Note
To drop the databases, just delete sqlite3 files /tmp/data.db, /tmp/auth.db and restart OpenTAXII server.
Now OpenTAXII has services, collections and accounts configured and can function as a TAXII server. Check Use OpenTAXII to see how to use it.