From b5c8ef13b2084f9c6a367c2f561a3b6bec01f158 Mon Sep 17 00:00:00 2001 From: Cameron Dunn Date: Mon, 17 Apr 2023 18:45:27 -0700 Subject: [PATCH] Use even simpler go.mod in repo root --- README.md | 6 +++--- build/go/fileshot/Dockerfile | 1 + build/go/filestream/Dockerfile | 1 + build/go/frontend/Dockerfile | 1 + build/go/manager/Dockerfile | 1 + build/go/oneshot/Dockerfile | 1 + src/go/go.mod => go.mod | 2 +- src/go/go.sum => go.sum | 0 8 files changed, 9 insertions(+), 4 deletions(-) rename src/go/go.mod => go.mod (93%) rename src/go/go.sum => go.sum (100%) diff --git a/README.md b/README.md index e3e036e2..6c3480bf 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ echo 'include "./rules/index.yar"' > configs/python/backend/yara/rules.yara ```bash docker-compose -f build/docker-compose-no-build.yaml up -d && \ -go build -C src/go github.com/target/strelka/src/go/cmd/strelka-oneshot +go build github.com/target/strelka/src/go/cmd/strelka-oneshot ``` #### Step 4b: Build and start Strelka @@ -67,7 +67,7 @@ go build -C src/go github.com/target/strelka/src/go/cmd/strelka-oneshot ```bash docker-compose -f build/docker-compose.yaml build && \ docker-compose -f build/docker-compose.yaml up -d && \ -go build -C src/go github.com/target/strelka/src/go/cmd/strelka-oneshot +go build github.com/target/strelka/src/go/cmd/strelka-oneshot ``` #### Step 5: Prepare a file to analyze @@ -81,7 +81,7 @@ wget https://github.com/ytisf/theZoo/raw/master/malware/Binaries/Win32.Emotet/Wi #### Step 6: Analyze the file with Strelka using the dockerized oneshot ```bash -./src/go/strelka-oneshot -f samples/Win32.Emotet.zip -l - | jq +./strelka-oneshot -f samples/Win32.Emotet.zip -l - | jq ``` #### What's happening here? diff --git a/build/go/fileshot/Dockerfile b/build/go/fileshot/Dockerfile index 352fcb46..7484173f 100644 --- a/build/go/fileshot/Dockerfile +++ b/build/go/fileshot/Dockerfile @@ -7,6 +7,7 @@ LABEL maintainer="Target Brands, Inc. TTS-CFC-OpenSource@target.com" # Copy source files and set the working directory COPY ./src/go/ /go/src/github.com/target/strelka/src/go/ WORKDIR /go/src/github.com/target/strelka/src/go/ +COPY go.* /go/src/github.com/target/strelka # Statically compile and output to tmp RUN go mod download && \ diff --git a/build/go/filestream/Dockerfile b/build/go/filestream/Dockerfile index c7e58925..751a2ce6 100644 --- a/build/go/filestream/Dockerfile +++ b/build/go/filestream/Dockerfile @@ -7,6 +7,7 @@ LABEL maintainer="Target Brands, Inc. TTS-CFC-OpenSource@target.com" # Copy source files and set the working directory COPY ./src/go/ /go/src/github.com/target/strelka/src/go/ WORKDIR /go/src/github.com/target/strelka/src/go/ +COPY go.* /go/src/github.com/target/strelka # Statically compile and output to tmp RUN go mod download && \ diff --git a/build/go/frontend/Dockerfile b/build/go/frontend/Dockerfile index ba3515b7..e0382ff6 100644 --- a/build/go/frontend/Dockerfile +++ b/build/go/frontend/Dockerfile @@ -7,6 +7,7 @@ LABEL maintainer="Target Brands, Inc. TTS-CFC-OpenSource@target.com" # Copy source files and set the working directory COPY ./src/go/ /go/src/github.com/target/strelka/src/go/ WORKDIR /go/src/github.com/target/strelka/src/go/ +COPY go.* /go/src/github.com/target/strelka # Statically compile and output to tmp RUN go mod download && \ diff --git a/build/go/manager/Dockerfile b/build/go/manager/Dockerfile index c6dcc115..d19cff3d 100644 --- a/build/go/manager/Dockerfile +++ b/build/go/manager/Dockerfile @@ -7,6 +7,7 @@ LABEL maintainer="Target Brands, Inc. TTS-CFC-OpenSource@target.com" # Copy source files and set the working directory COPY ./src/go/ /go/src/github.com/target/strelka/src/go/ WORKDIR /go/src/github.com/target/strelka/src/go/ +COPY go.* /go/src/github.com/target/strelka # Statically compile and output to /tmp RUN go mod download && \ diff --git a/build/go/oneshot/Dockerfile b/build/go/oneshot/Dockerfile index 58cc1c19..cd99b1c7 100644 --- a/build/go/oneshot/Dockerfile +++ b/build/go/oneshot/Dockerfile @@ -7,6 +7,7 @@ LABEL maintainer="Target Brands, Inc. TTS-CFC-OpenSource@target.com" # Copy source files and set the working directory COPY ./src/go/ /go/src/github.com/target/strelka/src/go/ WORKDIR /go/src/github.com/target/strelka/src/go/ +COPY go.* /go/src/github.com/target/strelka # Statically compile and output to tmp RUN go mod download && \ diff --git a/src/go/go.mod b/go.mod similarity index 93% rename from src/go/go.mod rename to go.mod index b347c6dd..be4d9384 100644 --- a/src/go/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/target/strelka/src/go +module github.com/target/strelka go 1.19 diff --git a/src/go/go.sum b/go.sum similarity index 100% rename from src/go/go.sum rename to go.sum