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

Cannot run example #548

Open
IgorGanapolsky opened this issue Jun 16, 2022 · 3 comments
Open

Cannot run example #548

IgorGanapolsky opened this issue Jun 16, 2022 · 3 comments

Comments

@IgorGanapolsky
Copy link

Hello, when I run your example in the examples folder, I get an error:

/Users/igorganapolsky/workspace/git/Andreww6/gists/venv/bin/python /Users/igorganapolsky/workspace/git/Andreww6/gists/main.py
Traceback (most recent call last):
File "/Users/igorganapolsky/workspace/git/Andreww6/gists/venv/lib/python3.11/site-packages/stix2/datastore/taxii.py", line 163, in init
if collection.can_read:
^^^^^^^^^^^^^^^^^^^
File "/Users/igorganapolsky/workspace/git/Andreww6/gists/venv/lib/python3.11/site-packages/taxii2client/v21/init.py", line 285, in can_read
self._ensure_loaded()
^^^^^^^^^^^^^^^^^^^^^
File "/Users/igorganapolsky/workspace/git/Andreww6/gists/venv/lib/python3.11/site-packages/taxii2client/v21/init.py", line 354, in _ensure_loaded
self.refresh()
^^^^^^^^^^^^^^
File "/Users/igorganapolsky/workspace/git/Andreww6/gists/venv/lib/python3.11/site-packages/taxii2client/v21/init.py", line 368, in refresh
response = self.__raw = self._conn.get(self.url, headers={"Accept": accept})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/igorganapolsky/workspace/git/Andreww6/gists/venv/lib/python3.11/site-packages/taxii2client/common.py", line 310, in get
raise e
^^^^^^^
File "/Users/igorganapolsky/workspace/git/Andreww6/gists/venv/lib/python3.11/site-packages/taxii2client/common.py", line 300, in get
resp.raise_for_status()
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/igorganapolsky/workspace/git/Andreww6/gists/venv/lib/python3.11/site-packages/requests/models.py", line 1022, in raise_for_status
raise HTTPError(http_error_msg, response=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: http://127.0.0.1:5000/trustgroup1/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/igorganapolsky/workspace/git/Andreww6/gists/main.py", line 39, in
main()
^^^^^^
File "/Users/igorganapolsky/workspace/git/Andreww6/gists/main.py", line 13, in main
taxii = stix2.TAXIICollectionSource(collection)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/igorganapolsky/workspace/git/Andreww6/gists/venv/lib/python3.11/site-packages/stix2/datastore/taxii.py", line 172, in init
raise DataSourceError(
^^^^^^^^^^^^^^^^^^^^^^
stix2.datastore.DataSourceError: The underlying TAXII Collection resource defined in the supplied TAXII Collection object provided could not be reached. Recieved error: "403 Client Error: Forbidden for url: http://127.0.0.1:5000/trustgroup1/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116/"

Process finished with exit code 1

@chisholm
Copy link
Contributor

Looks like a permission error. Did you run it with medallion as the TAXII server? Did you use the configuration and data included with that project?

@IgorGanapolsky
Copy link
Author

I just used the default config. I did not set up a separate TAXII server. Do I need to?

@rpiazza
Copy link
Contributor

rpiazza commented Jun 21, 2022

@IgorGanapolsky - yes you need to run a TAXII server if you want to use the TAXII data store.
See https://github.com/oasis-open/cti-taxii-server. You probably want to use the MemoryBackend

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

3 participants