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.5.1.tar.gz
(26.1 kB
view hashes)
Built Distribution
cybereason-0.5.1-py3-none-any.whl
(30.1 kB
view hashes)
Close
Hashes for cybereason-0.5.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 100c31f11c5bd9a692da02c442edbf53636e6c564c779eeadc9a3e93cefdf3c9 |
|
MD5 | 8fd0ed8aad45761bd3aeb06d35728d3d |
|
BLAKE2b-256 | 2ee381a404522edde871b4f70d9d5193171bac4efa043ed9e335b9f2dc969e18 |