Support non-root Candlepin by running as tomcat with owned secrets - #651
Conversation
dec888e to
b050bfe
Compare
b050bfe to
bd0e421
Compare
| [Container] | ||
| User={{ candlepin_container_user }} |
There was a problem hiding this comment.
Should we set this in https://github.com/theforeman/candlepin-oci-images/blob/master/images/candlepin/Containerfile, so all users of the container benefit from it?
(Not blocking, we can change it here, see it works, change it in the container and then remove the two lines here again)
There was a problem hiding this comment.
Hah, just realized you already have theforeman/candlepin-oci-images#52 open. Nice!
There was a problem hiding this comment.
If the image change is merged, this should be dropped, right?
There was a problem hiding this comment.
okay, got it. Can I drop it then, assuming the other pr would be merged first?
There was a problem hiding this comment.
But we're using foreman-nightly, not nightly in
foremanctl/src/vars/images.yml
Lines 4 to 6 in 688d3da
What updates the foreman-nightly tag?
There was a problem hiding this comment.
Any merge that you do on foreman-nightly the image is built and published by Konflux right after.
This is the tag that we are using now https://gitlab.com/fedora/infrastructure/konflux/tenants-config/-/blob/main/clusters/kflux-fedora-01/tenants/theforeman-org-tenant/candlepin/releaseplans/develop/kustomization.yaml?ref_type=heads#L30
Should we also add foreman-nightly alongside nightly as tag?
There was a problem hiding this comment.
Just added here https://gitlab.com/fedora/infrastructure/konflux/tenants-config/-/merge_requests/212, I'll make sure it's there in one hour after everything syncs
There was a problem hiding this comment.
You can now use quay.io/foreman/candlepin:foreman-nightly
podman pull quay.io/foreman/candlepin:foreman-nightly
Trying to pull quay.io/foreman/candlepin:foreman-nightly...
Getting image source signatures
Copying blob 0a3d34aa24dc done |
Copying blob 452eff874a29 done |
Copying config f7a84f58b6 done |
Writing manifest to image destination
f7a84f58b60c2c0a002523d70594e708264d17d5b3c652d9357d49028202592d
There was a problem hiding this comment.
I don't necessarily say this needs to be updated at the same time you tag a new candlepin (or pulp!) nightly. More when there is a new candlepin (or pulp) that should go with foreman nightly (e.g. after a pipeline run that verifies those are compatible, or whatever).
bd0e421 to
3e320ee
Compare
3e320ee to
d01bc67
Compare
|
"migration" test failure unrelated, explanation and possible fix in #661 |
d01bc67 to
27ad2c8
Compare
| @@ -11,6 +11,7 @@ candlepin_ciphers: | |||
| - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 | |||
| candlepin_container_image: quay.io/foreman/candlepin | |||
| candlepin_container_tag: "4.4.14" | |||
There was a problem hiding this comment.
Right now our container on nightly is built with 4.8.2, do we need to update it here?
|
#657 was merged and introduced a merge conflict. My apologies. |
Head branch was pushed to by a user without write access
27ad2c8 to
1a89427
Compare
Why are you introducing these changes? (Problem description, related links)
Candlepin is moving to a non-root container user (
tomcat). By default, Podman mounts secrets asroot:rootwith mode0440, which prevents thetomcatuser from reading the mounted certificates and configuration files unless it is added to therootgroup inside the container.This PR updates
foremanctlto run Candlepin astomcatand sets the ownership of secret mounts to the same user, enabling the companioncandlepin-oci-imageschange (USER tomcat, norootgroup membership).What are the changes introduced in this pull request?
candlepin_container_user: tomcatas the default.User=tomcat.user.ymlto determine thetomcatUID/GID from the container image at deploy time (podman run ... id -u/-g).uid/gidon all Candlepin secret mounts so the mounted files are owned bytomcat(mode0440).test_candlepin_runs_as_tomcatto verify Candlepin runs astomcatand can read the mounted secrets.Related
How to test this pull request
Deploy
Use a Candlepin image built with the companion
candlepin-oci-imageschange (USER tomcat):Verify
Run automated tests
Checklist