Package: taxii2-client
cti-taxii-clientNOTE: This is anOASIS TC Open Repository. See theGovernancesection for more information.cti-taxii-client is a minimal client implementation for the TAXII 2.X server.
It supports the following TAXII 2.X API services:Server DiscoveryGet API Root InformationGet StatusGet CollectionsGet a CollectionGet ObjectsAdd ObjectsGet an ObjectDelete an Object (2.1 only)Get Object ManifestsGet Object Versions (2.1 only)InstallationThe easiest way to install the TAXII client is with pip$pipinstalltaxii2-clientUsageThe TAXII client is intended to be used as a Python library.  There are no
command line clients at this time.taxii2-clientprovides four classes:ServerApiRootCollectionStatusEach can be instantiated by passing aurl, and (optional)userandpasswordarguments. The authorization information is stored in the instance,
so it need not be supplied explicitly when requesting services. By default, the
latest version of the supported spec will be imported. If you need a specific
version you can perform the following:fromtaxii2client.v21importServerserver=Server('https://example.com/taxii2/',user='user_id',password='user_password')Once you have instantiated aServerobject, you can get all metadata about
its contents via its properties:print(server.title)This will lazily load and cache the server’s information in the instance:api_rootstitledescriptiondefault(i.e. the default API root)contactYou can follow references toApiRootobjects,Collectionobjects, and (STIX) objects in those collections.api_root=server.api_roots[0]collection=api_root.collections[0]collection.add_objects(stix_bundle)EachApiRoothas attributes corresponding to its meta datatitledescriptionmax_content_lengthcollectionsEachCollectionhas attributes corresponding to its meta data:idtitledescriptionalias(2.1 only)can_writecan_readmedia_typesACollectioncan also be instantiated directly:# Performing TAXII 2.0 Requestsfromtaxii2client.v20importCollection,as_pagescollection=Collection('https://example.com/api1/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116')print(collection.get_object('indicator--252c7c11-daf2-42bd-843b-be65edca9f61'))# For normal (no pagination) requestsprint(collection.get_objects())print(collection.get_manifest())# For pagination requests.# Use *args for other arguments to the call and **kwargs to pass filter informationforbundleinas_pages(collection.get_objects,per_request=50):print(bundle)formanifest_resourceinas_pages(collection.get_manifest,per_request=50):print(manifest_resource)# ---------------------------------------------------------------- ## Performing TAXII 2.1 Requestsfromtaxii2client.v21importCollection,as_pagescollection=Collection('https://example.com/api1/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116')print(collection.get_object('indicator--252c7c11-daf2-42bd-843b-be65edca9f61'))# For normal (no pagination) requestsprint(collection.get_objects())print(collection.get_manifest())# For pagination requests.# Use *args for other arguments to the call and **kwargs to pass filter informationforenvelopeinas_pages(collection.get_objects,per_request=50):print(envelope)formanifest_resourceinas_pages(collection.get_manifest,per_request=50):print(manifest_resource)In addition to the object-specific properties and methods, all classes have arefresh()method that reloads the URL corresponding to that resource, to
ensure properties have the most up-to-date values.GovernanceThis GitHub public repository (https://github.com/oasis-open/cti-taxii-client) was created at the request
of theOASIS Cyber Threat Intelligence (CTI) TCas anOASIS TC Open Repositoryto support
development of open source resources related to Technical Committee work.While this TC Open Repository remains associated with the sponsor TC, its
development priorities, leadership, intellectual property terms, participation
rules, and other matters of governance areseparate and distinctfrom the OASIS TC Process and related policies.All contributions made to this TC Open Repository are subject to open source
license terms expressed in theBSD-3-Clause License.
That license was selected as the declared“Applicable License”when the
TC Open Repository was created.As documented in“Public Participation Invited”,
contributions to this OASIS TC Open Repository are invited from all parties,
whether affiliated with OASIS or not. Participants must have a GitHub account,
but no fees or OASIS membership obligations are required. Participation is
expected to be consistent with theOASIS TC Open Repository Guidelines and
Procedures, the open
sourceLICENSEdesignated for this particular repository, and the requirement for anIndividual Contributor License Agreementthat governs intellectual property.MaintainersTC Open RepositoryMaintainersare responsible for oversight of this project’s community development
activities, including evaluation of GitHubpull requestsandpreservingopen source principles of openness and fairness. Maintainers are recognized and
trusted experts who serve to implement community goals and consensus design
preferences.Initially, the associated TC members have designated one or more persons to
serve as Maintainer(s); subsequently, participating community members may select
additional or substitute Maintainers, perconsensus agreements.Current Maintainers of this TC Open RepositoryChris Lenk; GitHub ID:https://github.com/clenk/; WWW:MITRE
CorporationRich Piazza; GitHub ID:https://github.com/rpiazza/; WWW:MITRE
CorporationEmmanuelle Vargas-Gonzalez; GitHub ID:https://github.com/emmanvg/; WWW:MITRE
CorporationJason Keirstead; GitHub ID:https://github.com/JasonKeirstead; WWW:IBMAbout OASIS TC Open RepositoriesTC Open Repositories: Overview and
ResourcesFrequently Asked
QuestionsOpen Source
LicensesContributor License Agreements
(CLAs)Maintainers’ Guidelines and
AgreementFeedbackQuestions or comments about this TC Open Repository’s activities should be composed
as GitHub issues or comments. If use of an issue/comment is not possible or
appropriate, questions may be directed by email to the Maintainer(s)listed
above. Please send general questions about Open
Repository participation to OASIS Staff atrepository-admin@oasis-open.organd
any specific CLA-related questions torepository-cla@oasis-open.org.