From 25d98cbce95fb2fe066fb61f1f5ad3b30e250cd6 Mon Sep 17 00:00:00 2001 From: t3chn0m4g3 Date: Thu, 28 Nov 2024 17:17:25 +0100 Subject: [PATCH] bump hellpot to latest master, hardening --- docker/hellpot/Dockerfile | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/docker/hellpot/Dockerfile b/docker/hellpot/Dockerfile index 880fb67b..e4798793 100644 --- a/docker/hellpot/Dockerfile +++ b/docker/hellpot/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21-alpine AS builder +FROM golang:1.23-alpine AS builder # # Include dist COPY dist/ /root/dist/ @@ -13,8 +13,7 @@ RUN apk --no-cache -U add \ cd /root && \ git clone https://github.com/yunginnanet/HellPot && \ cd HellPot && \ - git checkout 3673ab0228664fb3acd33102be5c7a5867137eb5 && \ - # git checkout 49433bf499b6af314786cbbc3cb8566cdb18c40c && \ + git checkout c48b70110148918255f93df4fa49c675ba5a5754 && \ sed -i 's#logFileName := "HellPot"#logFileName := "hellpot"#g' internal/config/logger.go && \ go mod download && \ go vet -v ./... && \ @@ -25,17 +24,12 @@ RUN apk --no-cache -U add \ -ldflags "-s -w -X main.version=$VERSION" \ cmd/HellPot/HellPot.go # -FROM alpine:3.19 +FROM scratch # COPY --from=builder /root/HellPot/HellPot /opt/hellpot/ COPY --from=builder /root/dist/config.toml /opt/hellpot/config/ # -# Setup user, groups and configs -RUN addgroup -g 2000 hellpot && \ - adduser -S -s /bin/ash -u 2000 -D -g 2000 hellpot && \ - mkdir -p /var/log/hellpot -# # Start hellpot WORKDIR /opt/hellpot -USER hellpot:hellpot +USER 2000:2000 CMD ["./HellPot", "-c","config/config.toml"]