Async Cybereason API client
Project description
Cybereason
Async Cybereason API client
Installation
pip install cybereason
Install cybereason using:
pip install cybereason[zip]
to enable on-the-fly extraction of files downloaded from sensors,pip install cybereason[socks]
to enable SOCKS proxy support, orpip install cybereason[zip,socks]
to enable both features.
Examples
Save metadata and config for every policy
from cybereason import Cybereason
import asyncio
import json
async def dump_policies_config():
'''Save metadata and config for every policy.
'''
async with Cybereason(<tenant>, <username>, <password>) as client:
async for policy in client.get_policies(show_config=True):
filename = f'{policy["metadata"]["name"]}.json'
with open(filename, 'w') as f:
json.dump(policy, f, indent=4)
asyncio.run(dump_policies_config())
Download and parse into JSON all user audit logs (action log)
from cybereason import Cybereason
import asyncio
import json
async def user_audit():
async with Cybereason(<tenant>, <username>, <password>) as client:
# rotated=False to get only the latest logs
logs = [log async for log in client.get_user_audit_logs(rotated=True)]
with open('user_audit.json', 'w') as f:
json.dump(logs, f, indent=4)
asyncio.run(user_audit())
Copyright © 2021-2024 Forensic & Security
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
cybereason-0.6.0.tar.gz
(26.2 kB
view details)
Built Distribution
File details
Details for the file cybereason-0.6.0.tar.gz
.
File metadata
- Download URL: cybereason-0.6.0.tar.gz
- Upload date:
- Size: 26.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c7d9d362218d394c886320d7a4f39cb50652847632b5d2d3656e485e4f98149 |
|
MD5 | 31ee8fbb5c421316cc7e6e2e253f8f0f |
|
BLAKE2b-256 | e681b211cf0ed723a0a61c5d500e9019e26940f7ea6945105183dd127563a83e |
File details
Details for the file cybereason-0.6.0-py3-none-any.whl
.
File metadata
- Download URL: cybereason-0.6.0-py3-none-any.whl
- Upload date:
- Size: 30.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee20c126ff54cf184e3a370cb57222130aa61885d5f2ec8123d2de5400a29083 |
|
MD5 | 6673e6b30206d1c9e458d8c7246535c9 |
|
BLAKE2b-256 | 2a0aa5393cfa1df365e6d22c9e6fa7b406da7afef70840defe882607dc3006bb |