aquasecurity / circleci-orb-microscanner

Enables scanning of docker builds in CircleCi for OS package vulnerabilities.
Apache License 2.0
13 stars 9 forks source link

using the orb #2

Open cpanato opened 5 years ago

cpanato commented 5 years ago

hello! thanks for this

I'm trying to use the Orb and followed the docs but i'm getting this error when the orb starts

The command '/bin/sh -c if [ ! -d /etc/ssl/certs/ ] || { [ ! -f /etc/ssl/certs/ca-certificates.crt ] && [ ! -f /etc/ssl/certs/ca-bundle.crt ]; }; then   PACKAGE_MANAGER=$(basename     $({ command -v apk apt yum false 2>/dev/null || which apk apt yum false; }     | head -n1));   if [ "${PACKAGE_MANAGER}" = "apk" ]; then     apk --update add ca-certificates;   elif [ "${PACKAGE_MANAGER}" = "apt" ]; then     apt update       && apt install --no-install-recommends -y ca-certificates       && update-ca-certificates;   elif [ "${PACKAGE_MANAGER}" = "yum" ]; then     yum install -y ca-certificates;   else     echo 'ca-certificates not found and package manager not apk, apt, or yum. Aborting' >&2;     exit 1;   fi; fi;' returned a non-zero code: 99
Exited with code 99

circleci job https://circleci.com/gh/mattermost/mattermost-operator/308

cpanato commented 5 years ago

running locally i got this

MICROSCANNER_TOKEN="xoxoxoxox" ./scan.sh mattermost/mattermost-operator:test
tr: Illegal byte sequence
Sending build context to Docker daemon  2.095kB
Step 1/5 : FROM mattermost/mattermost-operator:test
 ---> 00b75f7cdc3c
Step 2/5 : RUN if [ ! -d /etc/ssl/certs/ ] || { [ ! -f /etc/ssl/certs/ca-certificates.crt ] && [ ! -f /etc/ssl/certs/ca-bundle.crt ]; }; then   PACKAGE_MANAGER=$(basename     $({ command -v apk apt yum false 2>/dev/null || which apk apt yum false; }     | head -n1));   if [ "${PACKAGE_MANAGER}" = "apk" ]; then     apk --update add ca-certificates;   elif [ "${PACKAGE_MANAGER}" = "apt" ]; then     apt update       && apt install --no-install-recommends -y ca-certificates       && update-ca-certificates;   elif [ "${PACKAGE_MANAGER}" = "yum" ]; then     yum install -y ca-certificates;   else     echo 'ca-certificates not found and package manager not apk, apt, or yum. Aborting' >&2;     exit 1;   fi; fi;
 ---> Running in ce94f9cff335
ERROR: Unable to lock database: Permission denied
ERROR: Failed to open apk database: Permission denied
Removing intermediate container ce94f9cff335
The command '/bin/sh -c if [ ! -d /etc/ssl/certs/ ] || { [ ! -f /etc/ssl/certs/ca-certificates.crt ] && [ ! -f /etc/ssl/certs/ca-bundle.crt ]; }; then   PACKAGE_MANAGER=$(basename     $({ command -v apk apt yum false 2>/dev/null || which apk apt yum false; }     | head -n1));   if [ "${PACKAGE_MANAGER}" = "apk" ]; then     apk --update add ca-certificates;   elif [ "${PACKAGE_MANAGER}" = "apt" ]; then     apt update       && apt install --no-install-recommends -y ca-certificates       && update-ca-certificates;   elif [ "${PACKAGE_MANAGER}" = "yum" ]; then     yum install -y ca-certificates;   else     echo 'ca-certificates not found and package manager not apk, apt, or yum. Aborting' >&2;     exit 1;   fi; fi;' returned a non-zero code: 99
cpanato commented 5 years ago

adding manually the USER root works

cpanato commented 5 years ago

@jmichealson @lizrice can you help me here? any comments? thanks!

cpanato commented 5 years ago

@lizrice ping :) I spoke with you at kubecon Barcelona about this issue here, can you please take a look when have some time? thanks!