Which tool can be used to generate an SBOM (Software Bill of Materials) for a container image?
Syft generates SBOMs from container images.
Why this answer
Syft is a CLI tool specifically designed to generate a Software Bill of Materials (SBOM) from container images and filesystems. It uses static analysis to catalog packages (e.g., APK, DEB, RPM, Python, Java) and outputs the SBOM in formats like SPDX or CycloneDX, which are industry standards for supply chain transparency. This makes it the correct choice for generating an SBOM from a container image in a CKS context.
Exam trap
CKS often tests the distinction between a dedicated SBOM generator (Syft) and a vulnerability scanner that can also produce SBOMs (Trivy), leading candidates to pick Trivy because they associate it with container security, but the question specifically asks for a tool 'to generate an SBOM', not to scan for vulnerabilities.
How to eliminate wrong answers
Option A is wrong because Trivy is primarily a vulnerability scanner that can also produce SBOMs as a secondary feature, but it is not the dedicated tool for SBOM generation; Syft is the purpose-built tool. Option B is wrong because Kubesec is a static analysis tool for Kubernetes resource manifests (e.g., PodSecurityPolicy checks), not for container image SBOM generation. Option C is wrong because Checkov is an infrastructure-as-code scanner for misconfigurations in Terraform, CloudFormation, and Kubernetes YAML, not a tool for extracting package metadata from container images.