GitGuardian Secret Incidents Trigger

GitGuardian Secret Incidents Trigger

Certified

Trigger a flow when GitGuardian detects a secret incident

Polls GET /v1/incidents/secrets at interval and starts one execution per poll carrying the incidents whose last trigger date (date) is newer than the recorded watermark, oldest first (trigger.incidents), at most maxItemsPerPoll (default 100) at a time; the rest fire on the next polls. GitGuardian bumps date when a resolved or ignored incident is triggered again, so regressions fire too; check regression on each incident if they should be handled differently. Filters (status, severity, validity, detectorGroupName, tags, riskScoreMin) are applied server-side. The watermark (newest delivered date plus the IDs sharing it) lives in the flow namespace KV store, so nothing is re-fired after a restart. On the very first poll only the current baseline is recorded and nothing fires, which avoids flooding the flow with the existing backlog when the trigger is enabled. Requires the incidents: read scope.

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

Notify Slack and assign the on-call for every new valid critical incident

yaml
id: gitguardian_incident_response
namespace: company.security

tasks:
  - id: each_incident
    type: io.kestra.plugin.core.flow.Loop
    values: "{{ trigger.incidents }}"
    tasks:
      - id: notify
        type: io.kestra.plugin.slack.SlackIncomingWebhook
        url: "{{ secret('SLACK_WEBHOOK') }}"
        messageText: ":rotating_light: {{ fromJson(item.value).incidentName }} ({{ fromJson(item.value).severity }}, {{ fromJson(item.value).validity }}) {{ fromJson(item.value).gitguardianUrl }}"

      - id: assign
        type: io.kestra.plugin.gitguardian.incidents.Assign
        apiKey: "{{ secret('GITGUARDIAN_API_KEY') }}"
        incidentId: "{{ fromJson(item.value).id }}"
        assigneeEmail: security-oncall@company.com

triggers:
  - id: on_incident
    type: io.kestra.plugin.gitguardian.incidents.Trigger
    apiKey: "{{ secret('GITGUARDIAN_API_KEY') }}"
    interval: PT1M
    severity: CRITICAL
    validity: VALID

Open a Jira ticket for every new incident on the EU region

yaml
id: gitguardian_incident_to_jira
namespace: company.security

tasks:
  - id: each_incident
    type: io.kestra.plugin.core.flow.Loop
    values: "{{ trigger.incidents }}"
    tasks:
      - id: ticket
        type: io.kestra.plugin.jira.issues.Create
        baseUrl: https://company.atlassian.net
        username: "{{ secret('JIRA_USER') }}"
        password: "{{ secret('JIRA_TOKEN') }}"
        projectKey: SEC
        summary: "Leaked secret: {{ fromJson(item.value).incidentName }}"
        description: "{{ fromJson(item.value).gitguardianUrl }}"

triggers:
  - id: on_incident
    type: io.kestra.plugin.gitguardian.incidents.Trigger
    apiKey: "{{ secret('GITGUARDIAN_API_KEY') }}"
    apiUrl: https://api.eu1.gitguardian.com
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.

Only incidents from this detector group

For example aws_iam.

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.

Minimum risk score, from 0 to 100

Possible Values
CRITICALHIGHMEDIUMLOWINFOUNKNOWN

Only incidents at this severity

CRITICAL, HIGH, MEDIUM, LOW, INFO, or UNKNOWN. Any severity when omitted.

Possible Values
TRIGGEREDASSIGNEDRESOLVEDIGNOREDUNKNOWN

Only incidents in this status

TRIGGERED, ASSIGNED, RESOLVED, or IGNORED. Any status when omitted.

SubTypestring
Possible Values
CREATEDSUBMITTEDRUNNINGPAUSEDRESTARTEDKILLINGSUCCESSWARNINGFAILEDKILLEDCANCELLEDQUEUEDRETRYINGRETRIEDSKIPPEDBREAKPOINTRESUBMITTED

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

SubTypestring

Only incidents carrying all of these GitGuardian tags

For example PUBLICLY_EXPOSED.

Possible Values
VALIDINVALIDFAILED_TO_CHECKNO_CHECKERNOT_CHECKEDUNKNOWN

Only incidents with this secret validity

VALID, INVALID, FAILED_TO_CHECK, NO_CHECKER, or UNKNOWN.

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 incidents in this execution

New incidents since the previous poll, oldest first

At most maxItemsPerPoll per execution.

Definitions
assigneeEmailstring

Email of the assigned member

assigneeIdinteger

ID of the assigned member

customTagsarray

Custom tags set on the incident

idstring

Custom tag ID

keystring

Custom tag key

valuestring

Custom tag value

Null for key-only tags.

datestring
Formatdate-time

Date the incident was last triggered

declarativeSecretStatusstring

Declarative secret status

Only set on Public Monitoring incidents delivered by webhook, for example active or not_declared.

detector

Detector that found the secret

detectorGroupDisplayNamestring

Detector group display name

detectorGroupNamestring

Detector group name

displayNamestring

Detector display name

For example AWS Keys.

familystring

Detector family

For example apikey, token, or private_key.

namestring

Detector name

For example aws_iam.

naturestring

Detector nature

specific or generic.

gitguardianUrlstring

Incident URL on the GitGuardian dashboard

idinteger

Incident ID

ignoreReasonstring

Reason given when the incident was ignored

test_credential, false_positive, low_risk, or invalid.

ignoredAtstring
Formatdate-time

Date the incident was ignored

incidentNamestring

Human-readable incident name

Combines the detector and a short identifier, for example AWS Keys - 7f3a.

occurrencesCountinteger

Number of occurrences of the secret across monitored sources

regressionboolean

Whether the incident was re-triggered after being resolved or ignored

resolvedAtstring
Formatdate-time

Date the incident was resolved

riskScoreinteger

Risk score from 0 (low) to 100 (critical)

secretRevokedboolean

Whether the secret was reported as revoked on resolution

severitystring
Possible Values
CRITICALHIGHMEDIUMLOWINFOUNKNOWN

Incident severity

critical, high, medium, low, info, or unknown.

shareUrlstring

Public share URL, if the incident was shared

statusstring
Possible Values
TRIGGEREDASSIGNEDRESOLVEDIGNOREDUNKNOWN

Incident status

TRIGGERED, ASSIGNED, RESOLVED, or IGNORED.

tagsarray
SubTypestring

GitGuardian tags

For example FROM_HISTORICAL_SCAN, PUBLICLY_EXPOSED, or TEST_FILE.

triggeredAtstring
Formatdate-time

Date the incident was first triggered

validitystring
Possible Values
VALIDINVALIDFAILED_TO_CHECKNO_CHECKERNOT_CHECKEDUNKNOWN

Validity of the secret

valid, invalid, failed_to_check, no_checker, or unknown.

vaultedboolean

Whether the secret is stored in a vault