From 9b4133eb89fe1b863a42cb4c92f62494bf0f4362 Mon Sep 17 00:00:00 2001 From: Tom Date: Thu, 2 Sep 2021 22:23:29 -0500 Subject: [PATCH] moving to urandom --- Dockerfile | 1 + docker-compose.yaml | 2 +- handler/activeDefenseHandlers.go | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b5b3fd6..136f768 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,7 @@ FROM alpine:latest WORKDIR / COPY --from=build /helix-honeypot /helix-honeypot RUN addgroup -S helix && adduser -S helix -G helix +USER helix EXPOSE 8000 diff --git a/docker-compose.yaml b/docker-compose.yaml index 4e73daf..5a68639 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -7,7 +7,7 @@ services: - "8000:8000" entrypoint: [/helix-honeypot, -mode=ad] volumes: - - /dev/random:/dev/random + - /dev/urandom:/dev/urandom helix-honeypot: build: ./ ports: diff --git a/handler/activeDefenseHandlers.go b/handler/activeDefenseHandlers.go index 2eef1de..c766f29 100644 --- a/handler/activeDefenseHandlers.go +++ b/handler/activeDefenseHandlers.go @@ -4,8 +4,8 @@ import ( "github.com/labstack/echo/v4" "os" ) -// Literally streams /dev/random to the response since Kubectl has no input validation or timeouts lol +// Literally streams /dev/urandom to the response since Kubectl has no input validation or timeouts lol func ActiveDefenseHandler(c echo.Context) error { - devRandom, _ := os.Open("/dev/random") - return c.Stream(201, "application/json", devRandom) + devUrandom, _ := os.Open("/dev/urandom") + return c.Stream(201, "application/json", devUrandom) } \ No newline at end of file