fix(security): pin base image digest and run as jenkins user - #5173
fix(security): pin base image digest and run as jenkins user#5173causten wants to merge 1 commit into
Conversation
Addresses ROCM-26612, ROCM-26613. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
This PR hardens the project’s Docker build environment by making the base image reproducible (digest-pinned) and switching the container’s default runtime user away from root.
Changes:
- Pin
ubuntu:24.04to a specificsha256digest for supply-chain/reproducibility. - Add a non-root
jenkinsuser and switch the image defaultUSERtojenkins.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| RUN groupadd -r jenkins && useradd -r -g jenkins -m jenkins && \ | ||
| chown -R jenkins:jenkins /tmp /var/tmp $ONNX_HOME |
| RUN groupadd -r jenkins && useradd -r -g jenkins -m jenkins && \ | ||
| chown -R jenkins:jenkins /tmp /var/tmp $ONNX_HOME |
| USER jenkins | ||
|
|
Regressions detected 🔴 * No develop baseline was found for this PR's branch point; compared against the latest available develop run instead. |
|
| ENV ASAN_OPTIONS=detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1 | ||
| RUN ln -s /opt/rocm/llvm/bin/llvm-symbolizer /usr/bin/llvm-symbolizer | ||
|
|
||
| RUN groupadd -r jenkins && useradd -r -g jenkins -m jenkins && \ |
There was a problem hiding this comment.
Dont add a jenkins user as this might not match the user id of the jenkins user on the machine.
| RUN groupadd -r jenkins && useradd -r -g jenkins -m jenkins && \ | ||
| chown -R jenkins:jenkins /tmp /var/tmp $ONNX_HOME | ||
|
|
||
| USER jenkins |
There was a problem hiding this comment.
This should just be deleted as this is not a security issue. Jenkins user should be set when running the docker container(which is already the case).
| RUN groupadd -r jenkins && useradd -r -g jenkins -m jenkins && \ | |
| chown -R jenkins:jenkins /tmp /var/tmp $ONNX_HOME | |
| USER jenkins |
Summary
JIRA
Test plan
Made with Cursor