GitGuardian Audit Logs Trigger

GitGuardian Audit Logs Trigger

Certified

Trigger a flow on new GitGuardian audit log events

Polls GET /v1/audit_logs at interval and starts one execution per poll carrying the new events since the last poll (trigger.events), so a burst of activity produces one execution, not one per event. A poll carries at most maxItemsPerPoll events (default 100) to keep the output small; the rest fire on the next polls. The API cannot sort audit logs, so each poll reads every event of a window of at most one day after the watermark, then delivers the oldest ones. A longer backlog is caught up one window per poll. Optionally restrict to eventNames. The watermark (newest delivered date plus the IDs sharing it) is kept in the flow namespace KV store; on the first poll it is seeded at the current time and nothing fires. Requires the audit_logs: read scope.

yaml
type: io.kestra.plugin.gitguardian.auditlogs.Trigger

Alert when an incident is ignored or an API token is created

yaml
id: gitguardian_sensitive_actions
namespace: company.security

tasks:
  - id: alert
    type: io.kestra.plugin.slack.SlackIncomingWebhook
    url: "{{ secret('SLACK_WEBHOOK') }}"
    messageText: |
      GitGuardian: {{ trigger.count }} sensitive action(s)
      {% for event in trigger.events %}- {{ event.eventName }} by {{ event.memberEmail ?? event.apiTokenId }}
      {% endfor %}

triggers:
  - id: on_audit_event
    type: io.kestra.plugin.gitguardian.auditlogs.Trigger
    apiKey: "{{ secret('GITGUARDIAN_API_KEY') }}"
    interval: PT5M
    eventNames:
      - incident.ignored
      - api_token.created
Installation

Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:

kestractl plugins get io.kestra.plugin:plugin-gitguardian --compatible-for $KESTRA_VERSION

For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.

Properties

GitGuardian API key

Personal access token or service account token created in the GitGuardian dashboard under API > Personal access tokens / Service accounts. The token needs the scopes required by the tasks and triggers you use, for example scan, incidents: read, incidents: write, or honeytokens: read. Sent as Authorization: Token <key>; never logged or included in error messages.

Defaultfalse

Specifies whether a trigger is allowed to start a new execution even if a previous run is still in progress.

Defaulthttps://api.gitguardian.com

GitGuardian API URL

Base URL of the GitGuardian API for your workspace: https://api.gitguardian.com (US, default), https://api.eu1.gitguardian.com (EU), or https://<your-instance>/exposed for a self-hosted GitGuardian. The /v1 prefix is appended automatically.

SubTypestring

Only these event names

For example incident.ignored. All events when omitted. Filtered server-side one name at a time.

DefaultPT5M
Formatduration

Polling interval

How often to poll the GitGuardian API. Defaults to PT5M.

Default100

Maximum items delivered per poll

Caps how many new items one execution carries, from 1 to 1000. Defaults to 100. Items beyond the cap are not lost: the watermark only advances past delivered items, so they fire on the next polls, oldest first.

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

List of execution states after which a trigger should be stopped (a.k.a. disabled).

Defaulttrue

A condition that determines whether the trigger should run.

A Pebble expression evaluated at trigger time. The trigger fires only when the expression evaluates to a truthy value (true, a non-empty string, a non-zero number). Use this to gate trigger execution on dynamic runtime values such as execution labels, flow variables, or environment conditions.

Number of new events

New audit log events since the previous poll, oldest first

At most maxItemsPerPoll per execution.

Definitions
actionTypestring

Action type

For example create, update, or delete.

apiTokenIdstring

ID of the API token used, when the action came through the API

dataobject

Additional event data

datestring
Formatdate-time

Event date

eventNamestring

Event name

For example incident.ignored, api_token.created, or member.invited. GET /v1/audit_logs/event_names lists them all.

idinteger

Audit log entry ID

ipAddressstring

Source IP address

memberEmailstring

Email of the member who performed the action

memberIdinteger

ID of the member who performed the action

Null when the member was deleted or the action came from an API token.

memberNamestring

Name of the member at the time of the action

targetIdsarray

IDs of the objects targeted by the action