Python package for managing the LOOBins model and schema.
Project description
PyLOOBins
PyLOOBins is a Python SDK and command-line utility for programmatically interacting with LOOBins.
You can download PyLOOBins from PyPI by running the following command:
pip install pyloobins
PyLOOBins requires Python 3.8 or later.
Usage
Command-line
You can run pyloobins --help
to see the available commands and options.
>>> pyloobins --help
Usage: pyloobins [OPTIONS] COMMAND [ARGS]...
Create, validate, and view LOOBin objects.
Options:
--help Show this message and exit.
Commands:
create Create a YAML template file for a new LOOBin.
get Get a LOOBin object.
validate Validate a LOOBin YAML file.
You can run pyloobins <command> --help
to see the available options for a specific command.
>>> pyloobins validate --help
Usage: pyloobins validate [OPTIONS]
Validate a LOOBin YAML file.
Options:
--path TEXT The path of the LOOBin YAML file to validate. [required]
--help Show this message and exit.
SDK
You can use pyloobins as a Python SDK to programmatically interact with LOOBins.
pyloobins.util
The util module can be used to get LOOBin objects from the LOOBins API, validate LOOBin YAML files, and create LOOBin YAML templates.
Example: get all LOOBins and print a list of the use case code.
from pyloobins import util
loobins = util.get_loobins()
for loobin in loobins:
for uc in loobin.example_use_cases:
print(f"{loobin.name}: {uc.code}")
pyloobins.models
The models module contains the classes that represent a LOOBin and its various components.
Example: programmitcally create a LOOBin object.
from pyloobins.models import Detection, ExampleUseCase, LOOBin, Resource
l = LOOBin(
name="",
short_description="A short description of the binary goes here.",
full_description="A full length description of the binary goes here.",
author="Enter your name or alias here.",
created=date.today(),
example_use_cases=[
ExampleUseCase(
name="An Example Use Case",
description="A description of the use case goes here.",
code="A code snippet goes here.",
tactics=["Discovery"],
tags=["example_tag", "another_tag"],
)
],
paths=["/enter/binary/path/here"],
detections=[
Detection(
name="A detection source (e.g. Sigma)",
url="https://urltodetection.here",
)
],
resources=[
Resource(
name="Name of resources.",
url="https://urlofexternalreference.here",
)
],
acknowledgements=["Enter any acknowledgements here."],
)
with open ("loobin.yaml", "w") as f:
f.write(l.to_yaml())
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file pyloobins-1.7.2.tar.gz
.
File metadata
- Download URL: pyloobins-1.7.2.tar.gz
- Upload date:
- Size: 43.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9207ccdec4cd376480aa7ccdb1dfd17ba4d202ecd9a462656aeed50f9705322 |
|
MD5 | b19dba028f0ef2d71e5d12faa17380f3 |
|
BLAKE2b-256 | e692a58844e12f9fb07b149a52403a19bf76fab56066406ffff9254336da9652 |
File details
Details for the file pyloobins-1.7.2-py3-none-any.whl
.
File metadata
- Download URL: pyloobins-1.7.2-py3-none-any.whl
- Upload date:
- Size: 65.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37392ddc358e19761c167c00f63da52625cb855a9f041d04007db1bd80c17d7f |
|
MD5 | de2a7add4b7056189613fb9a98fabd99 |
|
BLAKE2b-256 | ea344374c19501169a7163ac5ff5f041c2d21a32cf9262b0229d2f15f1649b6a |