Skip to main content

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)

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.10.tar.gz (31.9 kB view details)

Uploaded Source

File details

Details for the file capsule8-1.10.tar.gz.

File metadata

  • Download URL: capsule8-1.10.tar.gz
  • Upload date:
  • Size: 31.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for capsule8-1.10.tar.gz
Algorithm Hash digest
SHA256 9ad438d57ccb3de087b38a03e2e9e61e30bcf34d50b9a90f20207c656a88d91c
MD5 9608bb8a3bb32160b0868f9fadadec71
BLAKE2b-256 1a00bc5fafbadcc3922952d987d38d6cd8ae1ed33d0c7565579e9ab2285f648b

See more details on using hashes here.

Release history Release notifications | RSS feed

1.15

1 file

1.14

1 file

1.13

1 file

1.12

1 file

1.11

1 file

This release

1.10 This release

1 file

1.9

1 file

1.8

1 file

1.7

1 file

1.6

1 file

1.5

1 file

1.4

1 file

1.3

1 file

1.2

1 file

1.1

1 file

1.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page