-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Switch containers to unpriviliged service user #357
Switch containers to unpriviliged service user #357
Conversation
Hi! I think these changes are great, however, I am a bit worried about suddenly breaking user's apps. I think a good approach could be to introduce a new package alongside the current one. Then we can nudge people to use the new image, and eventually deprecate the old one. But maybe there is another approach? |
ref the CI image build: https://github.com/almarklein/timetagger/blob/main/.github/workflows/dockerimage.yml |
@almarklein thanks for the fast feedback. I totally get your concerns regarding breaking the users existing installations. During the development of the unprivileged sample I already thought in the same direction as your proposal above. One easy step would be to release the unprivileged container images alongside the existing ones as opt-in option for security concerned users. Afterwards I currently see to options to make the default installation more secure by default:
The second "graceful" automatic migration approach should (at least in theory) provide a zero-effort way to on-board existing installations to the unprivileged variant over time. |
Yeah, let's start there 👍 |
@almarklein I started with my work on the In 1a0d9e6 I splitted the b05fe86 includes the adoption of the CI to build the default and the The After an OK from your side on these changes I can also include some docs that cover the two variants. |
The uvloop, and httptools are optional dependencies to make the server faster. The rest is an artifact of how I manage the dockerfiles for timetagger.app; I have base docker image with all dependencies, and on a deploy I only install the latest timetagger into that. That way I don't have surprises of dependencies getting a new version and breaking stuff. For the Dockerfile here we can drop the duplication, but I'd keep the
Could you split the build up at a higher level, so instead of one
That sounds fine 👍 |
Sorry for the late reply, btw :) |
@almarklein no worries about the late answer. Its open source and I understand that also maintainers have other things to do ;) I will try to incorporate your suggestions over the next couple of days! |
@almarklein - I have reached a state that is ready for another round of review. Changes included:
Let me know what you think! If the technical side is fine I can start on working on some docs for these changes. |
@danielhass Looks perfect! There was a merge conflict with the main branch. Was easy enough to resolve, but you will have to pull that last commit. |
Just a gentle ping that the technical side is fine now 👍 |
@almarklein sorry for my late reply! Thanks for resolving the merge conflicts. Regarding the docs: I didn't find any mention of the containerized deployment in the actual docs. However it is mentioned in the project README. What do you think about the following changes:
|
No problem at all. I just noticed that this is still open.
Good point. Actually, since this part is good as it is, I'll merge it as-is. You can then add a new pr for better documentation on using Docker. |
Yes to all, I suppose. I reckon that the text will become much more than what we currently have in the readme, so perhaps we can add it as a new page to the docs, and refer to it from the readme? |
Dear @almarklein, I just started to use your awesome
timetagger
app for my personal time tracking needs. Great project I really like it!I noticed that the ghcr published images and also the other container variants make use of the
root
user withuid
andgid
of0
.In order to make container escapes harder and follow security best-practices I introduced an unprivileged service user named
timetagger
withuid
andgid
of1000
to therepo.Dockerfile
.This might be considered as a breaking change as existing self hosted installations probably need to alter their persistent data in order to be able to use the unprivileged variant.
Before going forward with this change, maybe also on the other container variants, I wanted to get your feedback first if this contribution is something you are interested in before spending more time on it?
Changes included so far:
timetagger
withuid
andgid
of1000
/root
to/opt/timetagger
pip install
is know running as service user too and not asroot
anymoreitemdb
version constraint as older versions than1.1.1
would not be installed by defaultLooking forward to your feedback!