-
Notifications
You must be signed in to change notification settings - Fork 8
fix: non-root user support in Dockerfile #45
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
Conversation
|
Claude finished @solimander's task —— View job PR Review: Non-root User Support in DockerfileTodo List:
Overall AssessmentThis PR implements a solid approach to handling non-root users in Docker containers while maintaining security for TEE operations. The implementation correctly runs privileged operations as root first, then drops privileges to the original user. Code Quality & Best Practices ✅Strengths:
Template Structure (
Security Analysis 🔒Positive Security Aspects:
Security Considerations:
Performance Considerations ⚡Minimal Performance Impact:
Potential Issues & Improvements 🔧Minor Issues Found:
Suggested Improvements: # Add user validation before privilege drop
if [ -n "$__EIGENX_ORIGINAL_USER" ] && [ "$(id -u)" = "0" ]; then
if ! id "$__EIGENX_ORIGINAL_USER" >/dev/null 2>&1; then
echo "compute-source-env.sh: ERROR - User $__EIGENX_ORIGINAL_USER does not exist"
exit 1
fi
echo "compute-source-env.sh: Dropping privileges to user: $__EIGENX_ORIGINAL_USER"
exec su -s /bin/sh "$__EIGENX_ORIGINAL_USER" -c 'exec "$@"' -- sh "$@"
fiTest Coverage Considerations 🧪Current State:
Testing Recommendations:
Environment Variable Handling ✅Well Implemented:
Architecture Alignment 🏗️The implementation aligns well with the project's architecture:
Recommendation: APPROVE with Minor ImprovementsThis PR successfully solves the non-root user support problem with a secure and well-thought-out approach. The suggested user validation improvement would make it more robust, but the current implementation is functionally correct and secure. Priority for improvements:
|
Summary