Flatten command field types for the jsonpacker#130
Flatten command field types for the jsonpacker#130JSCU-CNI wants to merge 9 commits intofox-it:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #130 +/- ##
==========================================
+ Coverage 82.25% 83.00% +0.75%
==========================================
Files 34 34
Lines 3652 3602 -50
==========================================
- Hits 3004 2990 -14
+ Misses 648 612 -36
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks for your contribution, we will look at the changes later. But for now, could you maybe create an issue and attach it to this PR? It would make keeping track of issues a lot easier for us. |
|
Do you have an update for us regarding this pull request @Miauwkeru? |
|
Hi @JSCU-CNI , |
|
FYI we have been running this patch in production for a year now without problems. |
| def record_to_document(self, record: Record, index: str) -> dict: | ||
| """Convert a record to a Elasticsearch compatible document dictionary""" | ||
| rdict = record._asdict() | ||
| rdict = self.json_packer.pack_obj(record) |
There was a problem hiding this comment.
If possible, could the reviewer give a comment on this change? We are unsure what the implications of this are exactly.
|
Superseded by #183. |
This PR flattens the field type
commandin the JSON packer and fixes #132.Currently the
dissect.targetproject is inconsistent in using the same field namecommandand the new field typecommand. This patch makes it possible to upload and aggregate on different records in Elasticsearch with the field namecommandand differing field types.For example, see
RunKeysPlugin.runkeysandPowerShellHistoryPlugin.powershell_history.You could argue (and we agree) that this should be fixed in
dissect.targetas allRecordDescriptors currently using("string", "command")should perhaps use the newcommandrecord type. That makes sense to do in the long run. Perhaps a field calledfullcould be added to the standard output of thecommandfieldtype dict to still be able to index the full, original, command.Historically the
commandfield type introduced a backwards incompatible change into dissect. This PR fixes that inconsistency.