Skip to content
trustlab-orgPublic

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

26 Commits

Folders and files

Repository files navigation

siphon

A lightweight, single-binary collector that pulls logs from cloud and SaaS platforms into Kafka, S3, Opensearch

Features

  • Google Workspace audit logs from the Admin SDK Reports API: 14 log types, including login, admin, OAuth tokens, Drive, Gmail and SAML.
  • One cursor per log type. A cursor moves forward only after the output confirms every event in the window.
  • Late events are caught: each poll re-checks the last few minutes, and a periodic sweep reaches back further per log type.
  • Deterministic event IDs for deduplication, also used as the Kafka message key.
  • API responses are kept as received; nested parameters are flattened into a params object.
  • Exponential backoff on rate limits and server errors. Log types the tenant's plan does not offer are re-checked hourly.
  • Prometheus metrics per log type: events sent, late events, poll errors and cursor lag.
  • Any Bento output: Kafka, S3, OpenSearch, Elasticsearch, HTTP or files.
  • One static binary, configured with a YAML file and an env file. No runtime to install.

Installation

Requires Go 1.27+.

go build -o bin/siphon ./cmd/collector

Google Workspace setup

A super admin account is needed for these steps

1. Create a reports user

  1. In the Admin console, go to Directory, Users, Add new user, for example reports@your-domain.
  2. Sign in once as this user and accept the terms. Set a long password and store it; Siphon does not use it.
  3. Go to Account, Admin roles, Create new role. Name it "Reports reader" and select only the Reports privilege.
  4. Assign the role to the reports user.

2. Create a service account and key

  1. In Google Cloud console, signed in as the super admin, create a project inside your organization.
  2. Go to APIs & Services, Library and enable the Admin SDK API.
  3. Go to IAM & Admin, Service accounts, Create service account. Do not grant it any roles.
  4. Open the service account then Keys, there Create new key, JSON. The key file downloads.
  5. If key creation is blocked, the organization policy "Disable service account key creation" is on. Override it for this project only, create the key, then set the policy back to "Inherit parent's policy". The key keeps working.
  6. Copy the service account's Unique ID from its details page.

3. Allow domain-wide delegation

  1. In the Admin console, go to Security, Access and data control, API controls, Manage Domain Wide Delegation, Add new.
  2. Client ID: the Unique ID from step 2.6.
  3. OAuth scope: https://www.googleapis.com/auth/admin.reports.audit.readonly
  4. Authorize.

4. Run

  1. Save the key as secrets/google-sa.json and restrict it: chmod 600 secrets/google-sa.json. Never commit it.

  2. Copy the settings template and fill it in:

    cp deploy/gws/gws.env.example deploy/gws/gws.env

    Set GWS_ADMIN_SUBJECT to the reports user and KAFKA_BROKERS for your Kafka. Keep KAFKA_TOPIC=tlsoc.logs.google_workspace: the TLSOC engine reads every tlsoc.logs.* topic by itself, so nothing else needs configuring.

  3. Start Siphon:

    ./bin/siphon -e deploy/gws/gws.env -c config/google-workspace.yaml

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages