GitGuardian Secrets Scanning Scan
Certified
Scan content for secrets with GitGuardian
GitGuardian Secrets Scanning Scan
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.
type: io.kestra.plugin.gitguardian.scan.ScanExamples
Fail the flow if a generated configuration file contains a secret
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
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
apiKey *string
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.
apiUrl string
https://api.gitguardian.comGitGuardian 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
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.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset 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.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150content string
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.
failOnPolicyBreak booleanstring
trueFail 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.
filename string
contentFile name for the inline content
Helps GitGuardian detectors that rely on file context (for example .env or id_rsa). Defaults to content.
files array
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.
Outputs
documentCount integer
Number of documents scanned
policyBreakCount integer
Total number of policy breaks (secrets) found across all documents
results array
Per-document scan results
Includes detector, validity and match positions. Never includes the matched secret strings.
io.kestra.plugin.gitguardian.scan.ScanResult
Name of the scanned document
Set by the task from the input filename or file name; GitGuardian does not echo it back.
Policies checked
For example Secrets detection.
Number of policy breaks in this document
Policy breaks found in this document
io.kestra.plugin.gitguardian.scan.PolicyBreak
URL of the existing incident on the GitGuardian dashboard, when the secret is known
Whether GitGuardian already knows this secret from a monitored source
Locations of the secret in the document
io.kestra.plugin.gitguardian.scan.PolicyBreakMatch
End index of the match in the document
Start index of the match in the document
End line of the match
Start line of the match
Kind of match
For example apikey, client_id, password, or host.
Policy that was broken
Currently always Secrets detection.
Detector that matched
For example AWS Keys or Generic High Entropy Secret.
VALIDINVALIDFAILED_TO_CHECKNO_CHECKERNOT_CHECKEDUNKNOWNValidity of the secret
valid, invalid, failed_to_check, no_checker, or unknown.
Metrics
documents counter
Number of documents scanned.
policy.breaks counter
Number of policy breaks (secrets) found across all scanned documents.