Standardize "data" field to be an object throughout bbot output #736
Replies: 4 comments 7 replies
-
I agree it can be slightly annoying to have to deal with both strings and dictionaries in the event data. We do already have several internal attributes that are designed to address this, such as As of right now, I don't think we're including them in the JSON output. But we certainly could. I'm open to ideas on how to make it easier to ingest.
I like where you're going with this. Maybe we could have a |
Beta Was this translation helpful? Give feedback.
-
@kerrymilan @SudoSuBrew @SpamFaux @aconite33 I'd be curious to know any preferences/best-practices you might have for making JSON output easily ingestible by splunk, elastic, etc. Right now BBOT's JSON output is full of newline-delimited events like this: {
"type": "DNS_NAME",
"data": "blacklanternsecurity.com",
...
} The issue is that the {
"type": "HTTP_RESPONSE",
"data": {
"url": "http://blacklanternsecurity.com:80",
"timestamp": "2023-09-17T07:11:31.229619186-04:00",
"port": "80",
"path": "/",
},
} So we're looking for the best way to make this ideal for SEIM ingestion while also keeping it as human-readable as possible. |
Beta Was this translation helpful? Give feedback.
-
This has been added in #1049.
|
Beta Was this translation helpful? Give feedback.
-
Will this output be supported for the http output module that does JSON as well? |
Beta Was this translation helpful? Give feedback.
-
It seems that today when you run bbot with the output.json (soon to be output.ndjson? :) ) enabled, there is a discrepancy in the data output where some new line delimited json lines contain the data field with just a string but in some cases (such as findings and asn), it will be populated as an object.
This can be an issue when ingesting into some SIEMs. I recommend (and will try to fix) this behavior by starting with this line of code:
bbot/bbot/modules/hunt.py
Line 291 in 97b2c31
I would look at transforming this into:
So that the data will be changed from:
"data" : "evilcorp.com"
To
"data" : "url" : {"evilcorp.com"}
Thus making the data field an object throughout the output.
This is just an example as I don't know if this will fix it.
Another way to do this is making findings and other relevant features that ate making data an object is giving them their own field name outside of data not to conflict with the object vs non-object json mapping inconsistencies.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions