Courseiva
Supply Chain Security →easyMultiple Choice

CKS Supply Chain Security Practice Question

Which command scans a Docker image for CVEs using Trivy?

⚠ Common exam trap

The CNCF exam often tests the exact subcommand syntax of security tools like Trivy, expecting candidates to know that `trivy image` is the correct command, not generic verbs like `scan` or `check`.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

trivy image myapp:latest

`trivy image` is the specific Trivy subcommand used to scan a container image for vulnerabilities (CVEs). Trivy does not have a `cve`, `check`, or `scan` subcommand; the correct syntax is `trivy image <image-name>`.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    trivy cve myapp:latest

    Why it's wrong here

    Trivy's subcommands are image, filesystem, repository and config; cve is not a valid subcommand, so the command errors. It is tempting because scanning for CVEs is the goal, but the correct syntax is trivy image myapp:latest, which scans the container image for vulnerabilities.

  • ✗

    trivy check myapp:latest

    Why it's wrong here

    Trivy's scan subcommand is `trivy image`, which pulls and analyses layers for CVEs; `check` is not a Trivy verb, so the command fails outright. It tempts because `check` reads like a validation step, and Trivy does offer config/IaC scanning, but image CVE scanning always uses `image`.

  • ✓

    trivy image myapp:latest

    Why this is correct

    The trivy image subcommand targets a container image reference directly, pulling and scanning its layers against vulnerability databases to report CVEs. Other Trivy subcommands scan filesystems, repositories, or configuration files, so only this form satisfies the image-scanning requirement.

  • ✗

    trivy scan myapp:latest

    Why it's wrong here

    Trivy has no scan subcommand; the correct form is trivy image myapp:latest. It is tempting because scan describes the intent, but Trivy expects the target type as the subcommand, so this invocation fails rather than producing a CVE report.

About these practice questions

This CKS question is part of Courseiva's 845-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CKS practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKS exam.