Reduce Buildah log level to hide secrets for s2i
Environment
- Red Hat OpenShift Container Platform(RHOCP)
- All OCP 4 versions prior to 4.10.30
Issue
When customer uses S2I , all secrets used in OCP cluster will be printed in buildah logs since "--quiet" argument cannot be used as per the below configuration:
type: Source
sourceStrategy:
from:
kind: ImageStreamTag
namespace: xxxxxxx
name: 's2i-xxxxxx-xxxxxxx:v1.0.0'
Resolution
- This issue is been tracked with our engineering BUG OCPBUGS-205
- Upgrade to OCP version 4.10.30 or later will allow adding BUILDAH_QUIET environment variables. Check more details in the RHSA-2022:6133 - Security Advisory
Root Cause
Customers are using secrets but in an earlier version of OCP 4 (prior to 4.10.30) the default buildah logs will print out all ENV, LABEL, image get/push details to the log.
Diagnostic Steps
Verification Steps:
- Create a simple Containerfile that has an ENV statement
FROM registry.redhat.io/ubi8/ubi:latest
ENV SECRET_DATA="hello-world"
RUN echo "Hello world!"
- Build an image with the Containerfile above, with log level set to "error"
$ buildah --log-level=error bud -t hello-world:latest -f Containerfile .
- Result - Step ENV is printed.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments