All Projects → oasis-open → cti-stix-elevator

oasis-open / cti-stix-elevator

Licence: BSD-3-Clause License
OASIS Cyber Threat Intelligence (CTI) TC Open Repository: Convert STIX 1.2 XML to STIX 2.x JSON

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to cti-stix-elevator

cti-pattern-validator
OASIS TC Open Repository: Validate patterns used to express cyber observable content in STIX Indicators
Stars: ✭ 18 (-57.14%)
Mutual labels:  python-script, stix, cti, oasis, cyber-threat-intelligence, stix2
cti-stix-generator
OASIS Cyber Threat Intelligence (CTI) TC: A tool for generating STIX content for prototyping and testing. https://github.com/oasis-open/cti-stix-generator
Stars: ✭ 27 (-35.71%)
Mutual labels:  stix, cti, oasis, cyber-threat-intelligence, stix2
cti-stix2-json-schemas
OASIS TC Open Repository: Non-normative schemas and examples for STIX 2
Stars: ✭ 75 (+78.57%)
Mutual labels:  stix, cti, oasis, cyber-threat-intelligence, stix2
stix-icons
stix-icons is a collection of colourful and clean icons for use in software, training and marketing material to visualize cyber threats according to the STIX language for intelligence exchange, defined by OASIS Cyber Threat Intelligence (CTI) TC
Stars: ✭ 14 (-66.67%)
Mutual labels:  stix, cti, cyber-threat-intelligence, stix2
attack-stix-data
STIX data representing MITRE ATT&CK
Stars: ✭ 118 (+180.95%)
Mutual labels:  stix, cti, cyber-threat-intelligence
I7j Pdfhtml
pdfHTML is an iText 7 add-on for Java that allows you to easily convert HTML and CSS into standards compliant PDFs that are accessible, searchable and usable for indexing.
Stars: ✭ 104 (+147.62%)
Mutual labels:  converter, xml
Gelatin
Transform text files to XML, JSON, or YAML
Stars: ✭ 150 (+257.14%)
Mutual labels:  converter, xml
FigmaConvertXib
FigmaConvertXib is a tool for exporting design elements from figma.com and generating files to a projects iOS .xib / Android .xml
Stars: ✭ 111 (+164.29%)
Mutual labels:  converter, xml
Abused-Legitimate-Services
Cloud, CDN, and marketing services leveraged by cybercriminals and APT groups
Stars: ✭ 42 (+0%)
Mutual labels:  cti, cyber-threat-intelligence
Node Js2xmlparser
Popular Node.js module for parsing JavaScript objects into XML
Stars: ✭ 171 (+307.14%)
Mutual labels:  converter, xml
mitreattack-python
A python module for working with ATT&CK
Stars: ✭ 208 (+395.24%)
Mutual labels:  cti, cyber-threat-intelligence
Wikiforia
A Utility Library for Wikipedia dumps
Stars: ✭ 31 (-26.19%)
Mutual labels:  converter, xml
Misp
MISP (core software) - Open Source Threat Intelligence and Sharing Platform
Stars: ✭ 3,485 (+8197.62%)
Mutual labels:  stix, cti
Goxml2json
XML to JSON converter written in Go (no schema, no structs)
Stars: ✭ 170 (+304.76%)
Mutual labels:  converter, xml
mitrecnd.github.io
MITRE Shield website
Stars: ✭ 17 (-59.52%)
Mutual labels:  cti, cyber-threat-intelligence
Video-to-audio-converter
A simple tool to convert video files into mp3 audio files
Stars: ✭ 40 (-4.76%)
Mutual labels:  converter, python-script
attack-evals
ATT&CK Evaluations website (DEPRECATED)
Stars: ✭ 57 (+35.71%)
Mutual labels:  cti, cyber-threat-intelligence
json2xml
json to xml converter in python3
Stars: ✭ 76 (+80.95%)
Mutual labels:  converter, xml
xspec
XSpec is a unit test and behaviour-driven development (BDD) framework for XSLT, XQuery, and Schematron.
Stars: ✭ 91 (+116.67%)
Mutual labels:  xml
python-automated-bulk-whatsapp-messages
It is a python script to send automated bulk WhatsApp messages to multiple recipients from an excel sheet at once.
Stars: ✭ 56 (+33.33%)
Mutual labels:  python-script

Build_Status Coverage Version Documentation Status

cti-stix-elevator

NOTE: This is an OASIS TC Open Repository. See the Governance section for more information.

The stix2-elevator is a software tool for converting STIX 1.x XML to STIX 2.0 or 2.1 JSON. Due to the differences between STIX 1.x and STIX 2.x, this conversion is best-effort only. During the conversion, stix2- elevator provides information on the assumptions it needs to make to produce valid STIX 2.x JSON, and what information was not able to be converted.

To convert STIX 2.x JSON back to STIX 1.x XML use the stix2-slider

The stix2-elevator is a "best-effort" attempt to convert STIX 1.x content to STIX 2.x content. Caution should be taken if the elevator is to be used in a production environment as warnings concerning the conversion are often generated. Users should determine which warnings are acceptable and use the --disable option in conjunction with the –error-policy option only to produce results when no other warnings are emitted.

STIX 1.x Composite Indicator Expressions and CybOX 2.x Composite Observable Expressions allow a level of flexibility not present in STIX 2 patterns. These composite expressions can frequently have ambiguous interpretations, so STIX 2 Indicators created by the stix2-elevator from STIX 1.x Indicators containing composite expressions should be inspected to ensure the STIX 2 Indicator has the intended meaning.

For more information, see the documentation on ReadTheDocs.

Please enter any comments on how to improve the elevator into the issue tracker.

Requirements

  • Python 3.6+

  • python-stix and its dependencies

    Note

    Make sure to use either the latest version of python-stix 1.1.1.x or 1.2.0.x, depending on whether you want to support STIX 1.1.1 or STIX 1.2.

  • python-stix2 >= 3.0.0

  • stix2-validator >= 3.0.0 and its dependencies

  • pycountry >= 20.7.0

  • stixmarx >= 1.0.8

Installation

Install with pip

$ pip install stix2-elevator

This will install all necessary dependencies, including the latest version of python-stix.

If you need to support older STIX 1.1.1 content, install python-stix 1.1.1.x first

$ pip install 'stix<1.2'
$ pip install stix2-elevator

You can also install the stix2-elevator from GitHub to get the latest (unstable) version

$ pip install git+https://github.com/oasis-open/cti-stix-elevator.git

Installation Steps for ACS Data Marking Support

ACS data markings correspond to the common marking scheme used by the U.S. government (e.g., U, C, S, TS). To elevate STIX 1.x content that contains ACS data markings, it is necessary to install an additional python package called 'stix_edh'.

Install with pip

$ pip install stix2-elevator[acs]

Usage

It is recommended that you ensure that the input STIX 1.x file is valid before submitting it to the elevator. Use the stix-validator.

As A Script

The elevator comes with a bundled script which you can use to elevate STIX 1.x content to STIX 2.x content:

usage: stix2_elevator [-h]
          [--missing-policy {use-extensions,use-custom-properties,add-to-description,ignore}]
          [--custom-property-prefix CUSTOM_PROPERTY_PREFIX]
          [--infrastructure]
          [--acs]
          [--incidents]
          [--package-created-by-id PACKAGE_CREATED_BY_ID]
          [--default-timestamp DEFAULT_TIMESTAMP]
          [--validator-args VALIDATOR_ARGS]
          [-e ENABLED]
          [-d DISABLED]
          [-s]
          [--message-log-directory MESSAGE_LOG_DIRECTORY]
          [--log-level {DEBUG,INFO,WARN,ERROR,CRITICAL}]
          [-m MARKINGS_ALLOWED]
          [-p {no_policy,strict_policy}]
          [-v {2.0,2.1}]
          [-r]
          file

stix2-elevator v4.1.5

positional arguments:

file          The input STIX 1.x document to be elevated.

optional arguments:

-h, --help
              Show this help message and exit

--missing-policy {use-extensions,use-custom-properties,add-to-description,ignore}
              Policy for including STIX 1.x content that cannot be
              represented directly in STIX 2.x. The default is 'add-
              to-description'.

--custom-property-prefix CUSTOM_PROPERTY_PREFIX
              Prefix to use for custom property names when missing
              policy is 'use-custom-properties'. The default is
              'elevator'.

--infrastructure
              Infrastructure will be included in the conversion.
              Default for version 2.1 is true.

--incidents
              Incidents will be included in the conversion.
              Default for version 2.1 is true.

--acs
              Process ACS data markings
              Default is false.

--package-created-by-id PACKAGE_CREATED_BY_ID
              Use provided identifier for "created_by_ref"
              properties.

              Example: --package-created-by-id "identity--1234abcd-1a12-42a3-0ab4-1234abcd5678"

--default-timestamp DEFAULT_TIMESTAMP
              Use provided timestamp for properties that require a
              timestamp.

              Example: --default-timestamp "2016-11-15T13:10:35.053000Z"

--validator-args VALIDATOR_ARGS
              Arguments to pass to stix2-validator.
              See https://stix2-validator.readthedocs.io/en/latest/options.html.

              Example: --validator-args="-v --strict-types -d 212"

-e ENABLED, --enable ENABLED
              A comma-separated list of the stix2-elevator messages
              to enable. If the --disable option is not used, no
              other messages will be shown.

              Example: --enable 250

-d DISABLED, --disable DISABLED
              A comma-separated list of the stix2-elevator messages
              to disable.

              Example: --disable 212,220

-s, --silent
              If this flag is set, all stix2-elevator messages will
              be disabled.

--message-log-directory MESSAGE_LOG_DIRECTORY
              If this flag is set, all stix2-elevator messages will
              be saved to a file. The name of the file will be the
              input file with extension .log in the specified
              directory.

              Note, make sure the directory already exists.

              Example: --message-log-directory "../logs".

--log-level {DEBUG,INFO,WARN,ERROR,CRITICAL}
              The logging output level.

-m MARKINGS_ALLOWED, --markings-allowed MARKINGS_ALLOWED
              Avoid error exit, if these markings types
              (as specified via their python class names) are in the
              content, but not supported by the elevator. Specify as
              a comma-separated list.

              Example: --markings-allowed "ISAMarkingsAssertion,ISAMarkings"

-p {no_policy,strict_policy},
--error-policy {no_policy,strict_policy},
--policy {no_policy,strict_policy}   #deprecated
             The policy to deal with errors. The default is 'no_policy'.

-v {2.0,2.1}, --version {2.0,2.1}
             The version of stix 2 to be produced. The default is 2.1

-r, --ignore-required-properties
                      Do not provide missing required properties

Refer to elevator_log_messages.rst for all stix2-elevator messages. Use the associated code number to --enable or --disable a message. By default, the stix2-elevator displays all messages.

Note: disabling the message does not disable the functionality.

As A Library

You can also use this library to integrate STIX elevation into your own tools.

# Elevate a STIX 1.x via filename
# Use set_option_value to override default elevator options
# Read the documentation for options
from stix2elevator import elevate
from stix2elevator.options import initialize_options, set_option_value

initialize_options(options={"spec_version": "2.1"})

results = elevate("stix_file.xml")
print(results)

The same method can also accept a string as an argument.

# Elevate a STIX 1.x via string
# Use set_option_value to override default elevator options
# Read the documentation for options
from stix2elevator import elevate
from stix2elevator.options import initialize_options, set_option_value

initialize_options(options={"spec_version": "2.1"})

results = elevate("<stix:Package...")
print(results)

The same method can also accept a STIX 1.x package object as an argument.

# Elevate a STIX 1.x via string
from stix2elevator import elevate
from stix2elevator.options import initialize_options

initialize_options(options={"spec_version": "2.1"})

results = elevate(<STIX Package Object>)
print(results)

To set others options, use set_option_value() found in options.py, or add them as keywords to initialize_options().

Using the stepper

The stix-stepper is a simple script that will convert STIX 2.0 content to STIX 2.1 content.

You can invoke it as follows.

$ stix_stepper <2.0 file>

The 2.1 content is printed to stdout

Governance

This GitHub public repository ( https://github.com/oasis-open/cti-stix-elevator ) was proposed and approved [bis] by the OASIS Cyber Threat Intelligence (CTI) TC as an OASIS TC Open Repository 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 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. 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 the OASIS TC Open Repository Guidelines and Procedures, the open source LICENSE designated for this particular repository, and the requirement for an Individual Contributor License Agreement that governs intellectual property.

Maintainers

TC Open Repository Maintainers are responsible for oversight of this project's community development activities, including evaluation of GitHub pull requests and preserving 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.

Current Maintainers of this TC Open Repository

About OASIS TC Open Repositories

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. Please send general questions about TC Open Repository participation to OASIS Staff at [email protected] and any specific CLA-related questions to [email protected].

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].