A framework for building and managing invoker scripts across different nodes in Sierra.
Project description
SierraโSDK
๐ Overview
SierraโSDK is a Python framework for building and managing invoker scripts that can be used across different nodes in Sierra during any investigation.
Project Goals
- Provide a robust and flexible framework for managing invoker scripts
- Offer a simple and intuitive API for building and compiling Sierra applications
- Support extensibility through plugins and custom configurations
Key Features
- Modular Design: SierraโSDK is built with a modular architecture, allowing for easy extension and customization
- Invoker Script Management: Easily build, compile, and load invoker scripts across different nodes in Sierra
- Plugin Support: Extend the functionality of SierraโSDK through custom plugins
โ๏ธ Installation
pip Installation
You can install SierraโSDK using pip:
pip install sierra-dev
Installation from Source
To install SierraโSDK from source, clone the repository and run the following command:
git clone https://github.com/xsyncio/sierra-dev.git
cd sierra-dev
pip install .
๐ง Usage Examples
Building an Invoker Script
import sierra
# โโโ Define the Invoker โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
invoker = sierra.InvokerScript(
name="greet",
description="Prints a personalized greeting message."
)
invoker.requirement(["requests"])
# โโโ Dependency functions โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
@invoker.dependancy
def random_function_one(param: int) -> int:
return param * 2
@invoker.dependancy
def random_function_two(message: str) -> str:
return message.upper()
@invoker.dependancy
def random_function_three(value: float) -> float:
return value / 3.14
@invoker.dependancy
def random_function_four(flag: bool) -> bool:
return not flag
# โโโ Entry point โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
@invoker.entry_point
def run(
name: sierra.Param[
str | None,
sierra.SierraOption(
description="The name of the person to greet.",
mandatory="MANDATORY"
)
],
polite: sierra.Param[
bool | None,
sierra.SierraOption(
description="Whether to include a polite phrase in the greeting.",
mandatory=None
)
] = False,
) -> None:
"""
Greet the specified user by name, optionally politely.
Parameters
----------
name : str
Name of the user (mandatory).
polite : bool, optional
If True, includes a polite prefix.
"""
if name is None:
# Missing mandatory parameter
result = sierra.create_error_result("Missing mandatory parameter: name")
else:
# Build greeting
greeting = f"Hello, {name}!"
if polite:
greeting = f"Good day to you, {name}!"
# Wrap the greeting in a TreeResult
result = sierra.create_tree_result([greeting])
# Print the structured result
print(result)
# โโโ Loader โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
def load(client: sierra.SierraDevelopmentClient) -> None:
"""
Register this invoker with the given Sierra client.
Parameters
----------
client : SierraDevelopmentClient
The Sierra client instance.
"""
client.load_invoker(invoker)
Compiling
import sierra
# Initialize Sierra client with DEBUGโlevel logging
client = sierra.SierraDevelopmentClient(
environment_name="idd",
logger=sierra.UniversalLogger(
name="Sierra",
level=sierra.sierra_internal_logger.LogLevel.DEBUG,
),
)
# Discover and register all invoker scripts
client.load_invokers_from_scripts()
# Generate standalone scripts and config.yaml
client.compiler.compile()
๐ฆ API Highlights
sierra.core.builder: Builder for invoker scriptssierra.core.compiler: Compiler for invoker scriptssierra.core.loader: Loader for compiled scriptssierra.abc.sierra: Abstract base classes for Sierra componentssierra.invoker: Invoker script definitions
๐ ๏ธ Configuration & Extensibility
SierraโSDK supports extensibility through plugins and custom configurations. You can add custom plugins by creating a new folder in the plugins/ directory and adding your plugin code.
Plugin Folders
plugins/: Folder for custom pluginscore/: Folder for core SierraโSDK componentsabc/: Folder for abstract base classesinvoker/: Folder for invoker script definitions
๐ก Contributing Guidelines & Code of Conduct
We welcome contributions to SierraโSDK! Please see our CONTRIBUTING.md file for guidelines on how to contribute.
Code of Conduct
We follow the Python Code of Conduct.
๐ License & Authors
SierraโSDK is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE.
Authors
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 sierra_dev-0.1.2.tar.gz.
File metadata
- Download URL: sierra_dev-0.1.2.tar.gz
- Upload date:
- Size: 44.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb1429669b6423b20ec65bf60d9e38d6d7bcba6002eb86dd0e0aa743946b9fd8
|
|
| MD5 |
6d4dab6d12fbbab0be898af5ced4beff
|
|
| BLAKE2b-256 |
9c8ee5c2ada8586ac4f9e75c3e89e63899e24547a6be152412b277c17394961e
|
Provenance
The following attestation bundles were made for sierra_dev-0.1.2.tar.gz:
Publisher:
python-publish.yml on xsyncio/sierra-dev
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sierra_dev-0.1.2.tar.gz -
Subject digest:
fb1429669b6423b20ec65bf60d9e38d6d7bcba6002eb86dd0e0aa743946b9fd8 - Sigstore transparency entry: 307517905
- Sigstore integration time:
-
Permalink:
xsyncio/sierra-dev@4b0a6f84564ec96630d6ff716a84b60e3640abe0 -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/xsyncio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@4b0a6f84564ec96630d6ff716a84b60e3640abe0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sierra_dev-0.1.2-py3-none-any.whl.
File metadata
- Download URL: sierra_dev-0.1.2-py3-none-any.whl
- Upload date:
- Size: 48.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d954c9cab0c694c34ad330d7f97484a2cc0bf3d54454ef50cd29ab3c174f66cf
|
|
| MD5 |
95a99407fcb6a23de9b7a03938ba1153
|
|
| BLAKE2b-256 |
3467e017257ec9293f3e589def401170599ed60118d66b6c07f76d46c5d886d3
|
Provenance
The following attestation bundles were made for sierra_dev-0.1.2-py3-none-any.whl:
Publisher:
python-publish.yml on xsyncio/sierra-dev
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sierra_dev-0.1.2-py3-none-any.whl -
Subject digest:
d954c9cab0c694c34ad330d7f97484a2cc0bf3d54454ef50cd29ab3c174f66cf - Sigstore transparency entry: 307517907
- Sigstore integration time:
-
Permalink:
xsyncio/sierra-dev@4b0a6f84564ec96630d6ff716a84b60e3640abe0 -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/xsyncio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@4b0a6f84564ec96630d6ff716a84b60e3640abe0 -
Trigger Event:
release
-
Statement type: