Skip to content

FloatingGhost/stixex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StixEx

An implementation of CTI's STIX data format, as defined by http://docs.oasis-open.org/cti/stix/v2.0/

Build Status

This video response directed at everyone who "designed" this spec: https://www.youtube.com/watch?v=Yje5oIQr92w

Why are we still here? Just to suffer?

Every night, I feel my coherent data formats, and my naming conventions... even my json,

The sanity I've lost, the trust in committees I've lost,

It won't stop hurting...

It's like they're all still there

You feel it too, don't you?

I'm gonna make them give back our formats

Installation

The package can be installed by adding stixex to your list of dependencies in mix.exs:

def deps do
  [
    {:stixex, "~> 0.1.3"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/stixex.

Example Usage

iex> {:ok, threat_actor} = StixEx.Object.ThreatActor.new(%{
    name: "OASIS",
    primary_motivation: "dominance"
})

iex> {:ok, campaign} = StixEx.Object.Campaign.new(%{
    name: "STIX"
})

iex> {:ok, relationship} = StixEx.Object.Relationship.new(%{
    source_ref: campaign.id,
    relationship_type: "attributed-to",
    target_ref: threat_actor.id
})

iex> {:ok, my_bundle} = StixEx.Bundle.new(%{objects: [threat_actor, campaign, relationship]})
iex> StixEx.Bundle.to_string(my_bundle, )
{:ok, "{\"id\":\"bundle--...\"}"}