-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add api root to taxii2 server #247
Comments
Hi, I have the same issue - did you manage to solve it? |
I did not. I got frustrated with the lack of documentation around Taxii2 and ended up writing my own server. |
Ah, thanks for the response |
Sorry. Wish i had a better answer for you. I do plan on releasing this project as it gets developed. I'll let you know when thats done, but hopefully you are able to figure out a quick answer. Best of luck |
No need to apologise - yes, please do let me know when you release your project. It seems as though there are few options when it comes to TAXII servers so another implementation would be appreciated by many I'd expect |
From what I can tell there is no way to create TAXII2 api roots and collections from the data config file at the moment. There are some cli utilities that can do it behind the scenes, however (opentaxii-add-api-root and opentaxii-add-collection). I'm going to look into cleaning that up in the future but I'm trying to fix some of the base TAXII2 functionality first. |
It looks like you have to modify |
That seems to be for their product based on the opentaxii package, but this project doesn't actually contain or reference a platform_settings.py file. It and TAXII2_API_ROOT appear nowhere in the code. It sounds like they have something else built on top of it to create an API root that isn't included. |
@andrewbeard You are right. I started playing with
|
@dragsu I think you need to change your persistence api class from SQLDatabaseAPI to Taxii2SQLDatabaseAPI. |
Yes that helped. Thank you @andrewbeard . Just posting here for info.
This should create the required tables for taxii2. Then run the below commands to create
If all goes well, you should be able to test the server using the following curl commands.
|
When I try to push data as below,
I get an error response with the following message.
|
@dragsu I would recommend opening a new issue for that one, since it seems like you've gotten past the scope of the api root. When you open it please include the logs from the server and not just the client response. |
@andrewbeard I did a bit more debugging and found the reason for the error. Currently Now I can send the STIX objects to the server and store them successfully. However, there is a Edit: Does anyone know whether owners accept bug fixes? |
@dragsu My understanding is that spec version should be something like "2.0" or "2.1". I know I saw an issue earlier with spec_version being a copy of type, though. In any event there should probably be a length check in the server rather than an obscure error message. Unfortunately with the UUID JSON error you've found a VERY well known issue with the current code in the repo (#243). There are multiple PRs for that issue pending, but anyone with write access seems to have disappeared over a year ago. Aside from recommending a fork of the repo I can't help much there. |
That sounds like a good reason to move to Medallion for TAXII 2.x. |
I'm having trouble with the syntax in the data-configuration.yml file in order to implement an api-root on the system. I have the taxii2 server up and responding but cannot get an api-root to show in the system.
Please let me know what I'm doing wrong as I'm getting lost in the documentation.
Thank you,
data-config yml
`apiroots:
default: true
title: Test API Root
description: Main API Root
is_public: true
collections:
api_root_id: test_api_root
title: Main Collection
description: Main collection Information
is_public: true
is_public_write: true
accounts:
password: test
permissions:
collection-a: modify
password: admin
is_admin: yes`
opentaxii yml
`---
domain: "localhost: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
taxii2:
allow_custom_properties: true
contact: [email protected]
description: TAXII2 Server
max_content_length: 2048
persistence_api:
class: opentaxii.persistence.sqldb.Taxii2SQLDatabaseAPI
parameters:
create_tables: true
db_connection: sqlite:////tmp/data.db
public_discovery: true
title: Taxii2.1 Service
logging:
opentaxii: info
root: info`
The text was updated successfully, but these errors were encountered: