Chronicle Client

The Chronicle client is the core component of the Google SecOps SDK for Python that allows you to interact with Google Chronicle/SecOps SIEM.

Initializing the Chronicle Client

After creating a SecOpsClient, you need to initialize the Chronicle-specific client:

from secops import SecOpsClient

# Initialize with default credentials
client = SecOpsClient()

# Initialize Chronicle client
chronicle = client.chronicle(
    customer_id="your-chronicle-instance-id",  # Your Chronicle instance ID
    project_id="your-project-id",             # Your GCP project ID
    region="us"                               # Chronicle API region
)

For available regions, see the Regions documentation.

Features

The Chronicle client provides access to the following features:

Security Intelligence

Alert and Case Management

Detection Rules

Examples

Here’s a simple example of using the Chronicle client to search for events:

# Search for events in the last 24 hours
results = chronicle.search(
    query="metadata.product_name = \"Okta\"",
    start_time="1d"
)

# Process the results
for event in results:
    print(f"Event time: {event.get('metadata', {}).get('event_timestamp')}")
    print(f"Product: {event.get('metadata', {}).get('product_name')}")
    print("---")

Next Steps

Explore the specific features of the Chronicle client in the following pages: