{{tag>[trivy]}} ====== trivy ====== ===== CLI ===== trivy fs ./ --format template --template "@/usr/local/share/trivy/templates/html.tpl" -o report.html # 현재 경로 검색 trivy fs --format cyclonedx --scanners vuln --output sbom.json . # SBOM 작성 * ''**trivy** [global flags...] command [flags...] target'' * ''command'' * ''**image** IMAGE:TAG'' 컨테이너 이미지 스캔 * ''**fs** PATH'' 파일 시스템 스캔 * ''**config** PATH'' 설정 파일 스캔(Terraform, Helm, Dockerfile 등) * ''**repo** GITURL'' GIT 저장소 스캔 * ''**k8s** claster'' 클러스터 스캔 * ''[global flags...]'' * ''**--report** summary'' * ''**--format** cyclonedx **--output** FILENAME'' **SBOM 생성**(sbom.json) * ''**--format** template **--template** "@/usr/local/share/trivy/templates/html.tpl"'' html 템플릿 사용. (''/usr/local/share/trivy/templates/'' 기본 템플릿 경로) * ''**--scanners** vuln'' **스캐너 명시**(''vuln'' 취약점) * ''**--download-db-only**'' **DB 다운로드**(캐시 디렉토리 공유 ''~/.cache/trivy'' ) ==== HELP ==== ++++ trivy --help | Scanner for vulnerabilities in container images, file systems, and Git repositories, as well as for configuration issues and hard-coded secrets Usage: trivy [global flags] command [flags] target trivy [command] Examples: # Scan a container image $ trivy image python:3.4-alpine # Scan a container image from a tar archive $ trivy image --input ruby-3.1.tar # Scan local filesystem $ trivy fs . # Run in server mode $ trivy server Scanning Commands config Scan config files for misconfigurations filesystem Scan local filesystem image Scan a container image kubernetes [EXPERIMENTAL] Scan kubernetes cluster repository Scan a repository rootfs Scan rootfs sbom Scan SBOM for vulnerabilities and licenses vm [EXPERIMENTAL] Scan a virtual machine image Management Commands module Manage modules plugin Manage plugins vex [EXPERIMENTAL] VEX utilities Utility Commands clean Remove cached files completion Generate the autocompletion script for the specified shell convert Convert Trivy JSON report into a different format help Help about any command registry Manage registry authentication server Server mode version Print the version Flags: --cacert string Path to PEM-encoded CA certificate file --cache-dir string cache directory (default "/home/master/.cache/trivy") -c, --config string config path (default "trivy.yaml") -d, --debug debug mode -f, --format string version format (json) --generate-default-config write the default config to trivy-default.yaml -h, --help help for trivy --insecure allow insecure server connections -q, --quiet suppress progress bar and log output --timeout duration timeout (default 5m0s) -v, --version show version Use "trivy [command] --help" for more information about a command. ++++