Skip to content

Commit fef72ea

Browse files
committed
[feature] Tighten permissions on /elemental in the Docker Container
1 parent acd9cf9 commit fef72ea

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

exist-docker/src/main/resources-filtered/Dockerfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,13 @@ COPY --from=builder /usr/lib/jvm/java-21-openjdk /usr/lib/jvm/java-21-openjdk
9797
USER nonroot
9898

9999
# Copy Elemental
100-
COPY LICENSE /elemental/LICENSE
101-
COPY autodeploy /elemental/autodeploy
102-
COPY etc /elemental/etc
103-
COPY lib /elemental/lib
104-
COPY --chown=nonroot logs /elemental/logs
105-
COPY --chown=nonroot logs /elemental/data
100+
COPY --chmod=0555 logs /elemental
101+
COPY --chmod=0444 LICENSE /elemental/LICENSE
102+
COPY --chmod=0570 autodeploy /elemental/autodeploy
103+
COPY --chmod=0570 etc /elemental/etc
104+
COPY --chmod=0550 lib /elemental/lib
105+
COPY --chown=nonroot --chmod=0750 logs /elemental/logs
106+
COPY --chown=nonroot --chmod=0750 logs /elemental/data
106107

107108
# Build-time metadata as defined at http://label-schema.org
108109
# and used by autobuilder @hooks/build

exist-docker/src/main/resources-filtered/Dockerfile-DEBUG

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,13 @@ RUN apk add openjdk-21
7070
USER nonroot
7171

7272
# Copy Elemental
73-
COPY LICENSE /elemental/LICENSE
74-
COPY autodeploy /elemental/autodeploy
75-
COPY etc /elemental/etc
76-
COPY lib /elemental/lib
77-
COPY --chown=nonroot logs /elemental/logs
78-
COPY --chown=nonroot logs /elemental/data
73+
COPY --chmod=0555 logs /elemental
74+
COPY --chmod=0444 LICENSE /elemental/LICENSE
75+
COPY --chmod=0570 autodeploy /elemental/autodeploy
76+
COPY --chmod=0570 etc /elemental/etc
77+
COPY --chmod=0550 lib /elemental/lib
78+
COPY --chown=nonroot --chmod=0750 logs /elemental/logs
79+
COPY --chown=nonroot --chmod=0750 logs /elemental/data
7980

8081
# Build-time metadata as defined at http://label-schema.org
8182
# and used by autobuilder @hooks/build

0 commit comments

Comments
 (0)