Skip to content

Commit 161f6c7

Browse files
committed
[feature] Tighten permissions on /elemental in the Docker Container
1 parent 6e17965 commit 161f6c7

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
@@ -98,12 +98,13 @@ COPY --from=builder /usr/lib/jvm/java-1.8-openjdk /usr/lib/jvm/java-1.8-openjdk
9898
USER nonroot
9999

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

108109
# Build-time metadata as defined at http://label-schema.org
109110
# 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-8
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)