Skip to main content

Python SDK for CAT Session behavioral security API

Project description

cat-session-sdk

Python SDK for CAT Session — behavioral session security with no ML, no training data required.

Install

pip install cat-session-sdk

Quick start

from cat_session_sdk import CATClient

cat = CATClient(api_key="your_key")  # get key at session.artrofimov.xyz

# Score events as they happen
score = cat.score(
    entity_id="user_123",
    endpoint="/api/payment",
    status_code=200,
)

if score and score.alert:
    print(f"Alert: {score.which_channel}")
    # "behavioral drift detected" or "population deviation detected"

Plug in your logs

from cat_session_sdk import CATClient
from cat_session_sdk.adapters.okta import stream_okta_log

cat = CATClient(api_key="your_key")

for event in stream_okta_log("okta_system_log.json"):
    score = cat.score_event(event)
    if score and score.alert:
        print(f"{event.entity_id}: {score.which_channel}")

One-command evaluation

pip install cat-session-sdk[cli]
cat-session-evaluate your_logs.json --format okta --top 20 --html report.html

API key

Get a free key (100k events/month) at https://session.artrofimov.xyz

cat-session-sdk

Small Python SDK for interacting with cat-session-api.

Example

from cat_session_sdk import Client

c = Client(base_url='http://localhost:8000')
resp = c.ingest('alice', {'endpoint':'/api/test','status_code':200,'method':'GET'})
print(resp)

cat-session-sdk

Minimal SDK for interacting with the CAT Session API.

Install locally for testing:

pip install -e cat-session-sdk

Example:

from cat_session_sdk import CATClient
c = CATClient("http://127.0.0.1:8001")
print(c.get_score("demo:normal"))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cat_session_sdk-1.2.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file cat_session_sdk-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cat_session_sdk-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 950d414559f0468606d35290e7dd3d535fee456c39a393052a621e73cbacd499
MD5 88ae013e9cef3a629e4db71fdb6531c8
BLAKE2b-256 6bee84d4ece9bd406b49e183ec1aba26884a23e206d309e015087f8b6abd4443

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page