Skip to content

Prisma Cloud Compute (Twistlock) Executor

Category: IaC, Containers and Kubernetes Script: prisma_cloud_compute.py Integration: REST API Faraday Plugin: Raw JSON Website: https://www.paloaltonetworks.com/prisma/cloud/cloud-workload-protection-platform

Description

Imports container image and host vulnerabilities from a Prisma Cloud Compute (formerly Twistlock) console into Faraday. Each scanned image and each scanned host becomes a Faraday host, with one [CNAPP] vulnerability per finding.

Prerequisites

  • A Prisma Cloud Compute console (Compute Edition or the Compute console of Prisma Cloud Enterprise) reachable from the agent
  • A console user with permission to read image and host scan results and the vulnerability list
  • Images and hosts already scanned by Prisma Cloud Compute

Configuration

Environment Variables (Setup)

Variable Required Description
TWISTLOCK_HOST Yes Base URL of the Compute console (e.g., https://twistlock.example.com:8083). If you omit the scheme, https:// is used.
TWISTLOCK_USER Yes Console user name
TWISTLOCK_PASSWORD Yes Console user password

These variables are also accepted as execution arguments, so a single run can override them.

Execution Arguments

Parameter Type Mandatory Description
TWISTLOCK_SCOPE string No What to import: images, hosts or both (default: both)
TWISTLOCK_MIN_SEVERITY string No Minimum severity to import: info, low, medium, high or critical (default: info)

YAML Configuration Example

executors:
  prisma_cloud_compute:
    repo_executor: prisma_cloud_compute.py
    max_size: 65536
    varenvs:
      TWISTLOCK_HOST: "https://twistlock.example.com:8083"
      TWISTLOCK_USER: "<twistlock_user>"
      TWISTLOCK_PASSWORD: "<twistlock_password>"
    params:
      TWISTLOCK_SCOPE:
        mandatory: false
        type: string
        base: string
      TWISTLOCK_MIN_SEVERITY:
        mandatory: false
        type: string
        base: string

How It Works

  1. Gets a token with POST /api/v22.01/authenticate and sends it as a Bearer token on the following requests
  2. Loads the vulnerability catalogue from GET /api/v22.01/vulnerabilities to add descriptions and scores where a finding lacks them
  3. Reads GET /api/v22.01/images and/or GET /api/v22.01/hosts according to TWISTLOCK_SCOPE, 50 records per page. Each record contains its vulnerabilities.
  4. Maps each vulnerability to a Faraday vulnerability:
    • Name: [CNAPP] followed by the CVE, the package and version, and the image or host
    • Severity: Twistlock's severity, or the CVSS score when the severity is missing
    • Status: closed when Twistlock reports a fix (fixed in ...) or a fix date, otherwise open
    • Details: CVEs, CVSS data and references
  5. Drops findings below TWISTLOCK_MIN_SEVERITY

Notes

  • Hosts use IP 0.0.0.0. Image hosts are named <registry>/<repo>:<tag>@<image id> and scanned hosts <hostname>@<id>.
  • Images and hosts without findings (after the severity filter) are not imported.
  • An unrecognized TWISTLOCK_SCOPE falls back to both, and an unrecognized TWISTLOCK_MIN_SEVERITY falls back to info.
  • TLS certificate verification is disabled for requests to the console.
  • The shared agent parameters (AGENT_CONFIG_* tags and severity filters) are not applied by this executor. Use TWISTLOCK_MIN_SEVERITY to filter by severity.