taxii2-client


Nametaxii2-client JSON
Version 2.3.0 PyPI version JSON
download
home_pagehttps://oasis-open.github.io/cti-documentation/
SummaryTAXII 2 Client Library
upload_time2021-03-12 21:19:08
maintainerEmmanuelle Vargas-Gonzalez
docs_urlNone
authorOASIS Cyber Threat Intelligence Technical Committee
requires_python
licenseBSD
keywords taxii taxii2 client json cti cyber threat intelligence
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            |Build_Status| |Coverage| |Version|

cti-taxii-client
================

NOTE: This is an `OASIS TC Open Repository
<https://www.oasis-open.org/resources/open-repositories/>`_. See the
`Governance`_ section 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 Discovery
- Get API Root Information
- Get Status
- Get Collections
- Get a Collection
- Get Objects
- Add Objects
- Get an Object
- Delete an Object (2.1 only)
- Get Object Manifests
- Get Object Versions (2.1 only)

Installation
------------

The easiest way to install the TAXII client is with pip

.. code-block:: bash

   $ pip install taxii2-client

Usage
-----

The TAXII client is intended to be used as a Python library.  There are no
command line clients at this time.

``taxii2-client`` provides four classes:

- ``Server``
- ``ApiRoot``
- ``Collection``
- ``Status``

Each can be instantiated by passing a `url`, and (optional) `user` and
`password` arguments. 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:

.. code-block:: python

   from taxii2client.v21 import Server
   server = Server('https://example.com/taxii2/', user='user_id', password='user_password')

Once you have instantiated a ``Server`` object, you can get all metadata about
its contents via its properties:

.. code-block:: python

   print(server.title)

This will lazily load and cache the server's information in the instance:

- ``api_roots``
- ``title``
- ``description``
- ``default`` (i.e. the default API root)
- ``contact``

You can follow references to ``ApiRoot`` objects,
``Collection`` objects, and (STIX) objects in those collections.

.. code-block:: python

   api_root = server.api_roots[0]
   collection = api_root.collections[0]
   collection.add_objects(stix_bundle)

Each ``ApiRoot`` has attributes corresponding to its meta data

- ``title``
- ``description``
- ``max_content_length``
- ``collections``

Each ``Collection`` has attributes corresponding to its meta data:

- ``id``
- ``title``
- ``description``
- ``alias`` (2.1 only)
- ``can_write``
- ``can_read``
- ``media_types``

A ``Collection`` can also be instantiated directly:

.. code-block:: python

    # Performing TAXII 2.0 Requests
    from taxii2client.v20 import Collection, as_pages

    collection = 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) requests
    print(collection.get_objects())
    print(collection.get_manifest())

    # For pagination requests.
    # Use *args for other arguments to the call and **kwargs to pass filter information
    for bundle in as_pages(collection.get_objects, per_request=50):
        print(bundle)

    for manifest_resource in as_pages(collection.get_manifest, per_request=50):
        print(manifest_resource)

    # ---------------------------------------------------------------- #
    # Performing TAXII 2.1 Requests
    from taxii2client.v21 import Collection, as_pages

    collection = 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) requests
    print(collection.get_objects())
    print(collection.get_manifest())

    # For pagination requests.
    # Use *args for other arguments to the call and **kwargs to pass filter information
    for envelope in as_pages(collection.get_objects, per_request=50):
        print(envelope)

    for manifest_resource in as_pages(collection.get_manifest, per_request=50):
        print(manifest_resource)

In addition to the object-specific properties and methods, all classes have a
``refresh()`` method that reloads the URL corresponding to that resource, to
ensure properties have the most up-to-date values.

Governance
----------

This GitHub public repository (
**https://github.com/oasis-open/cti-taxii-client** ) was created at the request
of the `OASIS Cyber Threat Intelligence (CTI) TC
<https://www.oasis-open.org/committees/cti/>`__ as an `OASIS TC Open Repository
<https://www.oasis-open.org/resources/open-repositories/>`__ to 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 are `separate and distinct
<https://github.com/oasis-open/cti-taxii-client/blob/master/CONTRIBUTING.md#governance-distinct-from-oasis-tc-process>`__
from the OASIS TC Process and related policies.

All contributions made to this TC Open Repository are subject to open source
license terms expressed in the `BSD-3-Clause License
<https://www.oasis-open.org/sites/www.oasis-open.org/files/BSD-3-Clause.txt>`__.
That license was selected as the declared `"Applicable License"
<https://www.oasis-open.org/resources/open-repositories/licenses>`__ when the
TC Open Repository was created.

As documented in `"Public Participation Invited
<https://github.com/oasis-open/cti-taxii-client/blob/master/CONTRIBUTING.md#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 the `OASIS TC Open Repository Guidelines and
Procedures
<https://www.oasis-open.org/policies-guidelines/open-repositories>`__, the open
source `LICENSE
<https://github.com/oasis-open/cti-taxii-client/blob/master/LICENSE>`__
designated for this particular repository, and the requirement for an
`Individual Contributor License Agreement
<https://www.oasis-open.org/resources/open-repositories/cla/individual-cla>`__
that governs intellectual property.

Maintainers
-----------

TC Open Repository `Maintainers
<https://www.oasis-open.org/resources/open-repositories/maintainers-guide>`__
are responsible for oversight of this project's community development
activities, including evaluation of GitHub `pull requests
<https://github.com/oasis-open/cti-taxii-client/blob/master/CONTRIBUTING.md#fork-and-pull-collaboration-model>`__
and `preserving
<https://www.oasis-open.org/policies-guidelines/open-repositories#repositoryManagement>`__
open 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, per `consensus agreements
<https://www.oasis-open.org/resources/open-repositories/maintainers-guide#additionalMaintainers>`__.

Current Maintainers of this TC Open Repository
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-  `Chris Lenk <mailto:clenk@mitre.org>`__; GitHub ID:
   https://github.com/clenk/; WWW: `MITRE
   Corporation <https://www.mitre.org/>`__
-  `Rich Piazza <mailto:rpiazza@mitre.org>`__; GitHub ID:
   https://github.com/rpiazza/; WWW: `MITRE
   Corporation <https://www.mitre.org/>`__
-  `Emmanuelle Vargas-Gonzalez <mailto:emmanuelle@mitre.org>`__; GitHub ID:
   https://github.com/emmanvg/; WWW: `MITRE
   Corporation <https://www.mitre.org/>`__
-  `Jason Keirstead <mailto:Jason.Keirstead@ca.ibm.com>`__; GitHub ID:
   https://github.com/JasonKeirstead; WWW: `IBM <http://www.ibm.com/>`__

About OASIS TC Open Repositories
--------------------------------

-  `TC Open Repositories: Overview and
   Resources <https://www.oasis-open.org/resources/open-repositories/>`__
-  `Frequently Asked
   Questions <https://www.oasis-open.org/resources/open-repositories/faq>`__
-  `Open Source
   Licenses <https://www.oasis-open.org/resources/open-repositories/licenses>`__
-  `Contributor License Agreements
   (CLAs) <https://www.oasis-open.org/resources/open-repositories/cla>`__
-  `Maintainers' Guidelines and
   Agreement <https://www.oasis-open.org/resources/open-repositories/maintainers-guide>`__

Feedback
--------

Questions 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 <#currentMaintainers>`__. Please send general questions about Open
Repository participation to OASIS Staff at repository-admin@oasis-open.org and
any specific CLA-related questions to repository-cla@oasis-open.org.

.. |Build_Status| image:: https://github.com/oasis-open/cti-taxii-client/workflows/cti-taxii-client%20test%20harness/badge.svg
   :target: https://github.com/oasis-open/cti-taxii-client/actions?query=workflow%3A%22cti-taxii-client+test+harness%22
.. |Coverage| image:: https://codecov.io/gh/oasis-open/cti-taxii-client/branch/master/graph/badge.svg
   :target: https://codecov.io/gh/oasis-open/cti-taxii-client
.. |Version| image:: https://img.shields.io/pypi/v/taxii2-client.svg?maxAge=3600
   :target: https://pypi.python.org/pypi/taxii2-client/



            

Raw data

            {
    "_id": null,
    "home_page": "https://oasis-open.github.io/cti-documentation/",
    "name": "taxii2-client",
    "maintainer": "Emmanuelle Vargas-Gonzalez",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "emmanuelle@mitre.org",
    "keywords": "taxii taxii2 client json cti cyber threat intelligence",
    "author": "OASIS Cyber Threat Intelligence Technical Committee",
    "author_email": "cti-users@lists.oasis-open.org",
    "download_url": "https://files.pythonhosted.org/packages/75/0f/e556615441432c8a7e07db7695931dbb338e1e177a5faf428cd0eeaace64/taxii2-client-2.3.0.tar.gz",
    "platform": "",
    "description": "|Build_Status| |Coverage| |Version|\r\n\r\ncti-taxii-client\r\n================\r\n\r\nNOTE: This is an `OASIS TC Open Repository\r\n<https://www.oasis-open.org/resources/open-repositories/>`_. See the\r\n`Governance`_ section for more information.\r\n\r\ncti-taxii-client is a minimal client implementation for the TAXII 2.X server.\r\nIt supports the following TAXII 2.X API services:\r\n\r\n- Server Discovery\r\n- Get API Root Information\r\n- Get Status\r\n- Get Collections\r\n- Get a Collection\r\n- Get Objects\r\n- Add Objects\r\n- Get an Object\r\n- Delete an Object (2.1 only)\r\n- Get Object Manifests\r\n- Get Object Versions (2.1 only)\r\n\r\nInstallation\r\n------------\r\n\r\nThe easiest way to install the TAXII client is with pip\r\n\r\n.. code-block:: bash\r\n\r\n   $ pip install taxii2-client\r\n\r\nUsage\r\n-----\r\n\r\nThe TAXII client is intended to be used as a Python library.  There are no\r\ncommand line clients at this time.\r\n\r\n``taxii2-client`` provides four classes:\r\n\r\n- ``Server``\r\n- ``ApiRoot``\r\n- ``Collection``\r\n- ``Status``\r\n\r\nEach can be instantiated by passing a `url`, and (optional) `user` and\r\n`password` arguments. The authorization information is stored in the instance,\r\nso it need not be supplied explicitly when requesting services. By default, the\r\nlatest version of the supported spec will be imported. If you need a specific\r\nversion you can perform the following:\r\n\r\n.. code-block:: python\r\n\r\n   from taxii2client.v21 import Server\r\n   server = Server('https://example.com/taxii2/', user='user_id', password='user_password')\r\n\r\nOnce you have instantiated a ``Server`` object, you can get all metadata about\r\nits contents via its properties:\r\n\r\n.. code-block:: python\r\n\r\n   print(server.title)\r\n\r\nThis will lazily load and cache the server's information in the instance:\r\n\r\n- ``api_roots``\r\n- ``title``\r\n- ``description``\r\n- ``default`` (i.e. the default API root)\r\n- ``contact``\r\n\r\nYou can follow references to ``ApiRoot`` objects,\r\n``Collection`` objects, and (STIX) objects in those collections.\r\n\r\n.. code-block:: python\r\n\r\n   api_root = server.api_roots[0]\r\n   collection = api_root.collections[0]\r\n   collection.add_objects(stix_bundle)\r\n\r\nEach ``ApiRoot`` has attributes corresponding to its meta data\r\n\r\n- ``title``\r\n- ``description``\r\n- ``max_content_length``\r\n- ``collections``\r\n\r\nEach ``Collection`` has attributes corresponding to its meta data:\r\n\r\n- ``id``\r\n- ``title``\r\n- ``description``\r\n- ``alias`` (2.1 only)\r\n- ``can_write``\r\n- ``can_read``\r\n- ``media_types``\r\n\r\nA ``Collection`` can also be instantiated directly:\r\n\r\n.. code-block:: python\r\n\r\n    # Performing TAXII 2.0 Requests\r\n    from taxii2client.v20 import Collection, as_pages\r\n\r\n    collection = Collection('https://example.com/api1/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116')\r\n    print(collection.get_object('indicator--252c7c11-daf2-42bd-843b-be65edca9f61'))\r\n\r\n    # For normal (no pagination) requests\r\n    print(collection.get_objects())\r\n    print(collection.get_manifest())\r\n\r\n    # For pagination requests.\r\n    # Use *args for other arguments to the call and **kwargs to pass filter information\r\n    for bundle in as_pages(collection.get_objects, per_request=50):\r\n        print(bundle)\r\n\r\n    for manifest_resource in as_pages(collection.get_manifest, per_request=50):\r\n        print(manifest_resource)\r\n\r\n    # ---------------------------------------------------------------- #\r\n    # Performing TAXII 2.1 Requests\r\n    from taxii2client.v21 import Collection, as_pages\r\n\r\n    collection = Collection('https://example.com/api1/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116')\r\n    print(collection.get_object('indicator--252c7c11-daf2-42bd-843b-be65edca9f61'))\r\n\r\n    # For normal (no pagination) requests\r\n    print(collection.get_objects())\r\n    print(collection.get_manifest())\r\n\r\n    # For pagination requests.\r\n    # Use *args for other arguments to the call and **kwargs to pass filter information\r\n    for envelope in as_pages(collection.get_objects, per_request=50):\r\n        print(envelope)\r\n\r\n    for manifest_resource in as_pages(collection.get_manifest, per_request=50):\r\n        print(manifest_resource)\r\n\r\nIn addition to the object-specific properties and methods, all classes have a\r\n``refresh()`` method that reloads the URL corresponding to that resource, to\r\nensure properties have the most up-to-date values.\r\n\r\nGovernance\r\n----------\r\n\r\nThis GitHub public repository (\r\n**https://github.com/oasis-open/cti-taxii-client** ) was created at the request\r\nof the `OASIS Cyber Threat Intelligence (CTI) TC\r\n<https://www.oasis-open.org/committees/cti/>`__ as an `OASIS TC Open Repository\r\n<https://www.oasis-open.org/resources/open-repositories/>`__ to support\r\ndevelopment of open source resources related to Technical Committee work.\r\n\r\nWhile this TC Open Repository remains associated with the sponsor TC, its\r\ndevelopment priorities, leadership, intellectual property terms, participation\r\nrules, and other matters of governance are `separate and distinct\r\n<https://github.com/oasis-open/cti-taxii-client/blob/master/CONTRIBUTING.md#governance-distinct-from-oasis-tc-process>`__\r\nfrom the OASIS TC Process and related policies.\r\n\r\nAll contributions made to this TC Open Repository are subject to open source\r\nlicense terms expressed in the `BSD-3-Clause License\r\n<https://www.oasis-open.org/sites/www.oasis-open.org/files/BSD-3-Clause.txt>`__.\r\nThat license was selected as the declared `\"Applicable License\"\r\n<https://www.oasis-open.org/resources/open-repositories/licenses>`__ when the\r\nTC Open Repository was created.\r\n\r\nAs documented in `\"Public Participation Invited\r\n<https://github.com/oasis-open/cti-taxii-client/blob/master/CONTRIBUTING.md#public-participation-invited>`__\",\r\ncontributions to this OASIS TC Open Repository are invited from all parties,\r\nwhether affiliated with OASIS or not. Participants must have a GitHub account,\r\nbut no fees or OASIS membership obligations are required. Participation is\r\nexpected to be consistent with the `OASIS TC Open Repository Guidelines and\r\nProcedures\r\n<https://www.oasis-open.org/policies-guidelines/open-repositories>`__, the open\r\nsource `LICENSE\r\n<https://github.com/oasis-open/cti-taxii-client/blob/master/LICENSE>`__\r\ndesignated for this particular repository, and the requirement for an\r\n`Individual Contributor License Agreement\r\n<https://www.oasis-open.org/resources/open-repositories/cla/individual-cla>`__\r\nthat governs intellectual property.\r\n\r\nMaintainers\r\n-----------\r\n\r\nTC Open Repository `Maintainers\r\n<https://www.oasis-open.org/resources/open-repositories/maintainers-guide>`__\r\nare responsible for oversight of this project's community development\r\nactivities, including evaluation of GitHub `pull requests\r\n<https://github.com/oasis-open/cti-taxii-client/blob/master/CONTRIBUTING.md#fork-and-pull-collaboration-model>`__\r\nand `preserving\r\n<https://www.oasis-open.org/policies-guidelines/open-repositories#repositoryManagement>`__\r\nopen source principles of openness and fairness. Maintainers are recognized and\r\ntrusted experts who serve to implement community goals and consensus design\r\npreferences.\r\n\r\nInitially, the associated TC members have designated one or more persons to\r\nserve as Maintainer(s); subsequently, participating community members may select\r\nadditional or substitute Maintainers, per `consensus agreements\r\n<https://www.oasis-open.org/resources/open-repositories/maintainers-guide#additionalMaintainers>`__.\r\n\r\nCurrent Maintainers of this TC Open Repository\r\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\r\n-  `Chris Lenk <mailto:clenk@mitre.org>`__; GitHub ID:\r\n   https://github.com/clenk/; WWW: `MITRE\r\n   Corporation <https://www.mitre.org/>`__\r\n-  `Rich Piazza <mailto:rpiazza@mitre.org>`__; GitHub ID:\r\n   https://github.com/rpiazza/; WWW: `MITRE\r\n   Corporation <https://www.mitre.org/>`__\r\n-  `Emmanuelle Vargas-Gonzalez <mailto:emmanuelle@mitre.org>`__; GitHub ID:\r\n   https://github.com/emmanvg/; WWW: `MITRE\r\n   Corporation <https://www.mitre.org/>`__\r\n-  `Jason Keirstead <mailto:Jason.Keirstead@ca.ibm.com>`__; GitHub ID:\r\n   https://github.com/JasonKeirstead; WWW: `IBM <http://www.ibm.com/>`__\r\n\r\nAbout OASIS TC Open Repositories\r\n--------------------------------\r\n\r\n-  `TC Open Repositories: Overview and\r\n   Resources <https://www.oasis-open.org/resources/open-repositories/>`__\r\n-  `Frequently Asked\r\n   Questions <https://www.oasis-open.org/resources/open-repositories/faq>`__\r\n-  `Open Source\r\n   Licenses <https://www.oasis-open.org/resources/open-repositories/licenses>`__\r\n-  `Contributor License Agreements\r\n   (CLAs) <https://www.oasis-open.org/resources/open-repositories/cla>`__\r\n-  `Maintainers' Guidelines and\r\n   Agreement <https://www.oasis-open.org/resources/open-repositories/maintainers-guide>`__\r\n\r\nFeedback\r\n--------\r\n\r\nQuestions or comments about this TC Open Repository's activities should be composed\r\nas GitHub issues or comments. If use of an issue/comment is not possible or\r\nappropriate, questions may be directed by email to the Maintainer(s) `listed\r\nabove <#currentMaintainers>`__. Please send general questions about Open\r\nRepository participation to OASIS Staff at repository-admin@oasis-open.org and\r\nany specific CLA-related questions to repository-cla@oasis-open.org.\r\n\r\n.. |Build_Status| image:: https://github.com/oasis-open/cti-taxii-client/workflows/cti-taxii-client%20test%20harness/badge.svg\r\n   :target: https://github.com/oasis-open/cti-taxii-client/actions?query=workflow%3A%22cti-taxii-client+test+harness%22\r\n.. |Coverage| image:: https://codecov.io/gh/oasis-open/cti-taxii-client/branch/master/graph/badge.svg\r\n   :target: https://codecov.io/gh/oasis-open/cti-taxii-client\r\n.. |Version| image:: https://img.shields.io/pypi/v/taxii2-client.svg?maxAge=3600\r\n   :target: https://pypi.python.org/pypi/taxii2-client/\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "TAXII 2 Client Library",
    "version": "2.3.0",
    "split_keywords": [
        "taxii",
        "taxii2",
        "client",
        "json",
        "cti",
        "cyber",
        "threat",
        "intelligence"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "6037ef390dbdd44507985eecb4227364",
                "sha256": "b4212b8a8bab170cd5dc386ca3ea36bc44b53932f1da30db150abeef00bce7b9"
            },
            "downloads": -1,
            "filename": "taxii2_client-2.3.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6037ef390dbdd44507985eecb4227364",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 24943,
            "upload_time": "2021-03-12T21:19:06",
            "upload_time_iso_8601": "2021-03-12T21:19:06.990241Z",
            "url": "https://files.pythonhosted.org/packages/36/0b/7d9cf9f11f0299072399a237d06bc7c433d06e735c923e8b7a656858d27d/taxii2_client-2.3.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "9a8b007dbc687a4a4a76413ea3fee3a6",
                "sha256": "fb3bf895e2eaff3cd08bb7aad75c9d30682ffc00b9f3add77de3a67dc6b895a3"
            },
            "downloads": -1,
            "filename": "taxii2-client-2.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9a8b007dbc687a4a4a76413ea3fee3a6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 23649,
            "upload_time": "2021-03-12T21:19:08",
            "upload_time_iso_8601": "2021-03-12T21:19:08.516035Z",
            "url": "https://files.pythonhosted.org/packages/75/0f/e556615441432c8a7e07db7695931dbb338e1e177a5faf428cd0eeaace64/taxii2-client-2.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-03-12 21:19:08",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "taxii2-client"
}
        
Elapsed time: 0.05803s