Skip to content

Commit

Permalink
for podman, make sure initial USER is 'root' in docker containers so …
Browse files Browse the repository at this point in the history
…privilege dropping afterwards works consistently, idaholab#407
  • Loading branch information
mmguero committed Sep 11, 2024
1 parent 4505774 commit cfd629a
Show file tree
Hide file tree
Showing 20 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfiles/api.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ ENV DEFAULT_GID $DEFAULT_GID
ENV PUSER "yeflask"
ENV PGROUP "yeflask"
ENV PUSER_PRIV_DROP true
USER root

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/arkime.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ ENV PGROUP "arkime"
# a final check in docker_entrypoint.sh before startup
ENV PUSER_PRIV_DROP false
ENV PUSER_RLIMIT_UNLOCK true
USER root

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/dashboards-helper.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ENV PGROUP "helper"
# other implications. See containers/podman#23347.
ENV PUSER_CHOWN "/data/init"
ENV PUSER_PRIV_DROP true
USER root

ENV TERM xterm

Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/dashboards.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ ENV DEFAULT_GID $DEFAULT_GID
ENV PUSER "opensearch-dashboards"
ENV PGROUP "opensearch-dashboards"
ENV PUSER_PRIV_DROP true
USER root

ENV TERM xterm

Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/dirinit.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ENV DEFAULT_GID $DEFAULT_GID
ENV PUSER "dirinit"
ENV PGROUP "dirinit"
ENV PUSER_PRIV_DROP true
USER root

ENV TERM xterm

Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/file-monitor.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ENV PUSER "monitor"
ENV PGROUP "monitor"
ENV PUSER_PRIV_DROP true
# see PUSER_CHOWN at the bottom of the file (after the other environment variables it references)
USER root

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/file-upload.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ ENV PUSER_CHOWN "/var/www/upload/server/php/chroot/files"
# be handled by supervisord instead on an as-needed basis, and/or php-fpm/nginx itself
# will drop privileges to www-data as well.
ENV PUSER_PRIV_DROP false
USER root

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/filebeat.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ENV PUSER_CHOWN "/usr/share/filebeat-logs/data;/usr/share/filebeat-nginx/data;/u
# on a case-by-case basis so that one script (filebeat-watch-zeeklogs-uploads-folder.py)
# can chown uploaded files
ENV PUSER_PRIV_DROP false
USER root

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/freq.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ENV DEFAULT_GID $DEFAULT_GID
ENV PUSER "freq"
ENV PGROUP "freq"
ENV PUSER_PRIV_DROP true
USER root

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/htadmin.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ENV PGROUP "www-data"
# not dropping privileges globally so nginx can bind privileged ports internally.
# nginx and php-fpm will drop privileges to "www-data" user for worker processes
ENV PUSER_PRIV_DROP false
USER root

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/logstash.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ENV PUSER_RLIMIT_UNLOCK true
# This is to override that, although I'm not yet sure if there are
# other implications. See containers/podman#23347.
ENV PUSER_CHOWN "/logstash-persistent-queue"
USER root

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/netbox.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ENV DEFAULT_GID $DEFAULT_GID
ENV PUSER "ubuntu"
ENV PGROUP "ubuntu"
ENV PUSER_PRIV_DROP true
USER root

ENV SUPERCRONIC_VERSION "0.2.31"
ENV SUPERCRONIC_URL "https://github.com/aptible/supercronic/releases/download/v$SUPERCRONIC_VERSION/supercronic-linux-"
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/nginx.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ ENV PGROUP "nginx"
# not dropping privileges globally so nginx and stunnel can bind privileged ports internally.
# nginx itself will drop privileges to "nginx" user for worker processes
ENV PUSER_PRIV_DROP false
USER root

ENV TERM xterm

Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/opensearch.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ ENV PUSER_RLIMIT_UNLOCK true
# This is to override that, although I'm not yet sure if there are
# other implications. See containers/podman#23347.
ENV PUSER_CHOWN "/var/local/ca-trust"
USER root

ENV TERM xterm

Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/pcap-capture.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ENV PGROUP "pcap"
# a final check in supervisor.sh before startup
ENV PUSER_PRIV_DROP false
ENV PUSER_RLIMIT_UNLOCK true
USER root

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/pcap-monitor.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ENV PGROUP "watcher"
# on a case-by-case basis so that one script (watch-pcap-uploads-folder.sh)
# can chown uploaded files
ENV PUSER_PRIV_DROP false
USER root

ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm
Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/postgresql.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ENV PUSER "postgres"
ENV PGROUP "postgres"
ENV PUSER_PRIV_DROP true
ENV PUSER_CHOWN "/run/postgresql;/var/lib/postgresql"
USER root

ENV TERM xterm

Expand Down
1 change: 1 addition & 0 deletions Dockerfiles/redis.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ENV DEFAULT_GID $DEFAULT_GID
ENV PUSER "redis"
ENV PGROUP "redis"
ENV PUSER_PRIV_DROP true
USER root

ENV TERM xterm

Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/suricata.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ENV PGROUP "suricata"
ENV PUSER_PRIV_DROP false
ENV PUSER_RLIMIT_UNLOCK true
# see PUSER_CHOWN at the bottom of the file (after the other environment variables it references)
USER root

ENV SUPERCRONIC_VERSION "0.2.31"
ENV SUPERCRONIC_URL "https://github.com/aptible/supercronic/releases/download/v$SUPERCRONIC_VERSION/supercronic-linux-"
Expand Down Expand Up @@ -210,7 +211,6 @@ ENTRYPOINT ["/usr/bin/tini", \

CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf", "-n"]


# to be populated at build-time:
ARG BUILD_DATE
ARG MALCOLM_VERSION
Expand Down
2 changes: 2 additions & 0 deletions Dockerfiles/zeek.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ ENV PGROUP "zeeker"
# docker-uid-gid-setup.sh will cause them to be lost, so we need
# a final check in docker_entrypoint.sh before startup
ENV PUSER_PRIV_DROP false
USER root
# see PUSER_CHOWN at the bottom of the file (after the other environment variables it references)

# for download and install
Expand Down Expand Up @@ -300,6 +301,7 @@ ENTRYPOINT ["/usr/bin/tini", \

CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf", "-n"]

USER root

# to be populated at build-time:
ARG BUILD_DATE
Expand Down

0 comments on commit cfd629a

Please sign in to comment.