GitGuardian Secrets Scanning Scan

GitGuardian Secrets Scanning Scan

Certified

Scan content for secrets with GitGuardian

Sends inline content and/or files from Kestra's internal storage to the GitGuardian secrets detection engine and reports every policy break (detected secret) with its detector, validity and location. Uses POST /v1/scan for a single document and POST /v1/multiscan in batches of 20 documents otherwise. Each document must be at most 1 MB. Scanning is stateless: GitGuardian stores neither the content nor the secrets, and this task never outputs the matched secret strings, only their positions. Each request counts as one call against the workspace API quota, whatever the number of documents (up to 20). By default the task fails when at least one policy break is found, so a flow stops before leaking data downstream; set failOnPolicyBreak: false to inspect the outputs instead. Requires the scan scope.

yaml
type: io.kestra.plugin.gitguardian.scan.Scan

Fail the flow if a generated configuration file contains a secret

yaml
id: gitguardian_scan_config
namespace: company.security

tasks:
  - id: scan
    type: io.kestra.plugin.gitguardian.scan.Scan
    apiKey: "{{ secret('GITGUARDIAN_API_KEY') }}"
    filename: application.yml
    content: |
      database:
        url: jdbc:postgresql://db:5432/app
        password: "{{ secret('DB_PASSWORD') }}"

Scan files produced by previous tasks without failing, then alert on findings

yaml
id: gitguardian_scan_outputs
namespace: company.security

tasks:
  - id: export
    type: io.kestra.plugin.core.storage.Write
    content: "AWS_SECRET=example"
    extension: .env

  - id: scan
    type: io.kestra.plugin.gitguardian.scan.Scan
    apiKey: "{{ secret('GITGUARDIAN_API_KEY') }}"
    apiUrl: https://api.eu1.gitguardian.com
    files:
      - "{{ outputs.export.uri }}"
    failOnPolicyBreak: false

  - id: alert
    type: io.kestra.plugin.core.log.Log
    runIf: "{{ outputs.scan.policyBreakCount > 0 }}"
    message: "GitGuardian found {{ outputs.scan.policyBreakCount }} secret(s) in {{ outputs.scan.documentCount }} file(s)"
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.

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.

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

Inline content to scan

Scanned as one document named after filename. Use files to scan files from internal storage instead of, or in addition to, inline content.

Defaulttrue

Fail the task when at least one policy break is found

Defaults to true. When false, the task succeeds and downstream tasks decide what to do with policyBreakCount and results.

Defaultcontent

File name for the inline content

Helps GitGuardian detectors that rely on file context (for example .env or id_rsa). Defaults to content.

SubTypestring

Internal storage files to scan

List of kestra:// URIs, typically outputs of previous tasks. Each file is scanned as one document named after the last segment of its URI and must be at most 1 MB.

Number of documents scanned

Total number of policy breaks (secrets) found across all documents

Per-document scan results

Includes detector, validity and match positions. Never includes the matched secret strings.

Definitions
filenamestring

Name of the scanned document

Set by the task from the input filename or file name; GitGuardian does not echo it back.

policiesarray
SubTypestring

Policies checked

For example Secrets detection.

policyBreakCountinteger

Number of policy breaks in this document

policyBreaksarray

Policy breaks found in this document

incidentUrlstring

URL of the existing incident on the GitGuardian dashboard, when the secret is known

knownSecretboolean

Whether GitGuardian already knows this secret from a monitored source

matchesarray

Locations of the secret in the document

indexEndinteger

End index of the match in the document

indexStartinteger

Start index of the match in the document

lineEndinteger

End line of the match

lineStartinteger

Start line of the match

typestring

Kind of match

For example apikey, client_id, password, or host.

policystring

Policy that was broken

Currently always Secrets detection.

typestring

Detector that matched

For example AWS Keys or Generic High Entropy Secret.

validitystring
Possible Values
VALIDINVALIDFAILED_TO_CHECKNO_CHECKERNOT_CHECKEDUNKNOWN

Validity of the secret

valid, invalid, failed_to_check, no_checker, or unknown.

Number of documents scanned.

Number of policy breaks (secrets) found across all scanned documents.