scan¶
Download an image from S3 and scan it for vulnerabilities using Trivy.
The reference must include an explicit tag. Both s3:// and local:// references are supported.
Flags¶
| Flag | Default | Description |
|---|---|---|
--severity |
all | Comma-separated severity levels to report: LOW, MEDIUM, HIGH, CRITICAL |
--format |
table |
Output format: table, json, sarif, cyclonedx |
--platform |
host | Platform to scan from a multi-arch image (e.g. linux/amd64) |
--install-trivy |
false | Install Trivy automatically without prompting |
Trivy auto-install¶
If Trivy is not found on PATH or in ~/.local/bin/, s3lo prompts you:
Press Enter or Y to install. The latest Trivy release is downloaded from GitHub for your OS and architecture.
In CI (non-TTY), the prompt is skipped — s3lo exits with an error and suggests --install-trivy:
Pass --install-trivy in CI to enable auto-install:
Examples¶
Basic scan (all severities):
Fail only on HIGH or CRITICAL:
JSON output (for CI pipeline integration):
SARIF output (for GitHub Security tab):
Scan a specific platform from a multi-arch image:
Output¶
Scanning s3://my-bucket/myapp:v1.0
downloading ⠸ 58.70 MB
myapp:v1.0 (debian 12.9)
========================
Total: 3 (MEDIUM: 2, HIGH: 1)
┌──────────────┬───────────────┬──────────┬───────────────────┬───────────────┬──────────────────────────┐
│ Library │ Vulnerability │ Severity │ Installed Version │ Fixed Version │ Title │
├──────────────┼───────────────┼──────────┼───────────────────┼───────────────┼──────────────────────────┤
│ libssl3 │ CVE-2024-0727 │ HIGH │ 3.0.11-1~deb12u2 │ 3.0.13-1 │ OpenSSL: denial of │
│ │ │ │ │ │ service in PKCS12 │
├──────────────┼───────────────┼──────────┼───────────────────┼───────────────┼──────────────────────────┤
│ libexpat1 │ CVE-2023-52425│ MEDIUM │ 2.5.0-1 │ 2.6.0-1 │ expat: parsing large │
│ │ │ │ │ │ tokens │
└──────────────┴───────────────┴──────────┴───────────────────┴───────────────┴──────────────────────────┘
{
"SchemaVersion": 2,
"ArtifactName": "/tmp/s3lo-scan-1234.tar",
"ArtifactType": "container_image",
"Results": [
{
"Target": "myapp:v1.0 (debian 12.9)",
"Class": "os-pkgs",
"Type": "debian",
"Vulnerabilities": [
{
"VulnerabilityID": "CVE-2024-0727",
"PkgName": "libssl3",
"Severity": "HIGH",
"InstalledVersion": "3.0.11-1~deb12u2",
"FixedVersion": "3.0.13-1",
"Title": "OpenSSL: denial of service in PKCS12"
}
]
}
]
}
Exit codes¶
| Code | Meaning |
|---|---|
0 |
No vulnerabilities at the requested severity level |
1 |
Vulnerabilities found (use in CI to fail the build) |