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(<server>, <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(<server>, <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-2023 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.1.3.tar.gz
(24.3 kB
view hashes)
Built Distribution
cybereason-0.1.3-py3-none-any.whl
(28.9 kB
view hashes)
Close
Hashes for cybereason-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b514513b64e391fb5afc3d645ab718e19db9afbd2512f24d12e0f5fe24e09d4 |
|
MD5 | 8345cd6936600a80f9a8615932a6be3f |
|
BLAKE2b-256 | c2007cdc8f5faf36ab907792108c7af0c8ecafdcc3ca720785963136d0536075 |