fix(helm): declare securityContext for fakeidp and keycloak (#2084) - #2085
Merged
Gregory91G merged 1 commit intoAug 1, 2026
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
cyberantonz
approved these changes
Jul 31, 2026
ktursunov
approved these changes
Jul 31, 2026
cyberantonz
approved these changes
Jul 31, 2026
This was referenced Jul 31, 2026
Open
Both Deployments ran with the default context, so a container could escalate privileges and kept the full capability set. Adopt the shape already used by the gateway chart: non-root UID/GID 1000 at pod level, no privilege escalation and all capabilities dropped at container level. fakeidp additionally gets readOnlyRootFilesystem — it never writes to disk. keycloak does not: start-dev re-augments Quarkus into /opt/keycloak/lib/quarkus on every boot, and backing that path with an emptyDir hides the image's quarkus-application.dat. Signed-off-by: Gregory Gogin <grigoriy.gogin@constructor.tech>
Gregory91G
force-pushed
the
fix/securitycontext-fakeidp-keycloak
branch
from
July 31, 2026 18:05
f02c831 to
39341c5
Compare
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2084.
Both Deployments declared no
securityContext, so their containers could escalate privileges and kept the full default capability set. Adopts the shape already used bysrc/backend/services/gateway/helm.runAsNonRoot/ UID / GID /fsGroup1000allowPrivilegeEscalation: falsecapabilities.drop: ["ALL"]readOnlyRootFilesystem: trueNeither image's runtime user changes:
fakeidpalready carriesUSER 1000and upstreamquay.io/keycloak/keycloakships non-root. The charts simply never asserted it.readOnlyRootFilesystemis omitted for keycloak becausestart-devre-augments Quarkus into/opt/keycloak/lib/quarkuson every boot. Making it work needs an initContainer that pre-populates that path from the image, which is not worth the failure mode on the component that owns login. AVD-KSV-0014 stays reported for keycloak; the misconfig scan is report-only, so nothing is suppressed and no waiver file is introduced.Test plan
helm templaterenders both charts — 83 and 115 lines, no template errorstrivy fs --scanners misconfig --severity HIGH,CRITICALon the rendered output: 6 HIGH → 1 HIGH. fakeidp fully clean (KSV-0014 + 2× KSV-0118 gone); keycloak keeps only KSV-0014docker run --read-only --user 1000:1000 --cap-drop ALL --security-opt no-new-privileges): starts,/.well-known/openid-configuration→ 200,jwks_uri→ 200/kc/realms/master/.well-known/openid-configuration→ 200readOnlyRootFilesystem: trueand no volumes: fails —ReadOnlyFileSystemExceptionin QuarkusJarResultBuildStepreadOnlyRootFilesystem: true+ emptyDir on/opt/keycloak/data,/opt/keycloak/lib/quarkus,/tmp: fails —NoSuchFileException: /opt/keycloak/lib/quarkus/quarkus-application.dat