[
https://issues.apache.org/jira/browse/BEAM-13774?focusedWorklogId=719529&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-719529
]
ASF GitHub Bot logged work on BEAM-13774:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 02/Feb/22 17:41
Start Date: 02/Feb/22 17:41
Worklog Time Spent: 10m
Work Description: AydarZaynutdinov commented on a change in pull request
#16659:
URL: https://github.com/apache/beam/pull/16659#discussion_r797860263
##########
File path: playground/backend/containers/scio/Dockerfile
##########
@@ -60,10 +60,25 @@ RUN mkdir /opt/mitmproxy &&\
wget https://snapshots.mitmproxy.org/7.0.4/mitmproxy-7.0.4-linux.tar.gz &&\
tar -zxvf mitmproxy-7.0.4-linux.tar.gz &&\
mkdir /usr/local/share/ca-certificates/extra
-COPY entrypoint.sh /
COPY allow_list_proxy.py /opt/mitmproxy/
COPY allow_list.py /opt/mitmproxy/
ENV HTTP_PROXY="http://127.0.0.1:8081"
ENV HTTPS_PROXY="http://127.0.0.1:8081"
-ENTRYPOINT ["/opt/playground/backend/server_scio_backend"]
+COPY entrypoint.sh /
+COPY proxy.sh /
+# Run proxy
+RUN chmod +x /proxy.sh
+RUN /proxy.sh
+
+# Create a user group `appgroup` and a user `appuser`
+RUN groupadd --gid 20000 appgroup \
+ && useradd --uid 20000 --gid appgroup --shell /bin/bash --create-home appuser
+# Chown all the files to the app user.
+RUN chown -R appuser:appgroup /opt/playground/backend/
+RUN chmod +x /entrypoint.sh
Review comment:
Done.
##########
File path: playground/backend/containers/scio/Dockerfile
##########
@@ -60,10 +60,25 @@ RUN mkdir /opt/mitmproxy &&\
wget https://snapshots.mitmproxy.org/7.0.4/mitmproxy-7.0.4-linux.tar.gz &&\
tar -zxvf mitmproxy-7.0.4-linux.tar.gz &&\
mkdir /usr/local/share/ca-certificates/extra
-COPY entrypoint.sh /
COPY allow_list_proxy.py /opt/mitmproxy/
COPY allow_list.py /opt/mitmproxy/
ENV HTTP_PROXY="http://127.0.0.1:8081"
ENV HTTPS_PROXY="http://127.0.0.1:8081"
-ENTRYPOINT ["/opt/playground/backend/server_scio_backend"]
+COPY entrypoint.sh /
+COPY proxy.sh /
+# Run proxy
+RUN chmod +x /proxy.sh
+RUN /proxy.sh
+
Review comment:
Done.
##########
File path: playground/backend/containers/python/Dockerfile
##########
@@ -57,10 +57,25 @@ RUN mkdir /opt/mitmproxy &&\
wget https://snapshots.mitmproxy.org/7.0.4/mitmproxy-7.0.4-linux.tar.gz &&\
tar -zxvf mitmproxy-7.0.4-linux.tar.gz &&\
mkdir /usr/local/share/ca-certificates/extra
-COPY entrypoint.sh /
COPY allow_list_proxy.py /opt/mitmproxy/
COPY allow_list.py /opt/mitmproxy/
ENV HTTP_PROXY="http://127.0.0.1:8081"
ENV HTTPS_PROXY="http://127.0.0.1:8081"
+COPY entrypoint.sh /
+COPY proxy.sh /
+# Run proxy
+RUN chmod +x /proxy.sh
+RUN /proxy.sh
+
+# Create a user group `appgroup` and a user `appuser`
+RUN groupadd --gid 20000 appgroup \
+ && useradd --uid 20000 --gid appgroup --shell /bin/bash --create-home appuser
+# Chown all the files to the app user.
+RUN chown -R appuser:appgroup /opt/playground/backend/
+RUN chmod +x /entrypoint.sh
+
Review comment:
Done.
##########
File path: playground/backend/containers/python/Dockerfile
##########
@@ -57,10 +57,25 @@ RUN mkdir /opt/mitmproxy &&\
wget https://snapshots.mitmproxy.org/7.0.4/mitmproxy-7.0.4-linux.tar.gz &&\
tar -zxvf mitmproxy-7.0.4-linux.tar.gz &&\
mkdir /usr/local/share/ca-certificates/extra
-COPY entrypoint.sh /
COPY allow_list_proxy.py /opt/mitmproxy/
COPY allow_list.py /opt/mitmproxy/
ENV HTTP_PROXY="http://127.0.0.1:8081"
ENV HTTPS_PROXY="http://127.0.0.1:8081"
+COPY entrypoint.sh /
+COPY proxy.sh /
+# Run proxy
+RUN chmod +x /proxy.sh
+RUN /proxy.sh
Review comment:
Done.
##########
File path: playground/backend/containers/java/Dockerfile
##########
@@ -81,10 +81,26 @@ RUN mkdir /opt/mitmproxy &&\
wget https://snapshots.mitmproxy.org/7.0.4/mitmproxy-7.0.4-linux.tar.gz &&\
tar -zxvf mitmproxy-7.0.4-linux.tar.gz &&\
mkdir /usr/local/share/ca-certificates/extra
-COPY entrypoint.sh /
COPY allow_list_proxy.py /opt/mitmproxy/
COPY allow_list.py /opt/mitmproxy/
ENV HTTP_PROXY="http://127.0.0.1:8081"
ENV HTTPS_PROXY="http://127.0.0.1:8081"
+COPY entrypoint.sh /
+COPY proxy.sh /
+# Run proxy
+RUN chmod +x /proxy.sh
+RUN /proxy.sh
+
+# Create a user group `appgroup` and a user `appuser`
+RUN groupadd --gid 20000 appgroup \
+ && useradd --uid 20000 --gid appgroup --shell /bin/bash --create-home appuser
+# Chown all the files to the app user.
+RUN chown -R appuser:appgroup /opt/playground/backend/
+RUN chown -R appuser:appgroup /opt/apache/beam/jars/
+RUN chmod +x /entrypoint.sh
Review comment:
Done.
##########
File path: playground/backend/containers/java/Dockerfile
##########
@@ -81,10 +81,26 @@ RUN mkdir /opt/mitmproxy &&\
wget https://snapshots.mitmproxy.org/7.0.4/mitmproxy-7.0.4-linux.tar.gz &&\
tar -zxvf mitmproxy-7.0.4-linux.tar.gz &&\
mkdir /usr/local/share/ca-certificates/extra
-COPY entrypoint.sh /
COPY allow_list_proxy.py /opt/mitmproxy/
COPY allow_list.py /opt/mitmproxy/
ENV HTTP_PROXY="http://127.0.0.1:8081"
ENV HTTPS_PROXY="http://127.0.0.1:8081"
+COPY entrypoint.sh /
+COPY proxy.sh /
+# Run proxy
+RUN chmod +x /proxy.sh
+RUN /proxy.sh
Review comment:
Done.
##########
File path: playground/backend/containers/go/Dockerfile
##########
@@ -63,10 +63,26 @@ RUN mkdir /opt/mitmproxy &&\
wget https://snapshots.mitmproxy.org/7.0.4/mitmproxy-7.0.4-linux.tar.gz &&\
tar -zxvf mitmproxy-7.0.4-linux.tar.gz &&\
mkdir /usr/local/share/ca-certificates/extra
-COPY entrypoint.sh /
COPY allow_list_proxy.py /opt/mitmproxy/
COPY allow_list.py /opt/mitmproxy/
ENV HTTP_PROXY="http://127.0.0.1:8081"
ENV HTTPS_PROXY="http://127.0.0.1:8081"
+COPY entrypoint.sh /
+COPY proxy.sh /
+# Run proxy
+RUN chmod +x /proxy.sh
+RUN /proxy.sh
+
+# Create a user group `appgroup` and a user `appuser`
+RUN groupadd --gid 20000 appgroup \
+ && useradd --uid 20000 --gid appgroup --shell /bin/bash --create-home appuser
+# Chown all the files to the app user.
+RUN chown -R appuser:appgroup /opt/playground/backend/
+RUN chown -R appuser:appgroup /opt/playground/prepared_folder/
+RUN chmod +x /entrypoint.sh
Review comment:
Done.
##########
File path: playground/backend/containers/go/Dockerfile
##########
@@ -63,10 +63,26 @@ RUN mkdir /opt/mitmproxy &&\
wget https://snapshots.mitmproxy.org/7.0.4/mitmproxy-7.0.4-linux.tar.gz &&\
tar -zxvf mitmproxy-7.0.4-linux.tar.gz &&\
mkdir /usr/local/share/ca-certificates/extra
-COPY entrypoint.sh /
COPY allow_list_proxy.py /opt/mitmproxy/
COPY allow_list.py /opt/mitmproxy/
ENV HTTP_PROXY="http://127.0.0.1:8081"
ENV HTTPS_PROXY="http://127.0.0.1:8081"
+COPY entrypoint.sh /
+COPY proxy.sh /
+# Run proxy
+RUN chmod +x /proxy.sh
+RUN /proxy.sh
Review comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 719529)
Time Spent: 1h (was: 50m)
> [Playground] Add user to container
> ----------------------------------
>
> Key: BEAM-13774
> URL: https://issues.apache.org/jira/browse/BEAM-13774
> Project: Beam
> Issue Type: Improvement
> Components: beam-playground
> Reporter: Aydar Zaynutdinov
> Assignee: Aydar Zaynutdinov
> Priority: P3
> Labels: beam-playground-backend, beam-playground-devops,
> beam-playground-sprint-8
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Need to add a user to start docker containers via this user to restrict the
> executable code in the rights to the system folders.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)