PB-16197 | added SCC hardening for px-backup#945
Open
vk-px wants to merge 3 commits into
Open
Conversation
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.
Summary
This PR tightens SCC and pod security handling for PX-Backup on OpenShift, with focus on the
pxcentral-apiserverpath and the post-install hook ServiceAccount.The goal is to make the core PX-Backup / PX-Central deployment work cleanly in a restricted OpenShift namespace, without requiring broader SCCs than necessary.
This PR also captures an important validation finding: telemetry is a separate exception path and requires at least
nonroot/nonroot-v2, becauseedge-envoyruns with a fixed non-root UID.Problem
On OpenShift, PX-Backup installation was observed to change the namespace pod security posture from restricted to privileged during deployment. This is the behavior tracked in PB-16433.
The related fix direction discussed internally was to avoid pod security labels changing from restricted to privileged during PX-Backup install.
In baseline validation using the unmodified chart, installation into a pre-created restricted namespace was accepted by the cluster, but the deployment did not converge cleanly. Core components such as
pxcentral-backend,pxcentral-frontend, andpxcentral-lh-middlewaredid not stabilize in that setup.What this PR changes
This PR tightens the SCC and securityContext posture for the core install path, specifically around:
pxcentral-apiserverrestricted-v2The intent is to keep the core deployment on the least-privilege SCC possible and avoid unnecessary dependence on broader SCCs such as
anyuidfor the normal PX-Backup installation flow.Validation
Validation was performed using a manually created OpenShift namespace with restricted pod security enforcement and SCC-to-PSA label sync disabled.
Baseline result with the unmodified chart:
Observed Helm install output from the baseline run:
Observed pod behavior from the baseline run:
Result with the changes in this PR:
pxcentral-apiservercame up successfullypxcentral-backendcame up successfullypxcentral-frontendcame up successfullypxcentral-lh-middlewarecame up successfullypx-backupcame up successfullypxcentral-post-install-hookcompleted successfullyObserved pod behavior with the latest changes:
In the restricted validation namespace, all observed core pods were admitted under
restricted-v2, including:pxcentral-apiserverpxcentral-backendpxcentral-frontendpxcentral-lh-middlewarepxcentral-post-install-hookpx-backupObserved SCC admission output:
This validates that the tightened core deployment path works under
restricted-v2in the tested setup.Telemetry finding
Telemetry should be treated separately from the core SCC tightening in this PR.
Internal findings from PB-16295 show that
edge-envoyruns as fixed UID10001, whilerestricted-v2assigns a UID from the namespace range. Because the runtime UID is not10001, Envoy encounters permission failures during startup, cannot complete its required config/certificate flow, and telemetry registration does not complete.The least-privilege resolution for telemetry is
nonroot/nonroot-v2, which allows fixed non-root UIDs without opening access as broadly asanyuid.Scope
This PR is intended to harden the core PX-Backup / PX-Central install path for OpenShift restricted environments by tightening SCC usage for the API server and post-install hook path.
Telemetry is not fully covered by a pure
restricted-v2model and should be treated as a separate minimum-access path:restricted-v2nonroot/nonroot-v2anyuidwherenonrootis sufficientResult
After these changes:
pxcentral-apiserverand the post-install flow no longer block clean startup in the restricted test setuprestricted-v2nonrootminimum due to fixed-UID requirementsSuggested reviewer note
This PR focuses on SCC tightening for the core PX-Backup / PX-Central installation path on OpenShift. It does not attempt to force telemetry onto
restricted-v2; telemetry has a separate fixed-UID requirement and needsnonroot/nonroot-v2as the least-privilege option.