A sandbox environment based on Docker and eBPF to load and profile a wide range of file types.
Project description
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dyana-0.1.1.tar.gz.
File metadata
- Download URL: dyana-0.1.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b408f4715c8b88ee4d3313e3b1f247bca64cfb3abce8e59b6cb5b6531af7dc7
|
|
| MD5 |
0a186e3661de3618bb66180d52698014
|
|
| BLAKE2b-256 |
596fe0532136abee1bf2c67d345683a4c8536df5f7b471dbf607eaee2138262b
|
Provenance
The following attestation bundles were made for dyana-0.1.1.tar.gz:
Publisher:
publish.yml on dreadnode/dyana
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dyana-0.1.1.tar.gz -
Subject digest:
8b408f4715c8b88ee4d3313e3b1f247bca64cfb3abce8e59b6cb5b6531af7dc7 - Sigstore transparency entry: 163174766
- Sigstore integration time:
-
Permalink:
dreadnode/dyana@96c4d14ff393e4440b7f951333d78ba5a56744d7 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/dreadnode
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@96c4d14ff393e4440b7f951333d78ba5a56744d7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dyana-0.1.1-py3-none-any.whl.
File metadata
- Download URL: dyana-0.1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ed872652a8b9be6860b3e9753e2e1f56753d489e80e440a96fd007a09532edb
|
|
| MD5 |
2a764180591ea218164e05098e944981
|
|
| BLAKE2b-256 |
c538a2d9ec700a2558ac07c26a22329e8aa5d0752eecb451797f190711af6ca5
|
Provenance
The following attestation bundles were made for dyana-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on dreadnode/dyana
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dyana-0.1.1-py3-none-any.whl -
Subject digest:
1ed872652a8b9be6860b3e9753e2e1f56753d489e80e440a96fd007a09532edb - Sigstore transparency entry: 163174767
- Sigstore integration time:
-
Permalink:
dreadnode/dyana@96c4d14ff393e4440b7f951333d78ba5a56744d7 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/dreadnode
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@96c4d14ff393e4440b7f951333d78ba5a56744d7 -
Trigger Event:
push
-
Statement type: