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

Get all collections #181

Open
Aekansh-Ak opened this issue Jan 10, 2024 · 1 comment
Open

Get all collections #181

Aekansh-Ak opened this issue Jan 10, 2024 · 1 comment

Comments

@Aekansh-Ak
Copy link

Hi,

I am trying to get all collection id's so that I can iterate over it.

from taxii2client.v21 import Server, Collection

taxii_server_url = "http://localhost:5000/trustgroup1/"
username = "admin"
password = "Password0"

Create a TAXII Server object
taxii_server = Server(taxii_server_url, user=username, password=password)

Get the API Root information from the TAXII server
api_root = taxii_server.title
print(api_root)
api_root = taxii_server.api_roots[0]
collection = api_root.collections[0]

#Gives Me error-:
api_root = taxii_server.api_roots[0]
IndexError: list index out of range

Am I putting the wrong URL?

@chisholm
Copy link
Contributor

Yes: you need a URL to a TAXII discovery endpoint. The TAXII 2.1 spec says it must be /taxii2/ [1]. Try using http://localhost:5000/taxii2/.

  1. https://docs.oasis-open.org/cti/taxii/v2.1/os/taxii-v2.1-os.html#_Toc31107526

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