KICS Executor¶
Category: IaC, Containers and Kubernetes
Script: kics.py
Integration: CLI
Faraday Plugin: SarifPlugin
Website: https://kics.io/
Description¶
Runs a KICS scan on Infrastructure as Code files (Terraform, Kubernetes, Dockerfile, CloudFormation, Ansible, Helm and others) and imports the misconfigurations into Faraday. You can scan a local directory or clone a Git repository.
Prerequisites¶
kicsinstalled and available in the agent'sPATH(checked withkics version)git, if you scan a repository by URL- Read access to the IaC files, either as a local path or a Git repository
Configuration¶
Environment Variables (Setup)¶
| Variable | Required | Description |
|---|---|---|
GIT_USERNAME |
No | Username for cloning private repositories over HTTPS (default: oauth2) |
GIT_TOKEN |
No | Access token for cloning private repositories over HTTPS |
Execution Arguments¶
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
KICS_TARGET |
string | No* | Path to scan. When KICS_GIT_URL is set, it is a subpath inside the cloned repository (e.g., terraform/). |
KICS_TYPE |
list | No | Platforms to scan (e.g., ["Terraform", "Kubernetes", "Dockerfile"]). Default: all platforms. |
KICS_EXCLUDE_SEVERITIES |
list | No | Severities to skip (e.g., ["low", "info", "trace"]) |
KICS_GIT_URL |
url | No* | Git repository to clone and scan |
KICS_GIT_REF |
string | No | Branch or tag to clone (default: the repository's default branch) |
* You must set KICS_TARGET, KICS_GIT_URL, or both.
YAML Configuration Example¶
executors:
kics:
repo_executor: kics.py
max_size: 65536
varenvs:
GIT_USERNAME: "<git_username>"
GIT_TOKEN: "<git_token>"
params:
KICS_TARGET:
mandatory: false
type: string
base: string
KICS_TYPE:
mandatory: false
type: list
base: list
KICS_EXCLUDE_SEVERITIES:
mandatory: false
type: list
base: list
KICS_GIT_URL:
mandatory: false
type: url
base: string
KICS_GIT_REF:
mandatory: false
type: string
base: string
How It Works¶
- If
KICS_GIT_URLis set, makes a shallow clone of the repository (atKICS_GIT_REF, if given) into a temporary directory. For HTTPS URLs it authenticates withGIT_USERNAME/GIT_TOKEN. - Runs
kics scanon the target with SARIF output, applying the platform and severity filters - Parses the SARIF report with
SarifPluginand sends the results to Faraday - Deletes the temporary clone when the run ends
Notes¶
KICS_TARGETmust point inside the cloned repository; paths that escape it (e.g.,../) are rejected.- The token is hidden in the agent log if the clone fails.
- The run fails if KICS does not write a SARIF report.
- Supports the shared agent parameters (
AGENT_CONFIG_*tags and severity filters).