Skip to content

A sandbox environment designed for loading, running and profiling a wide range of files, including machine learning models, ELFs, Pickle, Javascript and more

License

Notifications You must be signed in to change notification settings

dreadnode/dyana

Repository files navigation

Logo


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.

Requirements

  • Python 3.10+ with PIP.
  • Docker
  • Optional: a GNU/Linux machine with CUDA for GPU memory tracing support.

Installation

Install with:

pip install dyana

To upgrade to the latest version, run:

pip install --upgrade dyana

To uninstall, run:

pip uninstall dyana

Usage

Create a trace file for a given loader with:

dyana trace --loader automodel ... --output trace.json

By default, Dyana will not allow network access to the model container. If you need to allow it, you can pass the --allow-network flag:

dyana trace ... --allow-network

Show a summary of the trace file with:

dyana summary --trace-path trace.json

Loaders

Dyana 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.

automodel

The default loader for machine learning models. It will load any model that is compatible with AutoModel and AutoTokenizer.

Example Usage

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"

automodel

elf

This loader will load an ELF file and run it.

Example Usage

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-network

elf

pickle

This loader will load a Pickle serialized file.

Example Usage

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-network

pickle

python

This loader will load a Python file and run it.

Example Usage

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-network

python

js

This loader will load a Javascript file and run it via NodeJS.

Example Usage

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-network

js

License

Dyana is released under the MIT license. Tracee is released under the Apache 2.0 license.

About

A sandbox environment designed for loading, running and profiling a wide range of files, including machine learning models, ELFs, Pickle, Javascript and more

Resources

License

Stars

Watchers

Forks

Packages

No packages published