Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use syft JSON output as input #235

Closed
luhring opened this issue Feb 12, 2021 · 0 comments · Fixed by #241
Closed

Can't use syft JSON output as input #235

luhring opened this issue Feb 12, 2021 · 0 comments · Fixed by #241
Assignees
Labels
bug Something isn't working

Comments

@luhring
Copy link
Contributor

luhring commented Feb 12, 2021

I'm seeing a set of related error cases when trying to have Grype read Syft's JSON output as its input (in lieu of Grype invoking Syft to catalog an image or directory).

As an initial setup, from ~/Desktop, I ran syft -o json alpine:latest > ./alpine.json. This produced a 39KB JSON file that looked like what I'd expect.

Here are the cases I tried, all of which I'd expect to result in a successful vulnerability analysis from Grype:

A) Piping to STDIN:

$ cat ./alpine.json | grype
ERROR failed to catalog: unable to process input for scanning: ''

B) Specifying an absolute path:

$ grype sbom:/Users/dan/Desktop/alpine.json
ERROR failed to catalog: unable to process input for scanning: 'sbom:/Users/dan/Desktop/alpine.json'

C) Specifying a path with tilde for the home directory:

$ grype sbom:~/Desktop/alpine.json
ERROR failed to catalog: user hinted 'sbom:' but couldn't read SBOM file: open ~/Desktop/alpine.json: no such file or directory

D) Specifying a relative path explicitly from the current directory:

$ grype sbom:./alpine.json
ERROR failed to catalog: unable to process input for scanning: 'sbom:./alpine.json'

E) Specifying a relative path implicitly from the current directory:

$ grype sbom:alpine.json
ERROR failed to catalog: could not fetch image 'sbom:alpine.json': pull failed: Error response from daemon: pull access denied for sbom, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant