Skip to main content

Generate and ingest synthetic logs into Chronicle

Project description

SecOps Log Hammer

A Python tool for generating and ingesting synthetic logs into Chronicle.

Description

SecOps Log Hammer is designed for testing and development purposes. It can generate realistic security logs in various formats (WINEVTLOG, OKTA, AZURE_AD, GCP_CLOUDAUDIT, CS_EDR) and ingest them into Chronicle.

Features

  • Generate realistic security log data
  • Support for multiple log formats
  • Configurable log volume (by GB or MB)
  • Progress tracking
  • Automatic forwarder management
  • Support for production, staging, and development environments

Installation

pip install secops-log-hammer

Requirements

  • Python 3.7 or later
  • Google Cloud authentication credentials (either Application Default Credentials or a service account key file)
  • Chronicle instance access

Authentication

Log Hammer supports two authentication methods:

Application Default Credentials (ADC) - Recommended

By default, Log Hammer uses Application Default Credentials. To set up ADC:

gcloud auth application-default login

This will authenticate your account and store credentials locally. No additional parameters are needed when running Log Hammer.

Service Account Key

Alternatively, you can use a service account key file:

  1. Create a service account with appropriate Chronicle permissions
  2. Generate a JSON key file for the service account
  3. Provide the path to the key file using the --service-account-path option

Usage

log-hammer --customer_id YOUR_CUSTOMER_ID --project_id YOUR_PROJECT_ID [--region REGION] [--gb 0.1 | --mb 100]

The CLI supports both underscore and dash formats for arguments (e.g., --customer_id or --customer-id).

Required Arguments

  • --customer_id / --customer-id: Chronicle Customer ID
  • --project_id / --project-id: Google Cloud Project ID

Log Size Options (specify one)

  • --gigabytes / --gb: Approximate gigabytes of raw logs to generate and ingest
  • --megabytes / --mb: Approximate megabytes of raw logs to generate and ingest

If neither option is specified, defaults to 100 MB.

Note: You can use the short forms --gb and --mb instead of --gigabytes and --megabytes for convenience.

Other Options

  • --region: Chronicle API region (e.g., us, europe, asia-southeast1). Special values:
    • staging: Use the Chronicle staging environment
    • dev: Use the Chronicle development/autopush environment
    • Default: "us"
  • --service_account_path / --service-account-path: Path to GCP service account JSON key file for authentication. If not provided, Application Default Credentials (ADC) will be used.
  • --forwarder_display_name / --forwarder-display-name: Display name for the Chronicle forwarder to be created/used (default: "PythonLogIngestScriptForwarder").
  • --namespace: Optional asset namespace for the logs. May be required for some log types.
  • --log_types / --log-types: Comma-separated list of log types to generate. If empty, all available types will be used.
  • --labels: Optional labels to attach to logs in key=value,key2=value2 format or as JSON object.

Examples

Generate and ingest 0.5 GB of logs into Chronicle in the US region:

log-hammer --customer-id my-customer-id --project-id my-gcp-project --gb 0.5

Generate and ingest 100 MB of logs:

log-hammer --customer-id my-customer-id --project-id my-gcp-project --mb 100

Use a service account key for authentication:

log-hammer --customer-id my-customer-id --project-id my-gcp-project --mb 50 --service-account-path /path/to/service-account-key.json

Generate only specific log types:

log-hammer --customer-id my-customer-id --project-id my-gcp-project --log-types WINEVTLOG,OKTA

Generate logs for a staging environment:

log-hammer --customer-id my-customer-id --project-id my-gcp-project --region staging --mb 10

Generate logs for a development/autopush environment:

log-hammer --customer-id my-customer-id --project-id my-gcp-project --region dev --mb 10

License

Apache 2.0

Project details


Download files

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

Source Distribution

secops_log_hammer-1.1.0.tar.gz (43.7 kB view details)

Uploaded Source

Built Distribution

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

secops_log_hammer-1.1.0-py3-none-any.whl (45.0 kB view details)

Uploaded Python 3

File details

Details for the file secops_log_hammer-1.1.0.tar.gz.

File metadata

  • Download URL: secops_log_hammer-1.1.0.tar.gz
  • Upload date:
  • Size: 43.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for secops_log_hammer-1.1.0.tar.gz
Algorithm Hash digest
SHA256 0d7566a8a6733b09943102912e80a602b68e4e6f51a4055fc4fa35568f2b5c30
MD5 b761c99a7aa7abd88815c42f7641b187
BLAKE2b-256 0e664ea72ecf10296859249cf93e5ae9cbb7af94adcaa3f796f056d225b6b77b

See more details on using hashes here.

File details

Details for the file secops_log_hammer-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for secops_log_hammer-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 02881c8d01c99f0de1bb9af7d4a5a066219f35003111cf84d98824fd6505d37a
MD5 ec49e3d9866cebd3ee304a4465e427e0
BLAKE2b-256 f59d6d92b2947d94a51754d0d26f585fe85a7823f8ad4fa99da687cff16b33f7

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