Skip to content

Add ability to run augur container as a non-root user #3131

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

Merged
merged 6 commits into from
Apr 23, 2025

Conversation

JohnStrunk
Copy link
Contributor

@JohnStrunk JohnStrunk commented Apr 16, 2025

Description
This PR provides the ability to run the augur backend container as an arbitrary non-root user. This is important for running on OpenShift where the userid is not known until runtime, and containers are not permitted to run as uid 0.

The majority of the changes are related to moving R/W files such as config and log files out of the source tree and into paths that will have data volumes mounted. The docker-compose.yml was updated to provide the required volumes.
File permissions during the build process were also updated so that non-root users will have read access.

I also changed the build steps for scorecard and scc to directly go install them instead of manually checking out the repo and running go build on the local copy.

This PR fixes #3107

Notes for Reviewers

  • I think I've preserved the existing behavior when the new variables aren't set
  • I've added a bunch of new environment variables to control file locations. I'm certainly not sold on that-- I feel like it's made things a bit complex even though they all should be optional. If you have another suggestion, please let me know.
  • I added 3 new volumes, but I'm not sure they are all necessary. I'm not familiar enough with the code at this point to confidently make a call about what should be co-located. Ideally, we'd have 1 volume for persistent data, and 1 for temporary data (which would really just be the /tmp directory). I'm happy to modify this PR to that model if you can provide some guidance about what's important to keep and what is ephemeral.

Signed commits

  • Yes, I signed my commits.

Allow setting cache directories and other paths via environment variables,
update docker-compose.yml and Dockerfile to reflect these changes, and
make other related changes to improve flexibility and consistency.

Signed-off-by: John Strunk <[email protected]>
Uncomment user and post_start commands in docker-compose.yml to ensure the
arbitrary non-root user has access to necessary volumes, enhancing security
and preventing potential permission issues with /facade, /logs, /config,
and /cache directories.

Signed-off-by: John Strunk <[email protected]>
Update keyman Dockerfile to install pip with --no-cache-dir, add
ENV PYTHONUNBUFFERED for straight to terminal output, and set
logger to output to stdout with a specified format in
Orchestrator.py. Also, update docker-compose.yml to run keyman
as a non-root user and add keyman service.

Signed-off-by: John Strunk <[email protected]>
@JohnStrunk JohnStrunk marked this pull request as ready for review April 18, 2025 17:15
@JohnStrunk JohnStrunk requested a review from sgoggins as a code owner April 18, 2025 17:15
Copy link
Member

@sgoggins sgoggins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sgoggins sgoggins merged commit 4e0e9d7 into chaoss:dev Apr 23, 2025
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants