Skip to main content
File enrichment modules for the main enrichment workflow are located in libs/file_enrichment_modules/file_enrichment_modules/. To add a new module, create a new folder matching Python’s PEP8 naming conventions:
Modules should have short, all-lowercase names. Underscores can be used in the module name if it improves readability. Python packages should also have short, all-lowercase names, although the use of underscores is discouraged.
Create a main analyzer.py file with your enrichment logic. The easiest method for this (and enrichment modules are fairly small) is to find an example module, and use it as a base with a LLM to help draft your code. If your module needs additional dependencies, you have two options. Before either, first install Poetry. For the first option, you can cd to projects/file_enrichment or libs/file_enrichment_modules/ and run poetry add X for the needed library. Alternatively (and easier) you can create a pyproject.yaml in the new module module folder. An example is:
Then in this folder, run poetry add X to add a new library. The dynamic module loader will install the necessary dependencies in a Poetry env for just that module.

Tips / Tricks

The should_process() function determines if the module should run on a file. You can either check the name or any other component of the base enriched file with file_enriched = get_file_enriched(object_id):
Or you can use a Yara rule (or you could do both!):

On Transforms

File transforms require a type (used as a title for display) and an object_id to reference the data to display. Optional metadata is: Display Types are:

Examples

Example of setting a text file as the default display (in file_enrichment_modules/sqlite/analyzer.py):
Example of offering a file for download (in file_enrichment_modules/dotnet/analyzer.py):