Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to configure Opentaxii to use TAXII2 #249

Open
Tyrell20 opened this issue Dec 14, 2022 · 1 comment
Open

How to configure Opentaxii to use TAXII2 #249

Tyrell20 opened this issue Dec 14, 2022 · 1 comment

Comments

@Tyrell20
Copy link

Hello,
I am facing an issue to configure opentaxii to use taxii2.
Below my configuration file:

default.yml
`---

domain: "myserver.com:9000"

support_basic_auth: yes
return_server_error_details: no

auth_api:
class: opentaxii.auth.sqldb.SQLDatabaseAPI
parameters:
db_connection: sqlite:////tmp/auth.db
create_tables: yes
secret: SECRET-STRING-NEEDS-TO-BE-CHANGED
token_ttl_secs: 3600

taxii1:

taxii2:
persistence_api:
class: opentaxii.persistence.sqldb.SQLDatabaseAPI
parameters:
db_connection: sqlite:////tmp/data.db
create_tables: yes

logging:
opentaxii: info
root: info
`

data-configuration.yml (version 1 tested)
`apiroots:

  • id: test_api_root
    default: true
    title: Test API Root
    description: Main API Root
    is_public: true

collections:

  • id: collection
    api_root_id: test_api_root
    title: Main Collection
    description: Main collection Information
    is_public: true
    is_public_write: true

accounts:

  • username: test
    password: test
    permissions:
    collection-a: modify
  • username: admin
    password: admin
    is_admin: yes
    `

data-configuration.yml (version 2 tested)

`---

domain: myserver.com:9000

services:
- id: inbox
type: inbox
address: /services/inbox
description: Inbox Service
destination_collection_required: yes
accept_all_content: yes
authentication_required: yes
supported_content:
- urn:stix.mitre.org:json:2.1
protocol_bindings:
- urn:taxii.mitre.org:protocol:http:1.0

- id: discovery
  type: discovery
  address: /services/discovery
  description: Discovery Service
  advertised_services:
    - inbox
    - discovery
    - collection_management
    - poll
  protocol_bindings:
    - urn:taxii.mitre.org:protocol:http:1.0

- id: collection_management
  type: collection_management
  address: /services/collection-management
  description: Collection Management Service
  protocol_bindings:
    - urn:taxii.mitre.org:protocol:http:1.0
 - id: poll
  type: poll
  address: /services/poll
  description: Poll Service
  subscription_required: no
  max_result_count: 100
  max_result_size: 10
  authentication_required: yes
  protocol_bindings:
    - urn:taxii.mitre.org:protocol:http:1.0

collections:

  • name: test
    available: true
    accept_all_content: true
    supported_content:
    • urn:stix.mitre.org:json:2.1
      service_ids:
    • inbox
    • collection_management
    • poll

accounts:

  • username: test
    password: test
    permissions:
    test: modify
    `

With both data-configuration.yml the command:
opentaxii-sync-data opentaxii/data-configuration.yml
do not work, reporting the error:
AttributeError: 'NoneType' object has no attribute 'persistence'

Starting server with gunicorn:
gunicorn opentaxii.http:app --bind myserver.com:9000 --config python:opentaxii.http
does not show any error.
Trying to query the server via taxii2-client I obtained the error below:
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://myserver.com:9000/taxii2/

Could you please help me to validate the configuration files e and how can I start and use the taxii2 on opentaxii?

@andrewbeard
Copy link

I've been playing around with the same thing and there are some undocumented options and fixes required. I'm in the process of submitting PRs for the issues I can find as I work through them but out of the box you're going to have a bad time.

I'm not sure how quickly PRs get accepted by the project, but in the mean time my source branch is here:
https://github.com/andrewbeard/OpenTAXII/tree/dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants