Skip to main content

A sandbox environment based on Docker and eBPF to load and profile a wide range of file types.

Project description

Logo

PyPI - Python Version PyPI - Version GitHub License GitHub Actions Workflow Status


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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dyana-0.0.2.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dyana-0.0.2-py3-none-any.whl (25.0 kB view details)

Uploaded Python 3

File details

Details for the file dyana-0.0.2.tar.gz.

File metadata

  • Download URL: dyana-0.0.2.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for dyana-0.0.2.tar.gz
Algorithm Hash digest
SHA256 2e75a10e04f4f6cb9a2cda5245a10f4c1cbbd31d481d671888dcc538a9513d2b
MD5 d69f89ca14180e3dc4961ea395f9306f
BLAKE2b-256 ba0d6cc386e134ee0f048b88d06d0021ea3ff5488c74c2e8884c61dc32814792

See more details on using hashes here.

Provenance

The following attestation bundles were made for dyana-0.0.2.tar.gz:

Publisher: publish.yml on dreadnode/dyana

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file dyana-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: dyana-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 25.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for dyana-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 531cc337924c7f3a3082a7521a7b26502daaf52650318b80f646577267878f01
MD5 aa43b9539c5e2ae37116256f8d07c2fb
BLAKE2b-256 bf64c9729467a66052e60f1337ecab797a3d17a321a6c5e1e2fe7e417bde76b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for dyana-0.0.2-py3-none-any.whl:

Publisher: publish.yml on dreadnode/dyana

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page