STIX 2.1 cyber threat intelligence objects and TAXII 2.1 client
README.md
# stix STIX 2.1 cyber threat intelligence objects and a TAXII 2.1 client. When a security team detects something, it can publish it as STIX objects: an indicator pattern, the data it was seen in, a sighting. Other teams fetch those objects from a TAXII server. This library builds the STIX 2.1 domain objects for attack patterns, indicators, observed data and sightings, links them with relationships and serialises them as bundles. It also pushes and queries bundles on a TAXII 2.1 server over HTTP. An attack pattern can point at MITRE ATT&CK and SPARTA entries. STIX (Structured Threat Information Expression) is the OASIS JSON vocabulary for threat intelligence. TAXII is the matching OASIS HTTPS API, which stores STIX objects in named collections. MITRE ATT&CK is a public catalogue of attacker tactics and techniques, each with a stable identifier such as T1059. SPARTA (Space Attack Research and Tactic Analysis), from The Aerospace Corporation, catalogues attacks on spacecraft and their ground segments in the same way. ## Installation Install with opam: <!-- $MDX skip --> ```sh $ opam install stix ``` If opam cannot find the package, it may not yet be released in the public `opam-repository`. Add the overlay repository, then install it: <!-- $MDX skip --> ```sh $ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git $ opam update $ opam install stix ``` ## Usage The indicator below uses the STIX pattern `[network-traffic:dst_port = 4242]`, which matches any observed network-traffic object with destination port 4242 (STIX 2.1 section 9). The function prints the bundle as JSON and then adds it to a TAXII collection. ```ocaml let push ~now ~session ~api_root ~collection_id = let ind = Stix.indicator ~now ~name:"anomalous-cmd" ~pattern:"[network-traffic:dst_port = 4242]" ~pattern_type:"stix" ~valid_from:now () in let b = Stix.bundle [ Stix.Indicator ind ] in Fmt.pr "%s@." (Stix.string_of_bundle b); Stix.Taxii.add_objects session api_root collection_id b ``` ## API O…