diff --git a/Dockerfile b/Dockerfile index 80c5acb..517159d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ FROM docker.io/golang:alpine as build RUN apk --no-cache add ca-certificates curl # Download and install Grype -RUN curl -sSfL https://github.com/anchore/grype/releases/download/v0.73.0/grype_0.73.0_linux_amd64.tar.gz | tar -xz -C /usr/local/bin grype +RUN curl -sSfL https://github.com/anchore/grype/releases/download/v0.86.1/grype_0.86.1_linux_amd64.tar.gz | tar -xz -C /usr/local/bin grype # Verify installation RUN grype version diff --git a/task.sh b/task.sh index 36c2b96..03a441e 100644 --- a/task.sh +++ b/task.sh @@ -2,9 +2,5 @@ grype version -curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin - -grype version - grype ghcr.io/opengovern/steampipe-plugin-aws:v0.1.6 --scope all-layers -o cyclonedx-json grype nginx:latest --scope all-layers -o cyclonedx-json \ No newline at end of file diff --git a/worker/worker.go b/worker/worker.go index ece147b..0e61709 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -148,12 +148,13 @@ func (w *Worker) ProcessMessage(ctx context.Context, msg jetstream.Msg) (err err output, err := cmd.CombinedOutput() if err != nil { w.logger.Error("error running grype", zap.Error(err)) - cmd = exec.Command("./task.sh") + cmd = exec.Command("task.sh") output, err = cmd.CombinedOutput() if err != nil { w.logger.Error("error running grype script", zap.Error(err)) } } + w.logger.Info("output", zap.String("output", string(output))) response.Result = output response.RunID = request.RunID @@ -164,8 +165,5 @@ func (w *Worker) ProcessMessage(ctx context.Context, msg jetstream.Msg) (err err return err } - if _, err = w.jq.Produce(ctx, ResultTopicName, responseJson, fmt.Sprintf("task-%d", request.RunID)); err != nil { - w.logger.Error("failed to publish job in progress", zap.String("response", string(responseJson)), zap.Error(err)) - } return nil }