Skip to content

Conversation

@frenchy64
Copy link
Contributor

@frenchy64 frenchy64 commented Dec 24, 2024

Includes support for OCSF schemas.

OCSF exposes a simple format for schemas at e.g., https://schema.ocsf.io/api/classes/account_change

flanders.ocsf converts this format to flanders.

A separate project includes all the OCSF schemas, which we depend on via its jar during dev: https://github.com/frenchy64/ocsf-schema-export

We don't need the mainline OCSF schemas for now, we will vendor the Cisco variants during deployments.

The README in this PR describes how to use all this to create Plumatic Schema or Malli from OCSF schemas.

The unit tests boots a local ocsf-server and fuzz tests Plumatic Schema and Malli conversions against samples from https://schema.ocsf.io/doc/index.html#/Sample%20Data

@frenchy64 frenchy64 changed the title Ocsf schema2 OCSF Schema Support Dec 24, 2024
@frenchy64 frenchy64 marked this pull request as ready for review December 24, 2024 06:53
@frenchy64 frenchy64 self-assigned this Dec 24, 2024
org.clojure/core.match {:mvn/version "1.0.0"}
prismatic/schema {:mvn/version "1.4.1"}}
:aliases {:test {:extra-paths ["test"]
prismatic/schema {:mvn/version "1.2.0"}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the downgrade on the schema version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC the project.clj and deps.edn were out of sync. Since we use the jar, I figured the project.clj wins.

@marioaquino
Copy link

This is brilliant!! Exactly what I needed!

@marioaquino
Copy link

I was testing out the work on this PR and I get a strange error that I'm scratching my head on. I created a gist describing my findings...

@frenchy64
Copy link
Contributor Author

@marioaquino thanks. Looks like the Cisco schema uses a vector of singleton maps for "attributes" (rather than just a map). I will add support for that.

@frenchy64
Copy link
Contributor Author

Done. I didn't realize Cisco OCSF schemas were different. Might make sense to export them to https://github.com/frenchy64/ocsf-schema-export.

Copy link

@marioaquino marioaquino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic and does exactly what I need! Great work, Ambrose!

@gbuisson
Copy link

Fantastic Ambrose! Let's get this merged and released.

@frenchy64 frenchy64 merged commit bc598b3 into master Jan 23, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants