capsule8 open source sensor python grpc bindings
Project description
Capsule8 api-python
This repo is as a wrapper repo around the Capsule8 sensor api.
Install with pip
pip install capsule8
Install with virtualenv
virtualenv test_capsule8
cd test_capsule8
source bin/activate
pip install capsule8
Examples
In order to run the examples you need to have a running capsule8 sensor on your machine. Once you have a running sensor you can run the examples. Be sure that the capsule8 sensor socket chowned by the current user.
sudo chown $USER /var/run/capsule8/sensor.sock
Then you can run the SensorClient and start streaming capsule8 sensor telemetry. In this example, every process events pid will be printed to stdout
from capsule8.sensor import SensorClient
from itertools import islice
s = SensorClient()
s.subscribe({"event_filter": {
"process_events": [
{"type": "PROCESS_EVENT_TYPE_FORK"},
{"type": "PROCESS_EVENT_TYPE_EXEC"},
{"type": "PROCESS_EVENT_TYPE_EXIT"}
]
}})
max_events = 5
for event in islice(s.telemetry(), max_events):
print(event.events[0].event.process_pid)
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
capsule8-1.15.tar.gz
(21.7 kB
view details)
File details
Details for the file capsule8-1.15.tar.gz
.
File metadata
- Download URL: capsule8-1.15.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.0 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 719aeecd93898c56b80acab5ac2c5af41861cd270f2c1bb27d3191e50df88989 |
|
MD5 | 50fee1b0bdc6e06780f5dbe2e869b020 |
|
BLAKE2b-256 | cd1e0f43a77aad05bec30b6a623e7e501c6ea0c3a3687bdd897c1974f981363e |