openshift / image-inspector

Apache License 2.0
34 stars 29 forks source link

Expose endpoint for json results or flag to write json results to filesystem #97

Closed markperdue closed 4 years ago

markperdue commented 6 years ago

Currently trying to replace atomic scan tool with something that can run better within openshift and this tool almost fits the bill completely.

Something that is missing is the ability to easily get at the data that is currently being pushed via the post-results-url flag. Could this data be exposed:

  1. via an endpoint such as /results when application/json is set as the content-type requested if --serve is passed as a parameter
  2. via writing to disk if a new flag is provided that would point to a directory in the filesystem

Use case flow:

  1. Jenkins pipeline that builds an s2i image within a Jenkins slave running on openshift and pushes the image to some externally available registry
  2. Jenkins pipeline then calls stage to scan the image via accessing the openshift's host docker socket and then saves json results to a directory where Jenkins can further process (iterate over results and identify vulnerabilities etc)

Maybe something along the lines of this mocked up command

docker run -ti --rm -p 8080:8080 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /home/my.username/config:/config \
  registry.access.redhat.com/openshift3/image-inspector:v3.8.36-5 --image=my-docker-image:tag \
  --scan-type=openscap \
  --username=my.username \
  --password-file=/config/psswd
  --json-results-dir=/results
openshift-bot commented 4 years ago

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot commented 4 years ago

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten /remove-lifecycle stale

openshift-bot commented 4 years ago

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen. Mark the issue as fresh by commenting /remove-lifecycle rotten. Exclude this issue from closing again by commenting /lifecycle frozen.

/close

openshift-ci-robot commented 4 years ago

@openshift-bot: Closing this issue.

In response to [this](https://github.com/openshift/image-inspector/issues/97#issuecomment-713070605): >Rotten issues close after 30d of inactivity. > >Reopen the issue by commenting `/reopen`. >Mark the issue as fresh by commenting `/remove-lifecycle rotten`. >Exclude this issue from closing again by commenting `/lifecycle frozen`. > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.