eclecticiq / OpenTAXII

TAXII server implementation in Python from EclecticIQ
BSD 3-Clause "New" or "Revised" License
185 stars 88 forks source link

how to set the config file to use taxii 2 #234

Open Dan-Vizor opened 2 years ago

Dan-Vizor commented 2 years ago

Here is my current config. From what I read in the docs this should set the server to use TAXII 2.0 however I can't curl /taxii2/api-bases/ or any other 2.0 endpoints.

Do I need to change the URLs in services and/or something else?

---
domain: "127.0.0.1:9000"

support_basic_auth: yes
save_raw_inbox_messages: yes
xml_parser_supports_huge_tree: yes
count_blocks_in_poll_responses: no
return_server_error_details: no
unauthorized_status: UNAUTHORIZED

auth_api:
  class: opentaxii.auth.sqldb.SQLDatabaseAPI
  parameters:
    db_connection: sqlite:////tmp/auth.db
    create_tables: yes
    secret: [REDACTED]
    token_ttl_secs: 3600

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

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

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

  - id: collection_management
    type: collection_management
    address: /services/collection-management
    description: Custom Collection Management Service description
    protocol_bindings:
      - urn:taxii.mitre.org:protocol:http:1.0
      - urn:taxii.mitre.org:protocol:https:1.0

  - id: poll
    type: poll
    address: /services/poll
    description: Custom Poll Service description
    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: collection
    available: true
    accept_all_content: true
    type: DATA_SET
    service_ids:
      - inbox
      - collection_management
      - poll

accounts:
  - username: API_user
    password: [REDACTED]
    permissions:
      collection: read
  - username: API_write
    password: [REDACTED]
    permissions:
      collection: modify

logging:
  opentaxii: info
  root: info
Dan-Vizor commented 2 years ago

I'd like to have both taxii1 and taxii2 enabled

whitelessk commented 1 year ago

@Dan-Vizor did you manage to enable taxii2?

zentavr commented 1 year ago

@Dan-Vizor seems like you need 2 installations for that. We created several systemd units and nginx virtualhosts in order to achieve this.

probably, you can play with location prefixes at the nginx/apache side order to make it work at the single viatualhost.