Skip to content

Commit 6e1b1ed

Browse files
committed
standardization and fixes for named volumes
1 parent 06fd1a6 commit 6e1b1ed

File tree

7 files changed

+102
-13
lines changed

7 files changed

+102
-13
lines changed

Dockerfiles/filebeat.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ENV PGROUP="filebeat"
2121
# in the Dockerfile is getting set with an ownership of 999:999.
2222
# This is to override that, although I'm not yet sure if there are
2323
# other implications. See containers/podman#23347.
24-
ENV PUSER_CHOWN="/usr/share/filebeat-logs/data;/usr/share/filebeat-nginx/data;/usr/share/filebeat-tcp/data"
24+
ENV PUSER_CHOWN="/usr/share/filebeat-logs/data;/usr/share/filebeat-nginx/data;/usr/share/filebeat-syslog-tcp/data;/usr/share/filebeat-syslog-udp/data;/usr/share/filebeat-tcp/data;/usr/share/filebeat-zeek-files-logs/data"
2525
# not dropping privileges globally: supervisord will take care of it
2626
# on a case-by-case basis so that one script (filebeat-watch-zeeklogs-uploads-folder.py)
2727
# can chown uploaded files
@@ -198,7 +198,7 @@ ENV FILEBEAT_ZEEK_UPLOAD_SUBDIR="upload"
198198
ENV PCAP_NODE_NAME=$PCAP_NODE_NAME
199199

200200
# see PUSER_CHOWN comment above
201-
VOLUME ["/usr/share/filebeat-logs/data", "/usr/share/filebeat-nginx/data", "/usr/share/filebeat-tcp/data"]
201+
VOLUME ["/usr/share/filebeat-logs/data", "/usr/share/filebeat-nginx/data", "/usr/share/filebeat-syslog-tcp/data", "/usr/share/filebeat-syslog-udp/data", "/usr/share/filebeat-tcp/data", "/usr/share/filebeat-zeek-files-logs/data"]
202202

203203
ENTRYPOINT ["/usr/bin/tini", \
204204
"--", \

Dockerfiles/filescan.Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ ENV DEFAULT_UID=$DEFAULT_UID
1919
ENV DEFAULT_GID=$DEFAULT_GID
2020
ENV PUSER="scan"
2121
ENV PGROUP="scan"
22+
# This is to handle an issue when running with rootless podman and
23+
# "userns_mode: keep-id". It seems that anything defined as a VOLUME
24+
# in the Dockerfile is getting set with an ownership of 999:999.
25+
# This is to override that, although I'm not yet sure if there are
26+
# other implications. See containers/podman#23347.
27+
ENV PUSER_CHOWN="/filescan/data"
2228
ENV PUSER_PRIV_DROP=true
2329
ENV PUSER_RLIMIT_UNLOCK=true
2430
USER root
@@ -159,6 +165,7 @@ ADD --chmod=644 shared/bin/watch_common.py /usr/local/bin/
159165

160166
################################################################################
161167

168+
# see PUSER_CHOWN comment above
162169
VOLUME ["/filescan/data"]
163170

164171
EXPOSE $FILESCAN_HTTP_SERVER_PORT

Dockerfiles/logstash.Dockerfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,14 @@ ENV DEFAULT_UID=$DEFAULT_UID
3333
ENV DEFAULT_GID=$DEFAULT_GID
3434
ENV PUSER="logstash"
3535
ENV PGROUP="logstash"
36+
# This is to handle an issue when running with rootless podman and
37+
# "userns_mode: keep-id". It seems that anything defined as a VOLUME
38+
# in the Dockerfile is getting set with an ownership of 999:999.
39+
# This is to override that, although I'm not yet sure if there are
40+
# other implications. See containers/podman#23347.
41+
ENV PUSER_CHOWN="/logstash-persistent-queue"
3642
ENV PUSER_PRIV_DROP=true
3743
ENV PUSER_RLIMIT_UNLOCK=true
38-
ENV PUSER_CHOWN="/logstash-persistent-queue"
3944
USER root
4045

4146
ENV TERM=xterm
@@ -127,6 +132,8 @@ ENV LOGSTASH_OPENSEARCH_PIPELINE_ADDRESS_EXTERNAL=$LOGSTASH_OPENSEARCH_PIPELINE_
127132
ENV LOGSTASH_OPENSEARCH_OUTPUT_PIPELINE_ADDRESSES=$LOGSTASH_OPENSEARCH_OUTPUT_PIPELINE_ADDRESSES
128133

129134
ENV LOGSTASH_KEYSTORE_PASS="a410a267b1404c949284dee25518a917"
135+
136+
# see PUSER_CHOWN comment above
130137
VOLUME ["/logstash-persistent-queue"]
131138

132139
EXPOSE 5044 9001 9600

Dockerfiles/strelka-backend.Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ ENV YARA_COMPILED_RULES_FILE="rules.compiled"
4141
ARG EXTRACTED_FILE_MAX_BYTES=134217728
4242
ENV EXTRACTED_FILE_MAX_BYTES=$EXTRACTED_FILE_MAX_BYTES
4343
ENV CLAMD_SOCKET_FILE=/tmp/clamd.ctl
44-
ENV CLAMAV_RULES_DIR "/var/lib/clamav"
44+
ENV CLAMAV_RULES_DIR="/var/lib/clamav"
4545

4646
ARG STRELKA_BACKEND_PROCS=1
4747
ENV STRELKA_BACKEND_PROCS=$STRELKA_BACKEND_PROCS
@@ -110,9 +110,7 @@ ADD --chmod=755 container-health-scripts/strelka-backend.sh /usr/local/bin/conta
110110
ENV PUSER_CHOWN="$CLAMAV_RULES_DIR;$YARA_RULES_DIR;$YARA_RULES_SRC_DIR"
111111

112112
# see PUSER_CHOWN comment above
113-
VOLUME ["$CLAMAV_RULES_DIR"]
114-
VOLUME ["$YARA_RULES_DIR"]
115-
VOLUME ["$YARA_RULES_SRC_DIR"]
113+
VOLUME ["$CLAMAV_RULES_DIR", "$YARA_RULES_DIR", "$YARA_RULES_SRC_DIR"]
116114

117115
ENTRYPOINT ["/usr/bin/tini", \
118116
"--", \

Dockerfiles/strelka-frontend.Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ ADD --chmod=755 container-health-scripts/strelka-frontend.sh /usr/local/bin/cont
4242

4343
EXPOSE 57314
4444

45+
# This is to handle an issue when running with rootless podman and
46+
# "userns_mode: keep-id". It seems that anything defined as a VOLUME
47+
# in the Dockerfile is getting set with an ownership of 999:999.
48+
# This is to override that, although I'm not yet sure if there are
49+
# other implications. See containers/podman#23347.
50+
ENV PUSER_CHOWN="/var/log/strelka"
51+
4552
VOLUME [ "/var/log/strelka" ]
4653

4754
ENTRYPOINT ["/sbin/tini", \

docker-compose-dev.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ services:
106106
depends_on:
107107
- opensearch
108108
volumes:
109+
- dashboards-helper-data-init:/data/init
109110
- type: bind
110111
bind:
111112
create_host_path: false
@@ -218,6 +219,7 @@ services:
218219
ports:
219220
- 127.0.0.1:5044:5044
220221
volumes:
222+
- logstash-persistent-queue:/logstash-persistent-queue
221223
- type: bind
222224
bind:
223225
create_host_path: false
@@ -323,6 +325,12 @@ services:
323325
- 127.0.0.1:5045:5045
324326
volumes:
325327
- nginx-log-path:/nginx:ro
328+
- filebeat-logs-registry:/usr/share/filebeat-logs/data
329+
- filebeat-nginx-registry:/usr/share/filebeat-nginx/data
330+
- filebeat-syslog-tcp-registry:/usr/share/filebeat-syslog-tcp/data
331+
- filebeat-syslog-udp-registry:/usr/share/filebeat-syslog-udp/data
332+
- filebeat-tcp-registry:/usr/share/filebeat-tcp/data
333+
- filebeat-zeek-files-logs-registry:/usr/share/filebeat-zeek-files-logs/data
326334
- type: bind
327335
bind:
328336
create_host_path: false
@@ -723,6 +731,9 @@ services:
723731
- ./config/suricata.env
724732
- ./config/suricata-offline.env
725733
volumes:
734+
- suricata-config:/etc/suricata
735+
- suricata-managed:/var/lib/suricata
736+
- suricata-run:/var/run/suricata
726737
- type: bind
727738
bind:
728739
create_host_path: false
@@ -791,6 +802,9 @@ services:
791802
- ./config/suricata.env
792803
- ./config/suricata-live.env
793804
volumes:
805+
- suricata-live-config:/etc/suricata
806+
- suricata-live-managed:/var/lib/suricata
807+
- suricata-live-run:/var/run/suricata
794808
- type: bind
795809
bind:
796810
create_host_path: false
@@ -849,6 +863,7 @@ services:
849863
- ./config/filescan-secret.env
850864
- ./config/filescan.env
851865
volumes:
866+
- filescan-data:/filescan/data
852867
- type: bind
853868
bind:
854869
create_host_path: false
@@ -904,6 +919,9 @@ services:
904919
- ./config/pipeline.env
905920
shm_size: 512mb
906921
volumes:
922+
- strelka-backend-clamav-rules:/var/lib/clamav
923+
- strelka-backend-yara-rules-src:/yara-rules-src
924+
- strelka-backend-yara-rules:/yara-rules
907925
- type: bind
908926
bind:
909927
create_host_path: false
@@ -954,6 +972,7 @@ services:
954972
- ./config/redis.env
955973
- ./config/pipeline.env
956974
volumes:
975+
- strelka-frontend-logs:/var/log/strelka
957976
- type: bind
958977
bind:
959978
create_host_path: false
@@ -966,7 +985,6 @@ services:
966985
source: ./strelka/config/frontend/
967986
target: /etc/strelka/configmap
968987
read_only: true
969-
- strelka-logs:/var/log/strelka/
970988
healthcheck:
971989
test: ["CMD", "/usr/local/bin/container_health.sh"]
972990
interval: 30s
@@ -1611,9 +1629,26 @@ services:
16111629
traefik.enable: false
16121630

16131631
volumes:
1614-
# shared named volume so filebeat can access nginx access logs
1632+
dashboards-helper-data-init:
1633+
filebeat-logs-registry:
1634+
filebeat-nginx-registry:
1635+
filebeat-syslog-tcp-registry:
1636+
filebeat-syslog-udp-registry:
1637+
filebeat-tcp-registry:
1638+
filebeat-zeek-files-logs-registry:
1639+
filescan-data:
1640+
logstash-persistent-queue:
16151641
nginx-log-path:
1616-
strelka-logs:
1642+
strelka-backend-clamav-rules:
1643+
strelka-backend-yara-rules-src:
1644+
strelka-backend-yara-rules:
1645+
strelka-frontend-logs:
1646+
suricata-config:
1647+
suricata-live-config:
1648+
suricata-live-managed:
1649+
suricata-live-run:
1650+
suricata-managed:
1651+
suricata-run:
16171652

16181653
networks:
16191654
default:

docker-compose.yml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ services:
100100
depends_on:
101101
- opensearch
102102
volumes:
103+
- dashboards-helper-data-init:/data/init
103104
- type: bind
104105
bind:
105106
create_host_path: false
@@ -206,6 +207,7 @@ services:
206207
ports:
207208
- 127.0.0.1:5044:5044
208209
volumes:
210+
- logstash-persistent-queue:/logstash-persistent-queue
209211
- type: bind
210212
bind:
211213
create_host_path: false
@@ -284,6 +286,12 @@ services:
284286
- 127.0.0.1:5045:5045
285287
volumes:
286288
- nginx-log-path:/nginx:ro
289+
- filebeat-logs-registry:/usr/share/filebeat-logs/data
290+
- filebeat-nginx-registry:/usr/share/filebeat-nginx/data
291+
- filebeat-syslog-tcp-registry:/usr/share/filebeat-syslog-tcp/data
292+
- filebeat-syslog-udp-registry:/usr/share/filebeat-syslog-udp/data
293+
- filebeat-tcp-registry:/usr/share/filebeat-tcp/data
294+
- filebeat-zeek-files-logs-registry:/usr/share/filebeat-zeek-files-logs/data
287295
- type: bind
288296
bind:
289297
create_host_path: false
@@ -621,6 +629,9 @@ services:
621629
- ./config/suricata.env
622630
- ./config/suricata-offline.env
623631
volumes:
632+
- suricata-config:/etc/suricata
633+
- suricata-managed:/var/lib/suricata
634+
- suricata-run:/var/run/suricata
624635
- type: bind
625636
bind:
626637
create_host_path: false
@@ -686,6 +697,9 @@ services:
686697
- ./config/suricata.env
687698
- ./config/suricata-live.env
688699
volumes:
700+
- suricata-live-config:/etc/suricata
701+
- suricata-live-managed:/var/lib/suricata
702+
- suricata-live-run:/var/run/suricata
689703
- type: bind
690704
bind:
691705
create_host_path: false
@@ -741,6 +755,7 @@ services:
741755
- ./config/filescan-secret.env
742756
- ./config/filescan.env
743757
volumes:
758+
- filescan-data:/filescan/data
744759
- type: bind
745760
bind:
746761
create_host_path: false
@@ -793,6 +808,9 @@ services:
793808
- ./config/pipeline.env
794809
shm_size: 512mb
795810
volumes:
811+
- strelka-backend-clamav-rules:/var/lib/clamav
812+
- strelka-backend-yara-rules-src:/yara-rules-src
813+
- strelka-backend-yara-rules:/yara-rules
796814
- type: bind
797815
bind:
798816
create_host_path: false
@@ -840,6 +858,7 @@ services:
840858
- ./config/redis.env
841859
- ./config/pipeline.env
842860
volumes:
861+
- strelka-frontend-logs:/var/log/strelka
843862
- type: bind
844863
bind:
845864
create_host_path: false
@@ -852,7 +871,6 @@ services:
852871
source: ./strelka/config/frontend/
853872
target: /etc/strelka/configmap
854873
read_only: true
855-
- strelka-logs:/var/log/strelka/
856874
healthcheck:
857875
test: ["CMD", "/usr/local/bin/container_health.sh"]
858876
interval: 30s
@@ -1458,9 +1476,26 @@ services:
14581476
traefik.enable: false
14591477

14601478
volumes:
1461-
# shared named volume so filebeat can access nginx access logs
1479+
dashboards-helper-data-init:
1480+
filebeat-logs-registry:
1481+
filebeat-nginx-registry:
1482+
filebeat-syslog-tcp-registry:
1483+
filebeat-syslog-udp-registry:
1484+
filebeat-tcp-registry:
1485+
filebeat-zeek-files-logs-registry:
1486+
filescan-data:
1487+
logstash-persistent-queue:
14621488
nginx-log-path:
1463-
strelka-logs:
1489+
strelka-backend-clamav-rules:
1490+
strelka-backend-yara-rules-src:
1491+
strelka-backend-yara-rules:
1492+
strelka-frontend-logs:
1493+
suricata-config:
1494+
suricata-live-config:
1495+
suricata-live-managed:
1496+
suricata-live-run:
1497+
suricata-managed:
1498+
suricata-run:
14641499

14651500
networks:
14661501
default:

0 commit comments

Comments
 (0)