Skip to content

Commit

Permalink
Use a single go.mod in src/go
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-dunn-sublime committed Apr 18, 2023
1 parent ca42dba commit ffaa60d
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 394 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 github.com/target/strelka/src/go/cmd/strelka-oneshot
go build -C src/go github.com/target/strelka/src/go/cmd/strelka-oneshot
```

#### Step 4b: Build and start Strelka
Expand All @@ -67,7 +67,7 @@ go build 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 github.com/target/strelka/src/go/cmd/strelka-oneshot
go build -C src/go github.com/target/strelka/src/go/cmd/strelka-oneshot
```

#### Step 5: Prepare a file to analyze
Expand All @@ -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
./strelka-oneshot -f samples/Win32.Emotet.zip -l - | jq
./src/go/strelka-oneshot -f samples/Win32.Emotet.zip -l - | jq
```
#### What's happening here?
Expand Down
4 changes: 2 additions & 2 deletions build/go/fileshot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ LABEL maintainer="Target Brands, Inc. [email protected]"

# 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/cmd/strelka-fileshot
WORKDIR /go/src/github.com/target/strelka/src/go/

# Statically compile and output to tmp
RUN go mod download && \
CGO_ENABLED=0 go build -o /tmp/strelka-fileshot .
CGO_ENABLED=0 go build -o /tmp/strelka-fileshot cmd/strelka-fileshot/main.go

# Initialize runtime container
FROM alpine
Expand Down
4 changes: 2 additions & 2 deletions build/go/filestream/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ LABEL maintainer="Target Brands, Inc. [email protected]"

# 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/cmd/strelka-filestream
WORKDIR /go/src/github.com/target/strelka/src/go/

# Statically compile and output to tmp
RUN go mod download && \
CGO_ENABLED=0 go build -o /tmp/strelka-filestream .
CGO_ENABLED=0 go build -o /tmp/strelka-filestream cmd/strelka-filestream/main.go

# Initialize runtime container
FROM alpine
Expand Down
4 changes: 2 additions & 2 deletions build/go/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ LABEL maintainer="Target Brands, Inc. [email protected]"

# 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/cmd/strelka-frontend
WORKDIR /go/src/github.com/target/strelka/src/go/

# Statically compile and output to tmp
RUN go mod download && \
CGO_ENABLED=0 go build -o /tmp/strelka-frontend .
CGO_ENABLED=0 go build -o /tmp/strelka-frontend cmd/strelka-frontend/main.go

# Initialize runtime container
FROM alpine
Expand Down
4 changes: 2 additions & 2 deletions build/go/manager/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ LABEL maintainer="Target Brands, Inc. [email protected]"

# 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/cmd/strelka-manager
WORKDIR /go/src/github.com/target/strelka/src/go/

# Statically compile and output to /tmp
RUN go mod download && \
CGO_ENABLED=0 go build -o /tmp/strelka-manager .
CGO_ENABLED=0 go build -o /tmp/strelka-manager cmd/strelka-manager/main.go

# Initialize runtime container with non-root user
FROM alpine
Expand Down
4 changes: 2 additions & 2 deletions build/go/oneshot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ LABEL maintainer="Target Brands, Inc. [email protected]"

# 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/cmd/strelka-oneshot
WORKDIR /go/src/github.com/target/strelka/src/go/

# Statically compile and output to tmp
RUN go mod download && \
CGO_ENABLED=0 go build -o /tmp/strelka-oneshot .
CGO_ENABLED=0 go build -o /tmp/strelka-oneshot cmd/strelka-oneshot/main.go

# Initialize runtime container
FROM alpine
Expand Down
7 changes: 0 additions & 7 deletions go.work

This file was deleted.

19 changes: 0 additions & 19 deletions src/go/cmd/strelka-fileshot/go.mod

This file was deleted.

35 changes: 0 additions & 35 deletions src/go/cmd/strelka-fileshot/go.sum

This file was deleted.

18 changes: 0 additions & 18 deletions src/go/cmd/strelka-filestream/go.mod

This file was deleted.

84 changes: 0 additions & 84 deletions src/go/cmd/strelka-filestream/go.sum

This file was deleted.

21 changes: 0 additions & 21 deletions src/go/cmd/strelka-manager/go.mod

This file was deleted.

Loading

0 comments on commit ffaa60d

Please sign in to comment.