Skip to content
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

Update docker image to run as non-root #2265

Merged
merged 11 commits into from Apr 4, 2024

Conversation

zalegrala
Copy link
Contributor

@zalegrala zalegrala commented Mar 27, 2023

What this PR does:

BREAKING CHANGE

Here we make the image adjustment necessary to run Tempo as non-root in the
Docker container, as well as include some util jsonnet to allow statefulsets to
chown their data directories to match the new permissions.

With this new chown init contianer, both the ingester and metrics-generator
statefulsets start and function.

❯ docker run -it --entrypoint sh zalegrala/tempo:tempoNonRootImage-eefae10f9
/ $ whoami
tempo
/ $ id
uid=10001(tempo) gid=10001(tempo) groups=10001(tempo)
/ $ ls -ld /var/tempo
drwxr-xr-x    2 tempo    tempo         4096 Apr  2 19:40 /var/tempo

Note that the securityContext.fsGroup(10001) may be required for environments
that mount additional volumes which do not have read/write permissions for the
tempo user. Users may also wish to recursively chown the /var/tempo
directory for the new ownership. This will need to be done only once.

Which issue(s) this PR fixes:
Fixes #334

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@github-actions github-actions bot added the stale Used for stale issues / PRs label May 28, 2023
@zalegrala zalegrala added the keepalive Label to exempt Issues / PRs from stale workflow label May 30, 2023
@github-actions github-actions bot removed the stale Used for stale issues / PRs label May 31, 2023
@github-actions github-actions bot added stale Used for stale issues / PRs and removed stale Used for stale issues / PRs labels Oct 12, 2023
@zalegrala zalegrala force-pushed the tempoNonRootImage branch 2 times, most recently from fe17af1 to 22a27e7 Compare March 15, 2024 15:07
@zalegrala zalegrala marked this pull request as ready for review March 15, 2024 15:12
@zalegrala
Copy link
Contributor Author

Needs a mention of the breaking change and an entry in the changelog.

@grafana grafana deleted a comment from github-actions bot Mar 15, 2024
@grafana grafana deleted a comment from github-actions bot Mar 15, 2024
CHANGELOG.md Show resolved Hide resolved
Copy link
Member

@kvrhdn kvrhdn left a comment

Choose a reason for hiding this comment

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

This looks good to me, nice work cleaning up some secuirty debt.

I'm fine with merging but I think @mdisibio was going to leave a comment too.

@zalegrala
Copy link
Contributor Author

Thanks for the review folks.

@mdisibio I pushed a commit for your feedback on the jsonnet. Feel free to call out anything else you'd like to see addressed here.

@zalegrala
Copy link
Contributor Author

I caught up with mdisibio earlier and we're good on the changes here.

@zalegrala zalegrala merged commit 0d3bde5 into grafana:main Apr 4, 2024
14 checks passed
@zalegrala zalegrala deleted the tempoNonRootImage branch April 4, 2024 16:43
@zalegrala zalegrala self-assigned this Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keepalive Label to exempt Issues / PRs from stale workflow
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Allow for images to run as non-root
3 participants