Bug 1891759
Summary: | Dockerfile builds cannot change /etc/pki/ca-trust | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Oleg Bulatov <obulatov> |
Component: | Build | Assignee: | Adam Kaplan <adam.kaplan> |
Status: | CLOSED ERRATA | QA Contact: | wewang <wewang> |
Severity: | high | Docs Contact: | Rolfe Dlugy-Hegwer <rdlugyhe> |
Priority: | unspecified | ||
Version: | 4.6 | CC: | aaleman, adam.kaplan, aos-bugs, bparees, gmontero, rdlugyhe, wking, wzheng, xiuwang |
Target Milestone: | --- | Keywords: | Regression |
Target Release: | 4.7.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: |
* Previously, Dockerfile builds could not change permissions of `/etc/pki/ca-trust` or create files inside it. This issue was caused by fixing link:https://bugzilla.redhat.com/show_bug.cgi?id=1826183[] in version 4.6, which added support for HTTPS proxies with CAs for builds and ALWAYS mounted `/etc/pki/ca-trust`. This prevented builds that included their own CAs or modified the system trust store from working correctly at runtime. The current release fixes this issue by reverting Bug 1826183. Now, builder images that include their own CAs work again.
(link:https://bugzilla.redhat.com/show_bug.cgi?id=1891759[*BZ#1891759*])
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2021-02-24 15:28:35 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1895093 |
Description
Oleg Bulatov
2020-10-27 09:43:00 UTC
This was a consequence of fixing https://bugzilla.redhat.com/show_bug.cgi?id=1826183. /etc/pki/ca-trust is a mount point for buildah, the contents of which are managed by the build container. When the build container starts, it adds the cluster-wide CA to the set of anchors, and then runs `update-ca-trust extract` as root. In the case of the image registry, it wants /etc/pki/ca-trust to be writeable so that `update-ca-trust` can be run as non-root. I think https://bugzilla.redhat.com/show_bug.cgi?id=1826183 needs to be considered for reversion, given the impact on existing build behavior. It means that no one w/ a builder image that includes their own CAs can continue to function as expected, right? Because their CAs will be stomped by the always present mount that that fix introduced. more specifically, here is my suggested course of action: 1) put in a change to 4.7 and 4.6 that does not mount the content (you can leave the rest of the logic in place) 2) get CI to update to the 4.6.z patch asap 3) reintroduce the mount based on a buildconfig api opt-in field. in 4.6+4.7. Dropping the sort of error string folks might see into the bug, to help with searching: Copying system trust bundle cp: cannot remove '/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem': Permission denied To facilitate quick backporting to 4.6.z, this BZ will only cover the removal of the buildah mount. Optionally mounting /etc/pki/ca-trust will be addressed in https://bugzilla.redhat.com/show_bug.cgi?id=1895053. Verified as follow version: Version: 4.7.0-0.nightly-2020-11-05-214617 Using the follow Dockerfile: ``` FROM registry.svc.ci.openshift.org/ocp/4.7:base RUN chmod a+w -R /etc/pki/ca-trust/extracted RUN ls -ld /etc/pki/ca-trust/extracted ``` result: STEP 1: FROM registry.svc.ci.openshift.org/ocp/4.7:base STEP 2: RUN chmod a+w -R /etc/pki/ca-trust/extracted --> 2293d141c56 STEP 3: RUN ls -ld /etc/pki/ca-trust/extracted drwxrwxrwx. 1 root root 70 Sep 1 19:39 /etc/pki/ca-trust/extracted Added the case:OCP-37309 to the bug, but met issue "The external tracker URL you specified does not belong to a tracker known to Red Hat Bugzilla", anyway cases added. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2020:5633 |