Skip to content

Commit 2a98941

Browse files
authored
Merge pull request #5376 from atlanhq/kv-kuberentes-hardening-poc
feat: adding non root user
2 parents 42cd09e + 01e9f2b commit 2a98941

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/maven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,4 @@ jobs:
158158
- name: Upload Trivy scan results to GitHub Security tab
159159
uses: github/codeql-action/[email protected]
160160
with:
161-
sarif_file: 'trivy-image-results.sarif'
161+
sarif_file: 'trivy-image-results.sarif'

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ COPY atlas-hub/pre-conf/atlas-auth/ /opt/apache-atlas/conf/
5050
RUN mkdir /opt/apache-atlas/libext
5151
RUN curl https://repo1.maven.org/maven2/org/jolokia/jolokia-jvm/1.6.2/jolokia-jvm-1.6.2-agent.jar -o /opt/apache-atlas/libext/jolokia-jvm-agent.jar
5252

53+
# Create a non-root user for running Atlas
54+
RUN groupadd -r atlas && useradd -r -g atlas -d /opt/apache-atlas -s /bin/bash atlas
55+
56+
# Set ownership of the atlas directory to the atlas user
57+
RUN chown -R atlas:atlas /opt/apache-atlas
58+
59+
# Switch to the non-root user
60+
USER atlas
61+
5362
RUN cd /opt/apache-atlas/bin \
5463
&& ./atlas_start.py -setup || true
5564

0 commit comments

Comments
 (0)