deepfence / YaraHunter

🔍🔍 Malware scanner for cloud-native, as part of CI/CD and at Runtime 🔍🔍
https://deepfence.io/
Apache License 2.0
1.23k stars 155 forks source link

Docker :latest image is out of date. Building Yarahunter fails #66

Closed acc23 closed 9 months ago

acc23 commented 9 months ago

The image was last pushed 7 months ago: https://hub.docker.com/r/deepfenceio/yara-hunter

When trying to build the image either using the main branch or the recent release tagged v2.0.0 - the build fails:


[+] Building 14.6s (15/21)                                                                                                                                                                                             docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                                                                                                                                   0.0s
 => => transferring dockerfile: 2.45kB                                                                                                                                                                                                 0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                      0.0s
 => => transferring context: 2B                                                                                                                                                                                                        0.0s
 => [internal] load metadata for docker.io/library/debian:bullseye                                                                                                                                                                     2.1s
 => [internal] load metadata for docker.io/library/golang:1.20-alpine3.18                                                                                                                                                              2.1s
 => [builder 1/7] FROM docker.io/library/golang:1.20-alpine3.18@sha256:c63dbdb3cca37abbee4c50f61e34b1d043c2669d03f34485f9ee6fe5feed4e48                                                                                                0.0s
 => [stage-1 1/9] FROM docker.io/library/debian:bullseye@sha256:f33900927c0a8bcf3f0e2281fd0237f4780cc6bc59729bb3a10e75b0703c5ca7                                                                                                       0.0s
 => [internal] load build context                                                                                                                                                                                                      0.0s
 => => transferring context: 13.07kB                                                                                                                                                                                                   0.0s
 => CACHED [stage-1 2/9] RUN apt-get update && apt-get -qq -y --no-install-recommends install libjansson4 libssl1.1 libmagic1 libstdc++6 jq bash skopeo curl ca-certificates     && nerdctl_version=1.4.0     && curl -fsSLOk https:/  0.0s
 => CACHED [stage-1 3/9] WORKDIR /home/deepfence/usr                                                                                                                                                                                   0.0s
 => CACHED [builder 2/7] RUN apk add --no-cache     git     make      build-base     pkgconfig     libpcap-dev     libcap-dev     openssl-dev     file     jansson-dev     jansson-static     bison     tini     su-exec               0.0s
 => CACHED [builder 3/7] RUN apk add --no-cache -t .build-deps py-setuptools     openssl-libs-static     jansson-dev     build-base     libc-dev     file-dev     automake     autoconf     libtool     libcrypto3     flex     git    0.0s
 => CACHED [builder 4/7] RUN cd /root && wget https://github.com/VirusTotal/yara/archive/refs/tags/v4.3.2.tar.gz     && tar -zxf v4.3.2.tar.gz     && cd yara-4.3.2     && ./bootstrap.sh     && ./configure --prefix=/usr/local/yara  0.0s
 => CACHED [builder 5/7] WORKDIR /home/deepfence/src/YaraHunter                                                                                                                                                                        0.0s
 => CACHED [builder 6/7] COPY . .                                                                                                                                                                                                      0.0s
 => ERROR [builder 7/7] RUN make clean     && make all     && cd /home/deepfence     && git clone https://github.com/deepfence/yara-rules                                                                                             12.5s
------
 > [builder 7/7] RUN make clean     && make all     && cd /home/deepfence     && git clone https://github.com/deepfence/yara-rules:
0.133 rm ./YaraHunter
0.134 rm: can't remove './YaraHunter': No such file or directory
0.135 make: [Makefile:7: clean] Error 1 (ignored)
0.136 go mod tidy -v
0.164 go: downloading gopkg.in/yaml.v3 v3.0.1
0.173 go: downloading github.com/sirupsen/logrus v1.9.3
0.190 go: downloading github.com/deepfence/golang_deepfence_sdk/client v0.0.0-20230630084500-8fb0280d6010
0.373 go: downloading github.com/deepfence/golang_deepfence_sdk/utils v0.0.0-20230630084500-8fb0280d6010
0.407 go: downloading github.com/olekukonko/tablewriter v0.0.5
0.483 go: downloading github.com/fatih/color v1.15.0
0.499 go: downloading github.com/deepfence/vessel v0.11.1
0.528 go: downloading github.com/hillu/go-yara/v4 v4.3.2
0.539 go: downloading github.com/Jeffail/tunny v0.1.4
0.563 go: downloading google.golang.org/grpc v1.56.1
0.660 go: downloading golang.org/x/sys v0.7.0
2.594 go: downloading github.com/hashicorp/go-retryablehttp v0.7.4
2.595 go: downloading github.com/mattn/go-runewidth v0.0.9
2.644 go: downloading github.com/mattn/go-colorable v0.1.13
2.647 go: downloading github.com/mattn/go-isatty v0.0.17
2.648 go: downloading github.com/containerd/containerd v1.7.2
2.679 go: downloading github.com/docker/docker v24.0.2+incompatible
3.398 go: downloading github.com/pkg/errors v0.9.1
3.466 go: downloading golang.org/x/net v0.9.0
3.721 go: downloading github.com/golang/protobuf v1.5.3
3.984 go: downloading github.com/google/go-cmp v0.5.9
4.060 go: downloading github.com/hashicorp/go-cleanhttp v0.5.2
4.061 go: downloading github.com/containerd/ttrpc v1.2.2
4.086 go: downloading github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20221215162035-5330a85ea652
4.106 go: downloading github.com/containerd/fifo v1.1.0
4.115 go: downloading github.com/containerd/typeurl/v2 v2.1.1
4.135 go: downloading github.com/moby/sys/signal v0.7.0
4.142 go: downloading github.com/opencontainers/go-digest v1.0.0
4.147 go: downloading github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b
4.176 go: downloading github.com/opencontainers/runtime-spec v1.1.0-rc.1
4.211 go: downloading github.com/opencontainers/selinux v1.11.0
4.211 go: downloading golang.org/x/sync v0.1.0
4.211 go: downloading google.golang.org/protobuf v1.30.0
4.247 go: downloading github.com/containerd/continuity v0.4.1
4.256 go: downloading github.com/opencontainers/runc v1.1.5
4.505 go: downloading google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1
4.624 go: downloading github.com/Microsoft/hcsshim v0.10.0-rc.8
5.402 go: downloading github.com/moby/sys/sequential v0.5.0
5.555 go: downloading github.com/klauspost/compress v1.16.0
5.981 go: downloading github.com/Microsoft/go-winio v0.6.1
5.982 go: downloading github.com/moby/sys/mountinfo v0.6.2
6.035 go: downloading github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1
6.037 go: downloading github.com/moby/locker v1.0.1
6.038 go: downloading github.com/google/uuid v1.3.0
6.063 go: downloading go.opentelemetry.io/otel v1.14.0
6.199 go: downloading go.opentelemetry.io/otel/trace v1.14.0
6.203 go: downloading github.com/gogo/protobuf v1.3.2
6.228 go: downloading github.com/docker/go-connections v0.4.0
6.533 go: downloading github.com/docker/go-units v0.5.0
6.600 go: downloading github.com/docker/distribution v2.8.1+incompatible
6.724 go: downloading golang.org/x/text v0.9.0
8.390 go: downloading golang.org/x/tools v0.7.0
8.390 go: downloading github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c
8.390 go: downloading github.com/cyphar/filepath-securejoin v0.2.3
8.432 go: downloading github.com/go-logr/logr v1.2.3
8.432 go: downloading github.com/go-logr/stdr v1.2.2
8.825 go: downloading go.opencensus.io v0.24.0
8.892 go: downloading github.com/containerd/cgroups v1.1.0
8.966 go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
9.117 go: downloading golang.org/x/mod v0.9.0
12.22 github.com/deepfence/YaraHunter/pkg/output imports
12.22   github.com/deepfence/agent-plugins-grpc/srcgo: github.com/deepfence/agent-plugins-grpc@v0.0.0-00010101000000-000000000000 (replaced by ./agent-plugins-grpc): reading agent-plugins-grpc/go.mod: open /home/deepfence/src/YaraHunter/agent-plugins-grpc/go.mod: no such file or directory
12.22 github.com/deepfence/YaraHunter imports
12.22   github.com/sirupsen/logrus tested by
12.22   github.com/sirupsen/logrus.test imports
12.22   github.com/stretchr/testify/assert: github.com/deepfence/agent-plugins-grpc@v0.0.0-00010101000000-000000000000 (replaced by ./agent-plugins-grpc): reading agent-plugins-grpc/go.mod: open /home/deepfence/src/YaraHunter/agent-plugins-grpc/go.mod: no such file or directory
12.22 github.com/deepfence/YaraHunter imports
12.22   github.com/sirupsen/logrus tested by
12.22   github.com/sirupsen/logrus.test imports
12.22   github.com/stretchr/testify/require: github.com/deepfence/agent-plugins-grpc@v0.0.0-00010101000000-000000000000 (replaced by ./agent-plugins-grpc): reading agent-plugins-grpc/go.mod: open /home/deepfence/src/YaraHunter/agent-plugins-grpc/go.mod: no such file or directory
12.22 github.com/deepfence/YaraHunter/pkg/config imports
12.22   gopkg.in/yaml.v3 tested by
12.22   gopkg.in/yaml.v3.test imports
12.22   gopkg.in/check.v1: github.com/deepfence/agent-plugins-grpc@v0.0.0-00010101000000-000000000000 (replaced by ./agent-plugins-grpc): reading agent-plugins-grpc/go.mod: open /home/deepfence/src/YaraHunter/agent-plugins-grpc/go.mod: no such file or directory
12.22 github.com/deepfence/YaraHunter/pkg/output imports
12.22   github.com/deepfence/golang_deepfence_sdk/utils/http imports
12.22   github.com/hashicorp/go-retryablehttp tested by
12.22   github.com/hashicorp/go-retryablehttp.test imports
12.22   github.com/hashicorp/go-hclog: github.com/deepfence/agent-plugins-grpc@v0.0.0-00010101000000-000000000000 (replaced by ./agent-plugins-grpc): reading agent-plugins-grpc/go.mod: open /home/deepfence/src/YaraHunter/agent-plugins-grpc/go.mod: no such file or directory
12.22 github.com/deepfence/YaraHunter/pkg/scan imports
12.22   github.com/deepfence/vessel imports
12.22   github.com/docker/docker/client tested by
12.22   github.com/docker/docker/client.test imports
12.22   gotest.tools/v3/assert: github.com/deepfence/agent-plugins-grpc@v0.0.0-00010101000000-000000000000 (replaced by ./agent-plugins-grpc): reading agent-plugins-grpc/go.mod: open /home/deepfence/src/YaraHunter/agent-plugins-grpc/go.mod: no such file or directory
12.22 github.com/deepfence/YaraHunter/pkg/scan imports
12.22   github.com/deepfence/vessel imports
12.22   github.com/docker/docker/client tested by
12.22   github.com/docker/docker/client.test imports
12.22   gotest.tools/v3/assert/cmp: github.com/deepfence/agent-plugins-grpc@v0.0.0-00010101000000-000000000000 (replaced by ./agent-plugins-grpc): reading agent-plugins-grpc/go.mod: open /home/deepfence/src/YaraHunter/agent-plugins-grpc/go.mod: no such file or directory
12.22 github.com/deepfence/YaraHunter/pkg/scan imports
12.22   github.com/deepfence/vessel imports
12.22   github.com/docker/docker/client tested by
12.22   github.com/docker/docker/client.test imports
12.22   gotest.tools/v3/env: github.com/deepfence/agent-plugins-grpc@v0.0.0-00010101000000-000000000000 (replaced by ./agent-plugins-grpc): reading agent-plugins-grpc/go.mod: open /home/deepfence/src/YaraHunter/agent-plugins-grpc/go.mod: no such file or directory
12.22 github.com/deepfence/YaraHunter/pkg/scan imports
12.22   github.com/deepfence/vessel imports
12.22   github.com/docker/docker/client tested by
12.22   github.com/docker/docker/client.test imports
12.22   gotest.tools/v3/skip: github.com/deepfence/agent-plugins-grpc@v0.0.0-00010101000000-000000000000 (replaced by ./agent-plugins-grpc): reading agent-plugins-grpc/go.mod: open /home/deepfence/src/YaraHunter/agent-plugins-grpc/go.mod: no such file or directory
12.22 github.com/deepfence/YaraHunter/pkg/scan imports
12.22   github.com/deepfence/vessel imports
12.22   github.com/containerd/containerd/namespaces imports
12.22   github.com/containerd/ttrpc tested by
12.22   github.com/containerd/ttrpc.test imports
12.22   github.com/prometheus/procfs: github.com/deepfence/agent-plugins-grpc@v0.0.0-00010101000000-000000000000 (replaced by ./agent-plugins-grpc): reading agent-plugins-grpc/go.mod: open /home/deepfence/src/YaraHunter/agent-plugins-grpc/go.mod: no such file or directory
12.22 github.com/deepfence/YaraHunter/pkg/scan imports
12.22   github.com/deepfence/vessel imports
12.22   github.com/containerd/containerd imports
12.22   github.com/containerd/containerd/tracing imports
12.22   go.opentelemetry.io/otel tested by
12.22   go.opentelemetry.io/otel.test imports
12.22   github.com/stretchr/testify/suite: github.com/deepfence/agent-plugins-grpc@v0.0.0-00010101000000-000000000000 (replaced by ./agent-plugins-grpc): reading agent-plugins-grpc/go.mod: open /home/deepfence/src/YaraHunter/agent-plugins-grpc/go.mod: no such file or directory
12.22 github.com/deepfence/YaraHunter/pkg/scan imports
12.22   github.com/deepfence/vessel imports
12.22   github.com/docker/docker/client tested by
12.22   github.com/docker/docker/client.test imports
12.22   github.com/docker/docker/api/server/httputils imports
12.22   github.com/docker/docker/pkg/jsonmessage imports
12.22   github.com/moby/term: github.com/deepfence/agent-plugins-grpc@v0.0.0-00010101000000-000000000000 (replaced by ./agent-plugins-grpc): reading agent-plugins-grpc/go.mod: open /home/deepfence/src/YaraHunter/agent-plugins-grpc/go.mod: no such file or directory
12.22 github.com/deepfence/YaraHunter/pkg/scan imports
12.22   github.com/deepfence/vessel imports
12.22   github.com/docker/docker/client tested by
12.22   github.com/docker/docker/client.test imports
12.22   github.com/docker/docker/api/server/httputils imports
12.22   github.com/docker/docker/pkg/jsonmessage imports
12.22   github.com/morikuni/aec: github.com/deepfence/agent-plugins-grpc@v0.0.0-00010101000000-000000000000 (replaced by ./agent-plugins-grpc): reading agent-plugins-grpc/go.mod: open /home/deepfence/src/YaraHunter/agent-plugins-grpc/go.mod: no such file or directory
12.22 github.com/deepfence/YaraHunter/pkg/scan imports
12.22   github.com/deepfence/vessel imports
12.22   github.com/docker/docker/client tested by
12.22   github.com/docker/docker/client.test imports
12.22   github.com/docker/docker/api/server/httputils imports
12.22   github.com/docker/docker/api/types/backend imports
12.22   github.com/docker/docker/pkg/streamformatter imports
12.22   github.com/docker/docker/pkg/progress imports
12.22   golang.org/x/time/rate: github.com/deepfence/agent-plugins-grpc@v0.0.0-00010101000000-000000000000 (replaced by ./agent-plugins-grpc): reading agent-plugins-grpc/go.mod: open /home/deepfence/src/YaraHunter/agent-plugins-grpc/go.mod: no such file or directory
12.22 make: *** [Makefile:10: vendor] Error 1
------
Dockerfile:45
--------------------
  44 |     COPY . .
  45 | >>> RUN make clean \
  46 | >>>     && make all \
  47 | >>>     && cd /home/deepfence \
  48 | >>>     && git clone https://github.com/deepfence/yara-rules
  49 |
--------------------
ERROR: failed to solve: process "/bin/sh -c make clean     && make all     && cd /home/deepfence     && git clone https://github.com/deepfence/yara-rules" did not complete successfully: exit code: 2```
ramanan-ravi commented 9 months ago

Hello @acc23 , please build using these commands

make bootstrap
make docker
acc23 commented 9 months ago

@ramanan-ravi Thank you! That worked! Thanks for updating the docker hub image as well.