Skip to content

Commit 84c51a1

Browse files
authored
[taxii-post] Add config for api root (#6048)
1 parent 99fd2bb commit 84c51a1

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

stream/taxii-post/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ There are a number of configuration options, which are set either in `docker-com
7272
|------------------|---------------------|-----------------------------|---------|-----------|------------------------------------------------------------|
7373
| TAXII URL | taxii.url | `TAXII_URL` | | Yes | URL of the TAXII server. |
7474
| SSL Verify | taxii.ssl_verify | `TAXII_SSL_VERIFY` | true | No | Verify SSL certificates. |
75+
| API Root | taxii.api_root | `TAXII_API_ROOT` | root | No | TAXII API root (path segment between server URL and /collections/). |
7576
| Collection ID | taxii.collection_id | `TAXII_COLLECTION_ID` | | Yes | TAXII collection ID to POST to. |
7677
| Token | taxii.token | `TAXII_TOKEN` | | No | Bearer token (if set, Basic auth is ignored). |
7778
| Login | taxii.login | `TAXII_LOGIN` | | No | Username for Basic authentication. |
@@ -104,6 +105,7 @@ Configure the connector in `docker-compose.yml`:
104105
- CONNECTOR_LIVE_STREAM_ID=ChangeMe
105106
- TAXII_URL=https://taxii.example.com
106107
- TAXII_SSL_VERIFY=true
108+
- TAXII_API_ROOT=root
107109
- TAXII_COLLECTION_ID=ChangeMe
108110
- TAXII_TOKEN=ChangeMe
109111
- TAXII_VERSION=2.1

stream/taxii-post/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ services:
1515
- CONNECTOR_LOG_LEVEL=error
1616
- TAXII_URL=https://taxii.changeme.com # The URL of the TAXII Server
1717
- TAXII_SSL_VERIFY=true
18+
- TAXII_API_ROOT=root # The TAXII API root (path segment between server URL and /collections/)
1819
- TAXII_COLLECTION_ID=ChangeMe # The collection ID
1920
- TAXII_TOKEN= # Token for bearer auth (if set, will ignore basic auth params)
2021
- TAXII_LOGIN= # Login for basic auth

stream/taxii-post/src/config.yml.sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ connector:
1616
taxii:
1717
url: 'https://taxii.changeme.com' # The URL of the TAXII Server
1818
ssl_verify: true
19+
api_root: 'root' # The TAXII API root (path segment between server URL and /collections/)
1920
collection_id: 'ChangeMe' # The collection ID
2021
token: '' # Token for bearer auth (if set, will ignore basic auth params)
2122
login: 'ChangeMe' # Login for basic auth

stream/taxii-post/src/main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ def __init__(self):
7171
self.taxii_stix_version = get_config_variable(
7272
"TAXII_STIX_VERSION", ["taxii", "stix_version"], config
7373
)
74+
self.taxii_api_root = get_config_variable(
75+
"TAXII_API_ROOT", ["taxii", "api_root"], config, default="root"
76+
)
7477

7578
def check_stream_id(self):
7679
"""
@@ -90,7 +93,9 @@ def _process_message(self, msg):
9093
self.helper.log_info("Processing the object " + data["id"])
9194
url = (
9295
self.taxii_url
93-
+ "/root/collections/"
96+
+ "/"
97+
+ self.taxii_api_root
98+
+ "/collections/"
9499
+ self.taxii_collection_id
95100
+ "/objects/"
96101
)

0 commit comments

Comments
 (0)