guardicore / monkey

Infection Monkey - An open-source adversary emulation platform
https://www.guardicore.com/infectionmonkey/
GNU General Public License v3.0
6.68k stars 787 forks source link

Implement `MongoAgentPluginRepository` #3416

Closed mssalvatore closed 1 year ago

mssalvatore commented 1 year ago

Description

The FileAgentPluginRepository has outlived its usefulness. It is not capable of supporting repeated querying of certain plugin components in a performant way. This component should be replaced with a new MongoAgentPluginRepository. Note that most (all?) of the unit tests for FileAgentPluginRepository may be easily repurposed to test the new repository, since both repositories will share the same interface.

The new repository should store AgentPlugin objects as documents in MongoDB.

Note

Unlike the current repository which will load the plugins from files and parse linux/windows-specific plugins from the plugin package, this repository will not need to do any parsing at retrieval time. Rather, this parsing should be done when the plugins are stored.

Tasks

mssalvatore commented 1 year ago

See https://pymongo.readthedocs.io/en/stable/examples/gridfs.html

cakekoa commented 1 year ago

Some initial research on storing binary data in MongoDB:

Storing binary data in Mongo: