muchdogesec / arango_taxii_server

A lightweight TAXII API wrapper for ArangoDB.
GNU Affero General Public License v3.0
2 stars 0 forks source link
arangodb stix2 taxii2

Arango TAXII Server

Overview

Arango TAXII Server is a production ready implementation of a TAXII 2.1 Server designed to work with ArangoDB.

Install

Download and configure

# clone the latest code
git clone https://github.com/muchdogesec/arango_taxii_server
cd arango_taxii_server
# fetch submodules
git submodule update --init --recursive

Setup configoration options

You will need to create an .env file as follows;

cp .env.example .env

You will then need to specify details of your ArangoDB server.

You can also set the TAXII Server information in this file.

ArangoDB install

Note, this script will not install an ArangoDB instance.

If you're new to ArangoDB, you can install the community edition quickly by following the instructions here.

Build the Docker Image

sudo docker-compose build

Start the server

sudo docker-compose up

Access the server

The webserver (Django) should now be running on: http://127.0.0.1:8000/

You can access the Swagger UI for the API in a browser at: http://127.0.0.1:8000/api/schema/swagger-ui/

Adding data to the server

It is STRONGLY recommend you seed your ArangoDB database using stix2arango. If not, that is OK, but it is imperative you create Databases and Collection as follows;

Git submodule use

We try and keep this repo in sync with the remote cve2stix / cpe2stix repos used as Git submodules when changes happen.

Sometimes this is not always the case (either because we've forgot, or there are breaking changes).

If it's the case we've forgotten, you can update the Git Submodules in this repo as follows:

cd stix2arango
git checkout main
git pull

Important design decisions

The following information should hopefully help you to determine if this TAXII implementation is right for you.

STIX / TAXII versions

Databases

This code is only designed to work with ArangoDB. That includes all versions of ArangoDB, including the free community edition.

Users / Authentication / Permissions

Authentication is managed by ArangoDB.

Under the _system database, admin users can add or remove other users from the system.

Each user has a username and password.

These values are used to authenticate against the API, using basic auth in the header of each request;

Authorization: Basic <credentials>

Users can also be assigned permissions on a database and Collection level.

A user can be assigned read/write or read permissions to a Collection.

ArangoDB -> TAXII mapping

ArangoDB has the following structure

├── database
│   ├── document collection
│   ├── document collection N
│   ├── edge collection
│   └── edge collection N
├── database N
│   ├── document collection
│   ├── document collection N
│   ├── edge collection
│   └── edge collection N
├── ...

An ArangoDB database has the following attributes;

An ArangoDB collection has the following attributes;

TAXII has the following structure


├── api-root
│   ├── collection
│   │   └── stix objects
│   └── collection
│       └── stix objects
├── api-root
│   ├── collection
│   │   └── stix objects
│   └── collection
│       └── stix objects
├── ...

A TAXII root has the following attributes;

A TAXII collection has the following attributes:

In Arango TAXII Server; ArangoDB Databases map to TAXII API Roots as follow...

TAXII attribute -> ArangoDB attribute

In Arango TAXII server; ArangoDB Collections map to TAXII Collections as follow...

TAXII attribute -> ArangoDB attribute

stix2arango coupling

Arango TAXII Server uses stix2arango as a middleware component when creating objects (Add Object endpoint).

The two important things to be aware of about this coupling is that

  1. Arango TAXII Server expects 2 collections with the same name, one with the edge suffix and one with the vertex suffix (e.g. my_taxii_edge_collection and my_taxii_vertex_collection) to store objects correctly.
  2. For any request these ArangoDB Collections exposed to the user as a single TAXII collection called my_taxii, but under the hood both Collections are used.

Useful supporting tools

Other TAXII server implementations

We realise not everyone will want to use ArangoDB. Here are some other open-source TAXII server options you could consider;

Support

If you are a paying DOGESEC customer, please contact our support team.

For everyone else, minimal support provided via the DOGESEC community.

License

AGPLv3.