anchore / grype

A vulnerability scanner for container images and filesystems
Apache License 2.0
8.7k stars 569 forks source link

Add support for scanning single purl from the CLI #2225

Closed wagoodman closed 1 day ago

wagoodman commented 1 day ago

What would you like to be added: Today we support scanning a set of purls from a newline delimited file, but we don't support scanning a single purl from the CLI without the need to involve a file. A current workaround to this is:

cat pkg:apk/mypurl@1.2.3 | grype purl:/dev/stdin

But more ideally we should be able to support this with:

grype pkg:apk/mypurl@1.2.3

Why is this needed: This makes it really easy to scan one-off packages without the need to get docker or other files involved.