Code Monkey home page Code Monkey logo

ctim's People

Contributors

agzam avatar brookeswanson avatar craigbro avatar ereteog avatar frenchy64 avatar gbuisson avatar halcyon avatar jyoverma avatar marioaquino avatar mcosta85 avatar mdpendergrass avatar michaels-den avatar msprunck avatar netflowninja avatar oakmac avatar polygloton avatar quoll avatar rplevy avatar rubygeek avatar saintx avatar samwagg avatar t2sw avatar turbodog99 avatar yivanise avatar yogsototh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ctim's Issues

Generate model.dot

Flanders should be able to generate model.dot, and running "lein doc" should trigger an update of the PNG file.

Implement Relationship entity

Need to allow people to make relations between objects (source, relation, destination)

Should contain:

  • Source: URI to origin object
  • Relation: a new vocabulary
  • Destination: The subject object

Improve the generated markdown

Iterate on improving the markdown that is generated by the flanders type definitions

  • Nested maps should be documented un-nested with links in the top level map
  • References should be markdown links, not just URIs
  • All maps should have a name, and most should have descriptions
  • Any URL in a description should be a markdown link
  • Add :comments to the nodes (developer notes in the documentation)
  • Truncate long schemas, like "(enum a b c ...", which can be done since the values are listed

Also do some simple refactoring

  • Standardize map definitions (syntax evolved during conversion of CTIM)
    • Use [Type] in entries instead of (seq-of Type)
    • Use map/map-of/def-map-type consistently
    • Use #{Type ...} in entries instead of (enum #{Type ...})
    • def-entity-type should allow references to be defined

Fix gen-new-indicator-with-new-sightings

It needs to use long IDs for references. There is new code in CTIA that does this, but it won't work in CTIB (because it depends on properties). Refactor and fix.

Remove Indicators reference from TTPs

CTIM TTPs currently reference a vector of Indicators:
https://github.com/threatgrid/ctim/blob/master/src/ctim/schemas/ttp.clj#L112

STIX TTPs have no such reference:
http://stixproject.github.io/data-model/1.2/ttp/TTPType/

The TG TTP data currently creates empty vectors for all of its new TTPs in threatbrain-engine:
https://github.com/threatgrid/threatbrain-engine/blob/master/src/threatbrain/engine/iocs.clj#L226

Should we remove this reference from our model?

Alphabetize relations-map by key

The ctia.schemas.common/relations-map should be alphabetized by key. It is hard to find things when manually searching the code.

Resolve "relationship" NS name conflicts

  • relationships.cljc should be references.cljc
  • observed_relationship.cljc should be for observable relationships
  • the entity ObservedRelationship should just be Relationship in relationship.cljc

Use type specific keys for specifications in indicators.

Since conditional schema are "hard" in swagger, and static types languages, I am going to suggest we use per specification keys:

:specification [{:type "threatbrain" :threatbrain_specification ....}] as opposed to:

:specification [{:type "threatbrain" :specification ...}]

Review and update graph

Update doc/graph/model.dot and generate the the associated PNG file.

Depends on #65 (which will copy it over from CTIA).

Clean up schema descriptions

When describing generated schemas (as in flanders.schema/describe), clean up the descriptions for swagger (because descriptions are markdown and it looks ugly in swagger UIs).

At a minimum...

  • Truncate at some configured length (default 50?)
  • Replace markdown links with just the text of the link

Set :version in stored-schema fn

In ctim.schemas.common/stored-schema, we add common fields that should be in all StoredEntity type schemas. The :version field, required on all stored entities, should be set in this fn.

Rename Observed_relationship entity to RelationShip

  • rename observed_relationship to Relationship
  • rename the current relationship namespace to "Reference"
  • put the ObservableRelations back into Sightings (that is observabe to observable relations with that fixed vocab

NewSighting schema is missing type key

(s/defschema NewSighting
  (st/merge
   Sighting
   c/NewBaseEntity
   (st/optional-keys
    {:count s/Int
     :confidence v/HighMedLow})))

as a result generative tests fail.

TTP/ressources/tools schema looks ambiguous

(s/defschema Resource
  "See http://stixproject.github.io/data-model/1.2/ttp/ResourceType/"
  (st/optional-keys
   {:tools (describe c/Tool "The tool leveraged by this TTP")
    :infrastructure (describe
                     Infrastructure
                     "infrastructure observed to have been utilized for cyber attack")
    :personas c/Identity}))

Here the :toolskey is described as a single item, should we rename the key to toolor change c/Toolto [c/Tool] ?

Add travis tests

We need to test CTIM on travis:

  • make a travis config file that runs the tests for both clj and cljs.

Add some unit tests

Some basic examples that test the schemas. When the test fail, that should indicate compatibility breakage and hint that a version bump will be required.

ID regex fails in some cases

Matching URL IDs with hyphens fails.

For example, in ctim.domain.id:

(re-matches long-id-re "http://localhost:3001/ctia/exploit-target/exploit-target-d51dfc7b-df40-46a4-9b06-c396e3dfdbcf")

Results in nil.

Generate documentation examples

Both JSON and CURL examples should be generated by flanders. Each type could have a default way of generating its example value (like the string types could be the 'str of the key), but it could also be overridden with an :example value on the type instance.

Generated entities need to build domain aware values

We want to return an error when references are not URLs in CTIA. Tests that use generated entities (that contain references) get random strings in the reference and ID fields. The current generators are not specific enough to create sufficiently accurate examples of our domain objects.

In other words, don't just take a schema and generate samples.

Related to threatgrid/ctia#212

Generate full entity fixtures

related to #378

Currently our entity fixture generators only output the simplest scenario to match a schema, thus we can't simulate any of the optional keys.

Make it so that our entity schema generators output entities with most of their optional keys

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.