-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[BEAM-13932][Playground] Container's user privileges #16842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,16 +69,16 @@ 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 sh /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/ && chown -R appuser:appgroup /opt/playground/prepared_folder/ \ | ||
| && chmod +x /entrypoint.sh | ||
|
|
||
| RUN mkdir -p /opt/playground/backend/executable_files/ | ||
|
|
||
| # Chown all required files to the `appuser`. | ||
| RUN chown -R appuser:appgroup /opt/playground/backend/executable_files/ \ | ||
| && chmod -R 777 /usr/local/share/ca-certificates/extra/ && chmod -R 777 /etc/ssl/certs && chmod +x /entrypoint.sh | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for this folders /usr/local/share/ca-certificates/extra/ /etc/ssl/certs needs right execute (7) ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if set if set if set So I guess I need to set |
||
|
|
||
| # Switch to appuser | ||
| USER appuser | ||
|
|
||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,4 +14,14 @@ | |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| nohup /opt/mitmproxy/mitmdump -s /opt/mitmproxy/allow_list_proxy.py -p 8081 & | ||
| while [ ! -f /home/appuser/.mitmproxy/mitmproxy-ca.pem ] ; | ||
| do | ||
| sleep 2 | ||
| done | ||
| openssl x509 -in /home/appuser/.mitmproxy/mitmproxy-ca.pem -inform PEM -out /home/appuser/.mitmproxy/mitmproxy-ca.crt | ||
| cp /home/appuser/.mitmproxy/mitmproxy-ca.crt /usr/local/share/ca-certificates/extra/ | ||
| update-ca-certificates | ||
| cat /home/appuser/.mitmproxy/mitmproxy-ca.pem >> /usr/local/lib/python3.7/site-packages/certifi/cacert.pem | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this needed only on python env. ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this part: is a common for all SDK that uses a proxy, but this one: is used only for a Python SDK.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
|
|
||
| /opt/playground/backend/server_python_backend | ||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,4 +27,5 @@ | |
| "dataflow-samples", | ||
| "beam-samples", | ||
| "apache-beam-samples", | ||
| "playground-precompiled-objects", | ||
| ] | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change the path to
PREPARED_MOD_DIRenvThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And in other cases too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PREPARED_MOD_DIRequals/opt/playground/prepared_folder/, but I need/opt/playground/backend/executable_files/There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sry, i meant executable_files to
PIPELINES_FOLDER_NAMEThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PIPELINES_FOLDER_NAMEequalsexecutable_files, but I need/opt/playground/backend/executable_files/