Skip to content

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).

# 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
}
  • name (String) Scanner name. Changing it forces a new scanner.
  • type (String) trivy, grype or webhook. Changing it forces a new scanner.
  • enabled (Boolean) Disabled scanners are skipped. Default true.
  • grype (Attributes) Settings for type = "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 for type = "trivy". May be omitted to use the defaults. (see below for nested schema)
  • webhook (Attributes) Settings for type = "webhook" (required for that type). (see below for nested schema)
  • id (String) Same as name.

Optional:

  • binary (String) Path to the grype CLI (server default grype).
  • extra_args (List of String) Extra command-line arguments passed to the scanner.
  • timeout_seconds (Number) Scan timeout in seconds.

Optional:

  • binary (String) Path to the trivy CLI (server default trivy).
  • 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 when server_url changes.
  • 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.

Required:

  • url (String) Endpoint that receives scan requests (http or https).

Optional:

  • secret (String, Sensitive) HMAC-SHA256 key for the X-Entrepot-Signature header. 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).

The terraform import command can be used, for example:

Terminal window
# Scanners are imported by name. Secrets (trivy.server_token, webhook.secret) are not imported.
terraform import entrepot_scanner.trivy trivy

Resource documentation generated from the provider’s schema (docs/resources/scanner.md in terraform-provider-entrepot).