autosec
Python package intended to be used in a Security Operations Center for various repeated automation functions.
Written for Linux. Windows support coming maybe.
Dunno if I want to punish myself that much or not.
The use cases that spurred development is for log ingestion and/or event collection from disconnected log collectors which may or may not be separated due to multi-tenant or domain separated SIEM deployments.
i.e, a centralized app server "secapp1" can send logs to separate collectors which are each allocated to a separate tenant or client, such that:
Client A SaaS service -> secapp1 collection -> Client A log collector
Client B SaaS service -> secapp1 collection -> Client B log collector
Additionally, credentials stored on the app server are never visible between clients in plaintext and are easily referenced in automation scripts.
Client A Plain Credentials (not stored) + socapp1 DEK -> Client A Cipher Credentials (stored)
Client B Plain Credentials (not stored) + socapp1 DEK -> Cliebt B Cipher Credentials (stored)
Really, I just got tired of manually encrypting API tokens, constantly loading an entire .env file to get access to those credentials, and then hardcoding different collector info everytime I wanted to send a log, yada yada yada.
Enough belly aching. Here's my tremendously mediocre README:
autosec/autocred
Module utilized for local storage of credentials for use in automation scripts.
Use CLI to list, create, update, and delete credentials to be read in scripts. CLI must be initialized before use - stores data encryption key in .bashrc, which must be sourced before use. Encrypted credentials are stored in a .env file in the user's home directory.
example CLI usage:
autocred -a token_name
autocred --add token_name
>Value to be encrypted: ******
>One more time for validation: ******
autocred -u token_name
autocred --update token_name
>Updated value: ******
>One more time for validation: ******
autocred -l
autocred --list
> token_name = "<ciphertext>"
autocred -d token_name
autocred --delete token_name
example call in python script:
from autosec import autocred
some_token = autocred.get_token('token_name')
autosec/autolog
Module utilized for building REST API integrations for on-prem SIEMs/event collectors and automation/script monitoring.
Use CLI to list, create, update, and delete collector configurations to be used in scripts.
Collector configurations are stored in a JSON file in the user's home directory, and include the IP address and listening port. IP is stored as a string and port as an integer to be used with the module. Before a collector is added, a network socket connection to the IP and port specified is made to ensure connectivity.
example CLI usage:
autolog -a some_collector
autolog --add some_collector
>Please enter some_collector IPv4: <kbd>10.10.10.10</kbd>
>Please enter some_collector port: <kbd>514</kbd>
autolog -l
autolog --list
>some_collector --> 10.10.10.10:514
autolog -u some_collector
autolog --update some_collector
>Please enter some_collector IPv4: <kbd>100.100.100.100</kbd>
>Please enter some_collector port: <kbd>514</kbd>
autolog -l
autolog --list
>some_collector --> 100.100.100.100:514
autolog -d some_collector
autolog --delete some_collector
example call in python script:
from autosec import autolog
import requests
collector_IP, collector_port = autolog.set_collector('some_collector')
autolog.enable_exit_report(collector_IP, collector_port)
some_api_response = requests.get(
url='https://vendor.com/some/api/endpoint',
headers={"header_key": "header_value"},
auth=some_token
)
for msg_to_convert in some_api_response['response']:
leef_log = autolog.json_to_leef(
json_obj=msg_to_convert,
vendor='some_vendor',
product='vendor_product',
version='1.0',
event_id='some_event'
)
autolog.syslog_to_collector(
event=leef_log,
logtype='api_source',
loglevel='INFO',
collectorip=collector_IP,
collectorport=collector_port
)
See also: Sample Uses
This was fun.
Metadata
Release files for autosec 2.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| autosec-2.1.2.tar.gz | 11.5 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autosec-2.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.9 kB
Release files / autosec-2.1.2.tar.gz
| Download URL | autosec-2.1.2.tar.gz |
|---|---|
| Size | 11.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47b969398ee0786c54e33c8234083e88c797a3ca1aec02dd68156a6aef7c1ec3
|
|
BLAKE2b-256 checksum How to use checksums |
d10103385640f1fb50526d046e7ce4356b13c282fddd8558d0edc4f8f9a97851
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 7, 2025.
Transparency logRelease files / autosec-2.1.2-py3-none-any.whl
| Download URL | autosec-2.1.2-py3-none-any.whl |
|---|---|
| Size | 12.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3a10819e3fd5d9a1b0b496bf89f52f0bc869c6cea111ab3ad1d0cc47ee91ea22
|
|
BLAKE2b-256 checksum How to use checksums |
2bb3d78daec941417fdd6539d77d7b121535c800a4cd42ee38f1d2a87090dcf6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 7, 2025.
Transparency logSecurity for autosec 2.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for autosec-2.1.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 7, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.