sim-openc2


Namesim-openc2 JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/oasis-open/openc2-lycan-python
SummaryProduce and consume OpenC2 JSON messages
upload_time2024-08-20 18:49:47
maintainerNone
docs_urlNone
authorOASIS Open Command and Control (OpenC2) Technical Committee (TC)
requires_pythonNone
licenseMIT
keywords openc2 cyber
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage
            # Lycan
[![Python Support](https://img.shields.io/badge/python-3.6+-blue.svg)](https://www.python.org/)
[![Build Status](https://travis-ci.org/oasis-open/openc2-lycan-python.svg)](https://travis-ci.org/open-oasis/openc2-lycan-python)
[![Coverage Status](https://coveralls.io/repos/github/oasis-open/openc2-lycan-python/badge.svg)](https://coveralls.io/github/oasis-open/openc2-lycan-python)

Lycan is an implementation of the OpenC2 OASIS standard for command and control messaging. The current implementation is based on the Language Specification v1.0.

Given the influence of STIX/CyBoX on OpenC2, this library is heavily based on the [STIX 2 Python API](https://github.com/oasis-open/cti-python-stix2) internals. Property validation and object extension support aligns with STIX2 conventions and OpenC2 custom properties also support stix2 properties.

## Installation

Install with [pip](https://pip.pypa.io/en/stable):

```bash
$ pip install openc2
```

## Usage

```python
import openc2
import stix2

# encode
cmd = openc2.v10.Command(
    action="deny",
    target=openc2.v10.IPv4Address(ipv4_net="1.2.3.4"),
    args=openc2.v10.Args(response_requested="complete"),
)
msg = cmd.serialize()

# decode
cmd = openc2.parse(msg)
if cmd.action == "deny" and cmd.target.type == "ipv4_net":

    if cmd.args.response_requested == "complete":
        resp = openc2.v10.Response(status=200)
        msg = resp.serialize()

# custom actuator
@openc2.v10.CustomActuator(
    "x-acme-widget",
    [
        ("name", openc2.properties.StringProperty(required=True)),
        ("version", stix2.properties.FloatProperty()),
    ],
)
class AcmeWidgetActuator(object):
    def __init__(self, version=None, **kwargs):
        if version and version < 1.0:
            raise ValueError("'%f' is not a supported version." % version)

widget = AcmeWidgetActuator(name="foo", version=1.1)
```

<div>
<h2><a id="readme-general">OASIS TC Open Repository: openc2-lycan-python</a></h2>

<p>This GitHub public repository ( <b><a href="https://github.com/oasis-open/openc2-lycan-python">https://github.com/oasis-open/openc2-lycan-python</a></b> ) was created at the request of the <a href="https://www.oasis-open.org/committees/openc2/">OASIS Open Command and Control (OpenC2) TC</a> as an <a href="https://www.oasis-open.org/resources/open-repositories/">OASIS TC Open Repository</a> to support development of open source resources related to Technical Committee work.</p>

<p>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 <a href="https://github.com/oasis-open/openc2-lycan-python/blob/master/CONTRIBUTING.md#governance-distinct-from-oasis-tc-process">separate and distinct</a> from the OASIS TC Process and related policies.</p>

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

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

</div>

<div>
<h2><a id="purposeStatement">Statement of Purpose</a></h2>

<p>Statement of Purpose for this OASIS TC Open Repository (openc2-lycan-python) as <a href="https://lists.oasis-open.org/archives/openc2/201802/msg00006.html">proposed</a> and <a href="https://lists.oasis-open.org/archives/openc2/201803/msg00007.html">approved</a> [<a href="https://lists.oasis-open.org/archives/openc2/201803/msg00023.html">bis</a>] by the TC:</p>

<p>The purpose of this OASIS TC Open repository is to develop and maintain a python implementation of <a href="http://docs.oasis-open.org/openc2/">OpenC2</a>, and to provide a python codebase to facilitate other prototype efforts.  The python library is designed to support transformations between data-interchange formats (such as JSON) and python language objects.</p>

<p>The OASIS OpenC2 Technical Committee was <a href="https://www.oasis-open.org/committees/openc2/charter.php">chartered</a> to address matters as they pertain to command and control of cyber defense technologies, and to maintain a library of prototype implementations.</p>

</div>

<div><h2><a id="purposeClarifications">Additions to Statement of Purpose</a></h2>

<p>Repository Maintainers may include here any clarifications &mdash; any additional sections, subsections, and paragraphs that the Maintainer(s) wish to add as descriptive text, reflecting (sub-) project status, milestones, releases, modifications to statement of purpose, etc.  The project Maintainers will create and maintain this content on behalf of the participants.</p>
</div>

<div>
<h2><a id="maintainers">Maintainers</a></h2>

<p>TC Open Repository <a href="https://www.oasis-open.org/resources/open-repositories/maintainers-guide">Maintainers</a> are responsible for oversight of this project's community development activities, including evaluation of GitHub <a href="https://github.com/oasis-open/openc2-lycan-python/blob/master/CONTRIBUTING.md#fork-and-pull-collaboration-model">pull requests</a> and <a href="https://www.oasis-open.org/policies-guidelines/open-repositories#repositoryManagement">preserving</a> open source principles of openness and fairness. Maintainers are recognized and trusted experts who serve to implement community goals and consensus design preferences.</p>

<p>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 <a href="https://www.oasis-open.org/resources/open-repositories/maintainers-guide#additionalMaintainers">consensus agreements</a>.</p>

<p><b><a id="currentMaintainers">Current Maintainers of this TC Open Repository</a></b></p>

<ul>
<li><a href="mailto:mstair@att.com">Michael Stair</a>; GitHub ID: <a href="https://github.com/mstair/">https://github.com/mstair/</a>; WWW: <a href="https://www.att.com/">AT&amp;T</a></li>
<li><a href="mailto:zgorak@everwatchsolutions.com">Zachary Gorak</a>; GitHub ID: <a href="https://github.com/twodayslate/">https://github.com/twodayslate/</a>; WWW: <a href="https://everwatchsolutions.com/">EverWatch</a></li>
</ul>

</div>

<div><h2><a id="aboutOpenRepos">About OASIS TC Open Repositories</a></h2>

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

</div>

<div><h2><a id="feedback">Feedback</a></h2>

<p>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) <a href="#currentMaintainers">listed above</a>.  Please send general questions about TC Open Repository participation to OASIS Staff at <a href="mailto:repository-admin@oasis-open.org">repository-admin@oasis-open.org</a> and any specific CLA-related questions to <a href="mailto:repository-cla@oasis-open.org">repository-cla@oasis-open.org</a>.</p>

</div>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/oasis-open/openc2-lycan-python",
    "name": "sim-openc2",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "openc2 cyber",
    "author": "OASIS Open Command and Control (OpenC2) Technical Committee (TC)",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/a1/7d/91ce1b13b93bc8a7b4ea020a94298210488e2ba0a8741509fdf8b6cd7a5e/sim_openc2-1.1.0.tar.gz",
    "platform": null,
    "description": "# Lycan\n[![Python Support](https://img.shields.io/badge/python-3.6+-blue.svg)](https://www.python.org/)\n[![Build Status](https://travis-ci.org/oasis-open/openc2-lycan-python.svg)](https://travis-ci.org/open-oasis/openc2-lycan-python)\n[![Coverage Status](https://coveralls.io/repos/github/oasis-open/openc2-lycan-python/badge.svg)](https://coveralls.io/github/oasis-open/openc2-lycan-python)\n\nLycan is an implementation of the OpenC2 OASIS standard for command and control messaging. The current implementation is based on the Language Specification v1.0.\n\nGiven the influence of STIX/CyBoX on OpenC2, this library is heavily based on the [STIX 2 Python API](https://github.com/oasis-open/cti-python-stix2) internals. Property validation and object extension support aligns with STIX2 conventions and OpenC2 custom properties also support stix2 properties.\n\n## Installation\n\nInstall with [pip](https://pip.pypa.io/en/stable):\n\n```bash\n$ pip install openc2\n```\n\n## Usage\n\n```python\nimport openc2\nimport stix2\n\n# encode\ncmd = openc2.v10.Command(\n    action=\"deny\",\n    target=openc2.v10.IPv4Address(ipv4_net=\"1.2.3.4\"),\n    args=openc2.v10.Args(response_requested=\"complete\"),\n)\nmsg = cmd.serialize()\n\n# decode\ncmd = openc2.parse(msg)\nif cmd.action == \"deny\" and cmd.target.type == \"ipv4_net\":\n\n    if cmd.args.response_requested == \"complete\":\n        resp = openc2.v10.Response(status=200)\n        msg = resp.serialize()\n\n# custom actuator\n@openc2.v10.CustomActuator(\n    \"x-acme-widget\",\n    [\n        (\"name\", openc2.properties.StringProperty(required=True)),\n        (\"version\", stix2.properties.FloatProperty()),\n    ],\n)\nclass AcmeWidgetActuator(object):\n    def __init__(self, version=None, **kwargs):\n        if version and version < 1.0:\n            raise ValueError(\"'%f' is not a supported version.\" % version)\n\nwidget = AcmeWidgetActuator(name=\"foo\", version=1.1)\n```\n\n<div>\n<h2><a id=\"readme-general\">OASIS TC Open Repository: openc2-lycan-python</a></h2>\n\n<p>This GitHub public repository ( <b><a href=\"https://github.com/oasis-open/openc2-lycan-python\">https://github.com/oasis-open/openc2-lycan-python</a></b> ) was created at the request of the <a href=\"https://www.oasis-open.org/committees/openc2/\">OASIS Open Command and Control (OpenC2) TC</a> as an <a href=\"https://www.oasis-open.org/resources/open-repositories/\">OASIS TC Open Repository</a> to support development of open source resources related to Technical Committee work.</p>\n\n<p>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 <a href=\"https://github.com/oasis-open/openc2-lycan-python/blob/master/CONTRIBUTING.md#governance-distinct-from-oasis-tc-process\">separate and distinct</a> from the OASIS TC Process and related policies.</p>\n\n<p>All contributions made to this TC Open Repository are subject to open source license terms expressed in the <a href=\"https://www.oasis-open.org/sites/www.oasis-open.org/files/MIT-License.txt\">MIT License</a>.  That license was selected as the declared <a href=\"https://www.oasis-open.org/resources/open-repositories/licenses\">\"Applicable License\"</a> when the TC Open Repository was created.</p>\n\n<p>As documented in <a href=\"https://github.com/oasis-open/openc2-lycan-python/blob/master/CONTRIBUTING.md#public-participation-invited\">\"Public Participation Invited</a>\", 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 <a href=\"https://www.oasis-open.org/policies-guidelines/open-repositories\">OASIS TC Open Repository Guidelines and Procedures</a>, the open source <a href=\"https://github.com/oasis-open/openc2-lycan-python/blob/master/LICENSE\">LICENSE</a> designated for this particular repository, and the requirement for an <a href=\"https://www.oasis-open.org/resources/open-repositories/cla/individual-cla\">Individual Contributor License Agreement</a> that governs intellectual property.</p>\n\n</div>\n\n<div>\n<h2><a id=\"purposeStatement\">Statement of Purpose</a></h2>\n\n<p>Statement of Purpose for this OASIS TC Open Repository (openc2-lycan-python) as <a href=\"https://lists.oasis-open.org/archives/openc2/201802/msg00006.html\">proposed</a> and <a href=\"https://lists.oasis-open.org/archives/openc2/201803/msg00007.html\">approved</a> [<a href=\"https://lists.oasis-open.org/archives/openc2/201803/msg00023.html\">bis</a>] by the TC:</p>\n\n<p>The purpose of this OASIS TC Open repository is to develop and maintain a python implementation of <a href=\"http://docs.oasis-open.org/openc2/\">OpenC2</a>, and to provide a python codebase to facilitate other prototype efforts.  The python library is designed to support transformations between data-interchange formats (such as JSON) and python language objects.</p>\n\n<p>The OASIS OpenC2 Technical Committee was <a href=\"https://www.oasis-open.org/committees/openc2/charter.php\">chartered</a> to address matters as they pertain to command and control of cyber defense technologies, and to maintain a library of prototype implementations.</p>\n\n</div>\n\n<div><h2><a id=\"purposeClarifications\">Additions to Statement of Purpose</a></h2>\n\n<p>Repository Maintainers may include here any clarifications &mdash; any additional sections, subsections, and paragraphs that the Maintainer(s) wish to add as descriptive text, reflecting (sub-) project status, milestones, releases, modifications to statement of purpose, etc.  The project Maintainers will create and maintain this content on behalf of the participants.</p>\n</div>\n\n<div>\n<h2><a id=\"maintainers\">Maintainers</a></h2>\n\n<p>TC Open Repository <a href=\"https://www.oasis-open.org/resources/open-repositories/maintainers-guide\">Maintainers</a> are responsible for oversight of this project's community development activities, including evaluation of GitHub <a href=\"https://github.com/oasis-open/openc2-lycan-python/blob/master/CONTRIBUTING.md#fork-and-pull-collaboration-model\">pull requests</a> and <a href=\"https://www.oasis-open.org/policies-guidelines/open-repositories#repositoryManagement\">preserving</a> open source principles of openness and fairness. Maintainers are recognized and trusted experts who serve to implement community goals and consensus design preferences.</p>\n\n<p>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 <a href=\"https://www.oasis-open.org/resources/open-repositories/maintainers-guide#additionalMaintainers\">consensus agreements</a>.</p>\n\n<p><b><a id=\"currentMaintainers\">Current Maintainers of this TC Open Repository</a></b></p>\n\n<ul>\n<li><a href=\"mailto:mstair@att.com\">Michael Stair</a>; GitHub ID: <a href=\"https://github.com/mstair/\">https://github.com/mstair/</a>; WWW: <a href=\"https://www.att.com/\">AT&amp;T</a></li>\n<li><a href=\"mailto:zgorak@everwatchsolutions.com\">Zachary Gorak</a>; GitHub ID: <a href=\"https://github.com/twodayslate/\">https://github.com/twodayslate/</a>; WWW: <a href=\"https://everwatchsolutions.com/\">EverWatch</a></li>\n</ul>\n\n</div>\n\n<div><h2><a id=\"aboutOpenRepos\">About OASIS TC Open Repositories</a></h2>\n\n<p><ul>\n<li><a href=\"https://www.oasis-open.org/resources/open-repositories/\">TC Open Repositories: Overview and Resources</a></li>\n<li><a href=\"https://www.oasis-open.org/resources/open-repositories/faq\">Frequently Asked Questions</a></li>\n<li><a href=\"https://www.oasis-open.org/resources/open-repositories/licenses\">Open Source Licenses</a></li>\n<li><a href=\"https://www.oasis-open.org/resources/open-repositories/cla\">Contributor License Agreements (CLAs)</a></li>\n<li><a href=\"https://www.oasis-open.org/resources/open-repositories/maintainers-guide\">Maintainers' Guidelines and Agreement</a></li>\n</ul></p>\n\n</div>\n\n<div><h2><a id=\"feedback\">Feedback</a></h2>\n\n<p>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) <a href=\"#currentMaintainers\">listed above</a>.  Please send general questions about TC Open Repository participation to OASIS Staff at <a href=\"mailto:repository-admin@oasis-open.org\">repository-admin@oasis-open.org</a> and any specific CLA-related questions to <a href=\"mailto:repository-cla@oasis-open.org\">repository-cla@oasis-open.org</a>.</p>\n\n</div>\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Produce and consume OpenC2 JSON messages",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/oasis-open/openc2-lycan-python"
    },
    "split_keywords": [
        "openc2",
        "cyber"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5c22c505d398fc2740473cf8c22c20e9e3999589934cf4e7a091d8788933f914",
                "md5": "d012fd5e134820df53b3e4a83509a24e",
                "sha256": "12e0f4ee9bfa21852ae6f314cce3f2a9e6bfdd27dbc51a5167782185e904d532"
            },
            "downloads": -1,
            "filename": "sim_openc2-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d012fd5e134820df53b3e4a83509a24e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 31720,
            "upload_time": "2024-08-20T18:49:43",
            "upload_time_iso_8601": "2024-08-20T18:49:43.969255Z",
            "url": "https://files.pythonhosted.org/packages/5c/22/c505d398fc2740473cf8c22c20e9e3999589934cf4e7a091d8788933f914/sim_openc2-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a17d91ce1b13b93bc8a7b4ea020a94298210488e2ba0a8741509fdf8b6cd7a5e",
                "md5": "ff7ecb215221833a92f67bffec696459",
                "sha256": "0417bbc70024f2765d35c4e8dd96056943c6c6b671705a120e68534c4e5a22a3"
            },
            "downloads": -1,
            "filename": "sim_openc2-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ff7ecb215221833a92f67bffec696459",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 27370,
            "upload_time": "2024-08-20T18:49:47",
            "upload_time_iso_8601": "2024-08-20T18:49:47.025620Z",
            "url": "https://files.pythonhosted.org/packages/a1/7d/91ce1b13b93bc8a7b4ea020a94298210488e2ba0a8741509fdf8b6cd7a5e/sim_openc2-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-20 18:49:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "oasis-open",
    "github_project": "openc2-lycan-python",
    "travis_ci": true,
    "coveralls": true,
    "github_actions": false,
    "tox": true,
    "lcname": "sim-openc2"
}
        
Elapsed time: 0.76708s