Skip to content
This repository has been archived by the owner on Apr 28, 2021. It is now read-only.

Build continues if microscanner not passed a token #5

Open
lizrice opened this issue Jun 7, 2018 · 0 comments
Open

Build continues if microscanner not passed a token #5

lizrice opened this issue Jun 7, 2018 · 0 comments

Comments

@lizrice
Copy link
Contributor

lizrice commented Jun 7, 2018

If microscanner is in a Dockerfile, the build should fail if the scan fails to run. Presumably it's returning zero in the case, as here, where the token wasn't passed in.

vagrant@vagrant:/microscanner$ docker build -f Dockerfile.fail .
Sending build context to Docker daemon  38.19MB
Step 1/7 : FROM alpine:3.4
...
Step 6/7 : RUN /microscanner ${token}
 ---> Running in 4d7f576ceb3b
   ___                 ____          __  ____              ____
  / _ |___ ___ _____ _/ __/__ ____  /  |/  (_)__________  / __/______ ____  ___  ___ ____
 / __ / _ `/ // / _ `/\ \/ -_) __/ / /|_/ / / __/ __/ _ \_\ \/ __/ _ `/ _ \/ _ \/ -_) __/
/_/ |_\_, /\_,_/\_,_/___/\__/\__/ /_/  /_/_/\__/_/  \___/___/\__/\_,_/_//_/_//_/\__/_/
       /_/
Aqua Security MicroScanner, version 3.2.0.5
Community Edition

Usage:  docker run --rm -it aquasec/microscanner <token>
   or:  docker run --rm -it aquasec/microscanner register <email>

Flags:
  -c, --continue-on-failure   return with exit code 0 even if high-severity vulnerabilities are found
  -h, --help                  help for microscanner
  -H, --html                  provide output in HTML format
  -n, --no-verify             Do not verify TLS certificates
  -d, --root string           start scanning from a different root directory
      --version               version for microscanner

ERROR:  accepts 1 arg(s), received 0
Removing intermediate container 4d7f576ceb3b
 ---> c256188fd058
Step 7/7 : RUN echo "No vulnerabilities!"
 ---> Running in 6c37ffa9a8e4
No vulnerabilities!
Removing intermediate container 6c37ffa9a8e4
 ---> 9d7450aadb86
Successfully built 9d7450aadb86

From Dockerfile:

FROM alpine:3.4
RUN apk add --update openssl ca-certificates
COPY microscanner /microscanner
RUN chmod +x /microscanner
ARG token
RUN /microscanner ${token}
RUN echo "No vulnerabilities!"

Hit the issue by building without passing in the token: docker build -f .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant