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.3.tar.gz
(26.3 kB
view details)
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 cybereason-0.6.3.tar.gz.
File metadata
- Download URL: cybereason-0.6.3.tar.gz
- Upload date:
- Size: 26.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0f66e25b9e6e425732938556285fa0a9701c23af588823e32de9106f207e8c6
|
|
| MD5 |
b67dd2ac2db2ed20468cba3e86117515
|
|
| BLAKE2b-256 |
b5dcfe060f87dd9947f55ddb163739fa2ba2ef425de09ea8aa1f423f01303a6c
|
File details
Details for the file cybereason-0.6.3-py3-none-any.whl.
File metadata
- Download URL: cybereason-0.6.3-py3-none-any.whl
- Upload date:
- Size: 30.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
264cf0ae8c3d0ce0a77fae75379ab953530ed9b544070a7c76c4be3acaa73b4e
|
|
| MD5 |
7da8614ee3b2f8cba5eced9945ba8c9d
|
|
| BLAKE2b-256 |
31c17115f977835eef6553c4828f633c2bcf5539641ee3d86bf543788c95906b
|