Courseiva
Supply Chain Security →easyMultiple Choice

CKS Supply Chain Security Practice Question

You want to scan a container image for vulnerabilities before deploying it. Which command uses the Trivy tool to scan an image?

⚠ Common exam trap

CNCF-CKS often tests the exact subcommand names for tools like Trivy, expecting candidates to know that `image` is the correct subcommand for scanning container images, not generic verbs like `check` or `scan`.

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 nginx:latest

Trivy uses the `image` subcommand to scan a container image for vulnerabilities. The correct syntax is `trivy image <image_name>`, which pulls the image (if not already present) and scans its OS packages and application dependencies against known vulnerability databases. Option B is correct because it follows this exact syntax.

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 check nginx:latest

    Why it's wrong here

    Trivy has no check subcommand, so this command errors rather than scanning anything. It is tempting because check suggests verification, but Trivy's image scanning is invoked with trivy image nginx:latest; check belongs to other tooling.

  • ✓

    trivy image nginx:latest

    Why this is correct

    The trivy image subcommand targets a container image reference, pulling and analysing its layers for known CVEs. Specifying nginx:latest scans that image directly, satisfying the requirement to check vulnerabilities before deployment without needing a running container or exported filesystem.

  • ✗

    trivy fs nginx:latest

    Why it's wrong here

    The fs subcommand scans a filesystem or directory path, so it cannot resolve an image reference such as nginx:latest. It is tempting because filesystem scanning is genuinely useful for source trees and unpacked layers, but image scanning requires the image subcommand.

  • ✗

    trivy scan nginx:latest

    Why it's wrong here

    Trivy has no scan subcommand; its CLI uses image, fs, repo and similar verbs, so this invocation fails. It is tempting because "scan" reads naturally as the action, but the correct syntax is trivy image nginx:latest.

Visual reference

Client Server SYN (seq=100) SYN-ACK (seq=200, ack=101) ACK (ack=201) Connection established — data transfer begins

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.