From 7813f41047f7fe5d37ed9aa0392529896f4f519d Mon Sep 17 00:00:00 2001 From: Sander Maijers <3374183+sanmai-NL@users.noreply.github.com> Date: Mon, 16 Aug 2021 16:19:30 +0200 Subject: [PATCH] Use unprivileged user by default (#1862) * Use unprivileged user by default * fix order Co-authored-by: Admiral Awkbar --- Dockerfile | 7 +++++++ Dockerfile-slim | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/Dockerfile b/Dockerfile index 9f597eaa..0456bed6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -458,6 +458,13 @@ COPY TEMPLATES /action/lib/.automation ################################################ RUN ACTIONS_RUNNER_DEBUG=true WRITE_LINTER_VERSIONS_FILE=true /action/lib/linter.sh +############ +# Set user # +############ +RUN addgroup -g 1000 superlinter && \ + adduser -u 1000 -D -G superlinter superlinter +USER superlinter + ###################### # Set the entrypoint # ###################### diff --git a/Dockerfile-slim b/Dockerfile-slim index bd0484f3..62768aff 100644 --- a/Dockerfile-slim +++ b/Dockerfile-slim @@ -393,6 +393,13 @@ COPY TEMPLATES /action/lib/.automation ################################################ RUN ACTIONS_RUNNER_DEBUG=true WRITE_LINTER_VERSIONS_FILE=true IMAGE=slim /action/lib/linter.sh +############ +# Set user # +############ +RUN addgroup -g 1000 superlinter && \ + adduser -u 1000 -D -G superlinter superlinter +USER superlinter + ###################### # Set the entrypoint # ######################