skillfed

stix2-validator

APIs and scripts for validating STIX 2.x documents.

stix2-validator v3.3.1 148.4K downloads/30d#11,034 on PyPI63
Permissive license Active released

What it is and what it does

The STIX Validator is a tool for checking that STIX JSON content conforms to the STIX 2.1 specification. It validates documents against both mandatory "MUST" requirements—using JSON schemas and Python functions for checks that cannot be expressed in schema alone—and recommended "SHOULD" best-practice requirements. The validator distinguishes between these two requirement types, allowing users to ignore best-practice checks if needed. It also color-codes output to make validation results easier to interpret at a glance.

The package works as both a command-line script (stix2_validator) and a library that can be integrated into other tools. Users can validate JSON files, JSON strings, or Python dictionaries representing STIX objects. It is maintained as an OASIS TC Open Repository under BSD-3-Clause licensing, with active governance and community participation.

Use it for:

  • Validate STIX threat intelligence documents before ingestion into security platforms or databases.
  • Integrate STIX validation into CI/CD pipelines to enforce specification compliance in automated threat data workflows.
  • Check STIX JSON files for both mandatory conformance and best-practice adherence during threat intelligence authoring.
  • Build custom security tools that need to verify STIX object structure and content before processing.
  • Audit existing STIX document collections for specification violations and best-practice gaps.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Validates STIX 2.x JSON documents against the STIX 2.1 specification, checking both mandatory requirements via JSON schemas and recommended best practices via Python functions.

Yes. The package is actively maintained, has low install friction, carries a permissive license, and fills a clear need for STIX 2.x validation in threat intelligence workflows. No known vulnerabilities and broad Python version support (3.10–3.14) make it a safe, reliable choice for projects requiring STIX conformance checking.

Install

stix2-validator on PyPI

pip

pip install stix2-validator

uv

uv add stix2-validator

poetry

poetry add stix2-validator

Installing stix2-validator

Before you install

Low friction install with 7 common runtime dependencies and a pure-Python wheel distribution. Actively maintained with a recent release 94 days ago and ongoing repository activity.

License in practice

BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; suitable for most projects.

Quickstart

pip install stix2-validator

from stix2validator import validate_file, print_results
results = validate_file("stix_file.json")
print_results(results)

Requires Python 3.10 or later.

Verify before relying

  • Whether the validator supports custom STIX objects when the type-checking option is disabled.
  • Performance characteristics when validating large STIX document collections.
  • Whether all STIX 2.1 specification updates are covered in the current release.

Package facts

License not declared (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 7 — colorama, cpe, jsonschema, python-dateutil, requests, simplejson, stix2-patterns
Maintenance actively maintained — 94 days since the last release
Last repo commit
First released
Downloads 148,440/month — #11,034 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: stix2_validator-3.3.1-py2.py3-none-any.whl

Keywords: stix, stix2, json, validation, validator, stix-validator, stix2-validator

Development Status :: 4 - BetaLicense :: OSI Approved :: BSD LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Security

Tags

stix validationstix 2.x validatorjson schema validationcyber threat intelligencestix document checkercompliance validationstix conformance
stixthreat-intelligencejson-validation

More Security packages