Dyana is a sandbox environment using Docker and Tracee for loading, running and profiling a wide range of files, including machine learning models, ELF executables, Pickle serialized files, Javascripts and more. It provides detailed insights into GPU memory usage, filesystem interactions, network requests, and security related events.
- Python 3.10+ with PIP.
- Docker
- Optional: a GNU/Linux machine with CUDA for GPU memory tracing support.
Install with:
pip install dyanaTo upgrade to the latest version, run:
pip install --upgrade dyanaTo uninstall, run:
pip uninstall dyanaCreate a trace file for a given loader with:
dyana trace --loader automodel ... --output trace.jsonIt is possible to override the default events that Dyana will trace by passing a custom policy to the tracer with:
dyana trace --loader automodel ... --policy examples/network_only_policy.ymlShow a summary of the trace file with:
dyana summary --trace-path trace.jsonDyana does not allow network access by default to the loader container. If you need to allow it, you can pass the --allow-network flag:
dyana trace ... --allow-networkDyana uses a shared volume to pass your files to the loader and by default it does not allow writing to it. If you need to allow it, you can pass the --allow-volume-write flag:
dyana trace ... --allow-volume-writeDyana provides a set of loaders for different types of files, each loader has a dedicated set of arguments and will be executed in an isolated, offline by default container.
To see the available loaders and their scriptions, run dyana loaders.
The default loader for machine learning models. It will load any model that is compatible with AutoModel and AutoTokenizer.
dyana trace --loader automodel --model /path/to/model --input "This is an example sentence."
# automodel is the default loader, so this is equivalent to:
dyana trace --model /path/to/model --input "This is an example sentence."
# in case the model requires extra dependencies, you can pass them as:
dyana trace --model tohoku-nlp/bert-base-japanese --input "This is an example sentence." --extra-requirements "protobuf fugashi ipadic"This loader will load an ELF file and run it.
dyana trace --loader elf --elf /path/to/linux_executable
# depending on the ELF file and the host computer, you might need to specify a different platform:
dyana trace --loader elf --elf /path/to/linux_executable --platform linux/amd64
# networking is disabled by default, if you need to allow it, you can pass the --allow-network flag:
dyana trace --loader elf --elf /path/to/linux_executable --allow-networkThis loader will load a Pickle serialized file.
dyana trace --loader pickle --pickle /path/to/file.pickle
# networking is disabled by default, if you need to allow it, you can pass the --allow-network flag:
dyana trace --loader pickle --pickle /path/to/file.pickle --allow-networkThis loader will load a Python file and run it.
dyana trace --loader python --script /path/to/file.py
# networking is disabled by default, if you need to allow it, you can pass the --allow-network flag:
dyana trace --loader python --script /path/to/file.py --allow-networkThis loader will load a Javascript file and run it via NodeJS.
dyana trace --loader js --script /path/to/file.js
# networking is disabled by default, if you need to allow it, you can pass the --allow-network flag:
dyana trace --loader js --script /path/to/file.js --allow-networkDyana is released under the MIT license. Tracee is released under the Apache 2.0 license.





