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

Documentation


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

It 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.yml

Show a summary of the trace file with:

dyana summary --trace-path trace.json

Default Safeguards

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

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

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.

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"

elf

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

pickle

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

python

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

pip

This loader will install a Python package via PIP.

dyana trace --loader pip --package requests

# you can install a specific version of a package:
dyana trace --loader pip --package requests==2.28.2

# you can also pass extra dependencies to be installed:
dyana trace --loader pip --package foobar --extra-dependencies "gcc"

js

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

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.1.0.tar.gz (21.8 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.1.0-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dyana-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3b3d56a2f99b6bcd8295c9fb2d54057c1112815c1f479c71d2ab3a60d4fba928
MD5 c736f4014ece5490c6296d3509943cb6
BLAKE2b-256 d2bdde538ec7565bfa1997d73baed8ecb3776c1fe37c5600c5ce19d4a175f7a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for dyana-0.1.0.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: dyana-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 29.5 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ab5ed3b107742fa361649577bb83ccab989d25339b5e25d6d5024a34772c848d
MD5 419736851121e523aa3068010b8be345
BLAKE2b-256 96a3cbadc94bc0ea10909741fa56c15b1f8cd21fd3fe68a90adfd48a82a5eb56

See more details on using hashes here.

Provenance

The following attestation bundles were made for dyana-0.1.0-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