entrepot_scanner
A vulnerability scanner that repositories can use through their scan.scanners setting. trivy and grype run the CLI on the Entrepot server (Trivy optionally in client/server mode); webhook delegates scans to an external service that calls back with results.
A scanner cannot be deleted while a repository uses it: remove it from the repositories’ scan.scanners first (Terraform does this in the right order when the repository references the scanner resource).
Example Usage
Section titled “Example Usage”# Trivy in client/server mode (one shared vulnerability DB).resource "entrepot_scanner" "trivy" { name = "trivy" type = "trivy" rescan_interval_hours = 24 trivy = { server_url = "http://trivy.security.svc:4954" server_token = var.trivy_token timeout_seconds = 300 }}
# Grype with the server defaults.resource "entrepot_scanner" "grype" { name = "grype" type = "grype"}
# An external scanning service that calls back with results.resource "entrepot_scanner" "webhook" { name = "acme-scan" type = "webhook" webhook = { url = "https://scan.acme.example/entrepot" secret = var.scan_webhook_secret timeout_seconds = 1800 }}
variable "trivy_token" { type = string sensitive = true}
variable "scan_webhook_secret" { type = string sensitive = true}Schema
Section titled “Schema”Required
Section titled “Required”name(String) Scanner name. Changing it forces a new scanner.type(String)trivy,grypeorwebhook. Changing it forces a new scanner.
Optional
Section titled “Optional”enabled(Boolean) Disabled scanners are skipped. Defaulttrue.grype(Attributes) Settings fortype = "grype". May be omitted to use the defaults. (see below for nested schema)rescan_interval_hours(Number) Re-scan components periodically, every this many hours (0, the default, never re-scans).trivy(Attributes) Settings fortype = "trivy". May be omitted to use the defaults. (see below for nested schema)webhook(Attributes) Settings fortype = "webhook"(required for that type). (see below for nested schema)
Read-Only
Section titled “Read-Only”id(String) Same asname.
Nested Schema for grype
Section titled “Nested Schema for grype”Optional:
binary(String) Path to thegrypeCLI (server defaultgrype).extra_args(List of String) Extra command-line arguments passed to the scanner.timeout_seconds(Number) Scan timeout in seconds.
Nested Schema for trivy
Section titled “Nested Schema for trivy”Optional:
binary(String) Path to thetrivyCLI (server defaulttrivy).extra_args(List of String) Extra command-line arguments passed to the scanner.server_token(String, Sensitive) Token for the Trivy server. Write-only: never returned by the API, so changes made outside Terraform are not detected. Removing it from the configuration keeps the value stored on the server. The stored token is dropped whenserver_urlchanges.server_url(String) Trivy server for client/server mode, e.g.http://trivy:4954(recommended: keeps one vulnerability DB).timeout_seconds(Number) Scan timeout in seconds.
Nested Schema for webhook
Section titled “Nested Schema for webhook”Required:
url(String) Endpoint that receives scan requests (http or https).
Optional:
secret(String, Sensitive) HMAC-SHA256 key for theX-Entrepot-Signatureheader. Write-only: never returned by the API, so changes made outside Terraform are not detected. Removing it from the configuration keeps the value stored on the server.timeout_seconds(Number) Time allowed for the callback in seconds (server default 900).
Import
Section titled “Import”The terraform import command can be used, for example:
# Scanners are imported by name. Secrets (trivy.server_token, webhook.secret) are not imported.terraform import entrepot_scanner.trivy trivyResource documentation generated from the provider’s schema (docs/resources/scanner.md in terraform-provider-entrepot).