{"id":19950899,"url":"https://github.com/oasis-open/cti-stix-generator","last_synced_at":"2025-05-03T18:33:24.842Z","repository":{"id":37947203,"uuid":"317631573","full_name":"oasis-open/cti-stix-generator","owner":"oasis-open","description":"OASIS Cyber Threat Intelligence (CTI) TC: A tool for generating STIX content for prototyping and testing. https://github.com/oasis-open/cti-stix-generator","archived":false,"fork":false,"pushed_at":"2024-04-07T15:58:39.000Z","size":254,"stargazers_count":35,"open_issues_count":8,"forks_count":16,"subscribers_count":11,"default_branch":"main","last_synced_at":"2024-04-07T16:45:20.089Z","etag":null,"topics":["cti","cyber-threat-intelligence","generation","generator","json","jupyter","oasis","python","stix","stix2","stix2-generator"],"latest_commit_sha":null,"homepage":"https://stix2-generator.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oasis-open.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-12-01T18:26:32.000Z","updated_at":"2023-12-08T02:17:37.000Z","dependencies_parsed_at":"2023-02-14T01:15:16.763Z","dependency_job_id":"3d758788-eec3-4493-9cd8-2dc3ccab9e34","html_url":"https://github.com/oasis-open/cti-stix-generator","commit_stats":{"total_commits":98,"total_committers":12,"mean_commits":8.166666666666666,"dds":0.7346938775510203,"last_synced_commit":"d94e2e661009c5e56dda2838394894b11060308a"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasis-open%2Fcti-stix-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasis-open%2Fcti-stix-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasis-open%2Fcti-stix-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oasis-open%2Fcti-stix-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oasis-open","download_url":"https://codeload.github.com/oasis-open/cti-stix-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224370100,"owners_count":17299969,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cti","cyber-threat-intelligence","generation","generator","json","jupyter","oasis","python","stix","stix2","stix2-generator"],"created_at":"2024-11-13T01:05:58.200Z","updated_at":"2024-11-13T01:05:58.843Z","avatar_url":"https://github.com/oasis-open.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"|Build_Status| |Coverage| |Version| |Binder| |Scorecard|\n\ncti-stix-generator\n==================\n\nThis is an `OASIS TC Open Repository\n\u003chttps://www.oasis-open.org/resources/open-repositories/\u003e`__. See the\n`Governance \u003c#governance\u003e`__ section for more information.\n\nThe STIX generator is a tool for generating random STIX content for prototyping\nand testing. It uses a simple, sentence-like syntax for expressing what STIX\ncontent to generate. This tool is provided in three forms: as a Jupyter notebook,\nas a commandline tool, and a Python library.\n\nFor more information, see `the documentation \u003chttps://stix2-generator.readthedocs.io/\u003e`__ on ReadTheDocs.\n\nJupyter Notebook\n----------------\n\nThe `Jupyter notebook \u003chttps://jupyter.org/\u003e`__ provides an interactive\nenvironment to input generator syntax and view the generated content. Go here to\n`launch the environment \u003chttps://mybinder.org/v2/gh/oasis-open/cti-stix-generator/HEAD\u003e`__.\n\nOpen ``stix.ipynb`` in Jupyter to use the tool. Look at ``examples.ipynb`` for\ndocumentation and examples of the syntax.\n\nTo use the notebook locally, install the generator's dependencies including the ``jupyter`` extras, and run Jupyter:\n\n.. code-block:: bash\n\n    pip install -e .[jupyter]\n    jupyter nbextension install stix2viz --py\n    jupyter nbextension enable stix2viz --py\n    jupyter notebook\n\n.. note::\n\n   If you are using the JupyterLab interface, the STIX generator notebook extension can only be used in classic mode.\n\nUsage\n----------------\nCommandline Tool\n~~~~~~~~~~~~~~~~\n\nThe build_stix commandline tool reads prototyping language from a file, and\nprints the generated objects to stdout.  If a bundle is selected, the bundle is\nprinted instead.\n\n::\n\n    usage: build_stix.py [-h] [-b] [-e ENCODING] [-v]\n                     [--stix-version {2.0,2.1}]\n                     [--extra-specs EXTRA_SPECS] [-n] [-c CONFIG]\n                     language-file\n\n    Create STIX content from the STIX prototyping language\n\n    positional arguments:\n      language-file         The file containing STIX prototyping language\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      -b, --bundle          Create a bundle\n      -e ENCODING, --encoding ENCODING\n                            Encoding to use when reading text files, e.g. STIX\n                            prototyping language, custom generator\n                            specifications, etc. Default=utf-8\n      -v, --verbose         Enable verbose diagnostic output. Repeat for\n                            increased verbosity.\n      --stix-version {2.0,2.1}\n                            STIX version to use. Default=2.1\n      --extra-specs EXTRA_SPECS\n                            A JSON file with extra object generator\n                            specifications. These will be merged with the\n                            built-in specifications, and made available for\n                            use in prototyping language content.\n      -n, --embed-variable-names\n                            Embed variable names in generated objects using a\n                            custom property.\n      -c CONFIG, --config CONFIG\n                            Config file with options to customize how content\n                            is generated.\n\nThe generate_stix tool is used for more general object generation, which does\nnot require a language file to be specified:\n\n::\n\n    usage: generate_stix.py [-h] [--min-rels MIN_RELS] [--max-rels MAX_RELS]\n                        [--p-reuse P_REUSE] [--p-sighting P_SIGHTING]\n                        [--dangling-refs] [--ref-max-depth REF_MAX_DEPTH] [-v]\n                        [--stix-version {2.0,2.1}] [-b]\n\n    Generation random STIX content\n\n    optional arguments:\n      -h, --help            show this help message and exit\n      --min-rels MIN_RELS   Minimum number of SROs to create. Default=1\n      --max-rels MAX_RELS   Maximum number or SROs to create. Default=5\n      --p-reuse P_REUSE     Probability of object reuse, when creating new\n                        connections among objects. Must be a real number in\n                        [0, 1]. Lower values result in a graph with more nodes\n                        and less interconnection. Higher values result in a\n                        graph with fewer nodes and more interconnection.\n                        Default=0.5\n  --p-sighting P_SIGHTING\n                        Probability that when an SRO is added, it is a\n                        sighting. Must be a real number in [0, 1]. Default=0.1\n  --dangling-refs       Leave reference properties \"dangling\". Don't force\n                        them to refer to existing objects. Applies to all\n                        reference properties *except* the endpoints of SROs.\n  --ref-max-depth REF_MAX_DEPTH\n                        If creating a new object to avoid a dangling reference,\n                        the new object could itself have reference properties;\n                        new objects created to satisfy those could themselves\n                        have reference properties, etc. This setting limits how\n                        far we grow this \"reference graph\". Enforcement of this\n                        limit is best-effort; reference properties required by\n                        the specification may cause further growth. Only\n                        applicable if --dangling-refs is not given. Must be a\n                        non-negative integer. Default=0\n  -v, --verbose         Enable verbose diagnostic output. Repeat for increased\n                        verbosity.\n  --stix-version {2.0,2.1}\n                        STIX version to use. Default=2.1\n  -b, --bundle          Create a bundle\n\nPython Library\n~~~~~~~~~~~~~~\n\nYou can also generate STIX objects programmatically in a Python script. This can\nbe useful when the generated objects are used in Python code.\n\nThe fastest and easiest way to create random STIX objects is with the\ncreate_stix_generator object:\n\n.. code-block:: python\n\n    import stix2generator\n\n    generator = stix2generator.create_stix_generator()\n    generated = generator.generate()\n\nThis creates a dictionary of objects related to each other, easy to submit to a\ntaxii server or sent through the stix validator.\n\nYou can create single objects of a specified type using create_object_generator:\n\n.. code-block:: python\n\n    object_generator = stix2generator.create_object_generator()\n    object = object_generator.generate(\"indicator\")\n\nA given configuration object can produce more specific results, if necessary:\n\n.. code-block:: python\n\n    config = stix2generator.generation.object_generator.Config(optional_property_probability=.25, minimize_ref_properties=False)\n    object_generator = stix2generator.create_object_generator(object_generator_config=config)\n    object = object_generator.generate(\"indicator\")\n\nYou can also use the language_processor object in a similar fashion as the\nbuild_stix command-line tool. This will produce a list objects based around the\ntext you give to the build_graph function. In the case below, a malware and an\nidentity object are created with a relationship object linking them together:\n\n.. code-block:: python\n\n    language_processor = stix2generator.create_default_language_processor()\n    objects = language_processor.build_graph(\"Malware targets Identity.\")\n\nCaveats\n-------\n\nThe tool generates random data for all properties, so it may be nonsensical but\nwill have the correct datatype or structure according to the STIX\nspecification.\n\nThe object generator currently only generates STIX 2.1 objects. The commandline\ntool and some APIs will error out if any STIX version other than \"2.1\" is used.\n\nGovernance\n----------\n\nThis GitHub public repository `cti-stix-generator \u003chttps://github.com/oasis-open/cti-stix-generator/\u003e`__ was created at the request of the `OASIS Cyber Threat Intelligence (CTI) TC \u003chttps://www.oasis-open.org/committees/cti/\u003e`__ as an `OASIS TC Open Repository \u003chttps://www.oasis-open.org/resources/open-repositories/\u003e`__ to support development of open source resources related to Technical Committee work.\n\nWhile 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 \u003chttps://github.com/oasis-open/cti-stix-generator/blob/master/CONTRIBUTING.md#governance-distinct-from-oasis-tc-process\u003e`__ from the OASIS TC Process and related policies.\n\nAll contributions made to this TC Open Repository are subject to open source license terms expressed in the `BSD-3-Clause License \u003chttps://www-legacy.oasis-open.org/sites/www.oasis-open.org/files/BSD-3-Clause.txt\u003e`__. That license was selected as the declared `applicable license \u003chttps://www.oasis-open.org/resources/open-repositories/licenses\u003e`__ when the TC Open Repository was created.\n\nAs documented in `Public Participation Invited \u003chttps://github.com/oasis-open/cti-stix-generator/blob/master/CONTRIBUTING.md#public-participation-invited\u003e`__, 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 \u003chttps://www.oasis-open.org/policies-guidelines/open-repositories\u003e`__, the open source `LICENSE \u003chttps://github.com/oasis-open/cti-stix-generator/blob/master/LICENSE.md\u003e`__ designated for this particular repository, and the requirement for an `Individual Contributor License Agreement \u003chttps://www.oasis-open.org/resources/open-repositories/cla/individual-cla\u003e`__ that governs intellectual property.\n\nMaintainers\n~~~~~~~~~~~\n\nTC Open Repository `Maintainers \u003chttps://www.oasis-open.org/resources/open-repositories/maintainers-guide\u003e`__ are responsible for oversight of this project's community development activities, including evaluation of GitHub `pull requests \u003chttps://github.com/oasis-open/cti-stix-generator/blob/master/CONTRIBUTING.md#fork-and-pull-collaboration-model\u003e`__ and `preserving \u003chttps://www.oasis-open.org/policies-guidelines/open-repositories#repositoryManagement\u003e`__ open source principles of openness and fairness. Maintainers are recognized and trusted experts who serve to implement community goals and consensus design preferences.\n\nInitially, the TC members have designated one or more persons to serve as Maintainer(s); subsequently, participating community members may select additional or substitute Maintainers, by `consensus agreements \u003chttps://www.oasis-open.org/resources/open-repositories/maintainers-guide#additionalMaintainers\u003e`__.\n\n.. _currentmaintainers:\n\nCurrent Maintainers of this TC Open Repository\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n-  `Emily Ratliff \u003cmailto:Emily.Ratliff@ibm.com\u003e`__; GitHub ID: https://github.com/ejratl; WWW: `IBM \u003chttp://www.ibm.com/\u003e`__\n\n-  `Rich Piazza \u003cmailto:rpiazza@mitre.org\u003e`__; GitHub ID: https://github.com/rpiazza; WWW: `MITRE \u003chttp://www.mitre.org/\u003e`__\n\nAbout OASIS TC Open Repositories\n--------------------------------\n\n-  `TC Open Repositories: Overview and Resources \u003chttps://www.oasis-open.org/resources/open-repositories/\u003e`__\n-  `Frequently Asked Questions \u003chttps://www.oasis-open.org/resources/open-repositories/faq\u003e`__\n-  `Open Source Licenses \u003chttps://www.oasis-open.org/resources/open-repositories/licenses\u003e`__\n-  `Contributor License Agreements (CLAs) \u003chttps://www.oasis-open.org/resources/open-repositories/cla\u003e`__\n-  `Maintainers' Guidelines and Agreement \u003chttps://www.oasis-open.org/resources/open-repositories/maintainers-guide\u003e`__\n\nFeedback\n--------\n\nQuestions 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 \u003c#currentmaintainers\u003e`__.\n\nPlease send general questions about TC Open Repository participation to OASIS Staff at repository-admin@oasis-open.org and any specific CLA-related questions to repository-cla@oasis-open.org.\n\n.. |Build_Status| image:: https://github.com/oasis-open/cti-stix-generator/workflows/cti-stix-generator%20test%20harness/badge.svg\n   :target: https://github.com/oasis-open/cti-stix-generator/actions?query=workflow%3A%22cti-stix-generator+test+harness%22\n.. |Coverage| image:: https://codecov.io/gh/oasis-open/cti-stix-generator/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/oasis-open/cti-stix-generator\n.. |Version| image:: https://img.shields.io/pypi/v/stix2-generator.svg?maxAge=3600\n   :target: https://pypi.org/project/stix2-generator/\n.. |Binder| image:: https://mybinder.org/badge_logo.svg\n   :target: https://mybinder.org/v2/gh/oasis-open/cti-stix-generator/HEAD\n.. |Scorecard| image:: https://api.securityscorecards.dev/projects/github.com/oasis-open/cti-stix-generator/badge\n     :target: https://api.securityscorecards.dev/projects/github.com/oasis-open/cti-stix-generator\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foasis-open%2Fcti-stix-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foasis-open%2Fcti-stix-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foasis-open%2Fcti-stix-generator/lists"}