-
Notifications
You must be signed in to change notification settings - Fork 58
Detect and warn about DevWorkspaces with SCC (Security Context Constraint) mismatches in the Eclipse Che Dashboard #1436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
3a6a875 to
e893a6c
Compare
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1436 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1436", name: che-dashboard}]}}]" |
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1436 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1436", name: che-dashboard}]}}]" |
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1436 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1436", name: che-dashboard}]}}]" |
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1436 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1436", name: che-dashboard}]}}]" |
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1436 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1436", name: che-dashboard}]}}]" |
23c92a8 to
59afc95
Compare
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1436 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1436", name: che-dashboard}]}}]" |
1 similar comment
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1436 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1436", name: che-dashboard}]}}]" |
|
Some notes:
|
Documentation link is different for downstream. We have the MR |
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1436 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1436", name: che-dashboard}]}}]" |
This commit adds the ability to detect and prevent starting workspaces with SCC (Security Context Constraint) mismatches. Changes: - Add selectCurrentScc selector to detect current SCC from server config - Add getDefaultEditor helper function for consistency - Add getContainerScc method to WorkspaceAdapter - Add containerRunCapabilities URL to branding docs - Update WorkspaceStatusIndicator to show Failed status with tooltip when workspace SCC doesn't match server SCC - Add SCC mismatch checks in StartWorkspace component to prevent starting - Add SCC mismatch checks in WorkspaceActionsDropdown to disable actions - Add SCC mismatch checks in WorkspaceActionsProvider - Remove SCC injection from createDevWorkspaceTemplate - Remove manageContainerSccAttribute and related methods When container run/build capabilities are enabled on the server, workspaces created before this change will show a Failed status and cannot be started. Signed-off-by: Oleksii Orel <[email protected]>
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1436 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1436", name: che-dashboard}]}}]" |
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1436 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1436", name: che-dashboard}]}}]" |
f65f966 to
62c26b2
Compare
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1436 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1436", name: che-dashboard}]}}]" |
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1436 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1436", name: che-dashboard}]}}]" |
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1436 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1436", name: che-dashboard}]}}]" |
Based on code review feedback: - Move SCC mismatch message to a constant (SCC_MISMATCH_WARNING_MESSAGE) - Allow workspace start when containerScc is undefined - Update message to emphasize SCC difference instead of nested capabilities - Change from blocking error to warning - dashboard should not prevent workspace from starting The hasSccMismatch() function now returns false when containerScc is undefined, allowing workspaces created before SCC attribute was added to start normally. Status indicators now show warning icon instead of failed status, and start actions log a warning instead of throwing an error. Signed-off-by: Oleksii Orel <[email protected]>
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1436 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1436", name: che-dashboard}]}}]" |
Remove the early return when currentScc is undefined. This ensures SCC mismatch is detected when workspace has a containerScc value but server has no SCC requirement (currentScc is undefined). Signed-off-by: Oleksii Orel <[email protected]>
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1436 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1436", name: che-dashboard}]}}]" |
Add unit tests to improve coverage for SCC mismatch related changes: - Add SCC mismatch tests to Provider.spec.tsx (WorkspaceActions) - Add SCC mismatch tests to StartWorkspace index.spec.tsx - Add currentScc parameter tests to devWorkspaceClient.spec.ts - Create Header test file with containerScc prop tests Assisted-by: Claude Signed-off-by: Oleksii Orel <[email protected]>
|
Docker image build succeeded: quay.io/eclipse/che-dashboard:pr-1436 kubectl patch commandkubectl patch -n eclipse-che "checluster/eclipse-che" --type=json -p="[{"op": "replace", "path": "/spec/components/dashboard/deployment", "value": {containers: [{image: "quay.io/eclipse/che-dashboard:pr-1436", name: che-dashboard}]}}]" |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: olexii4, tolusha The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
What does this PR do?
This PR implements a feature to detect and warn about DevWorkspaces with SCC (Security Context Constraint) mismatches in the Eclipse Che Dashboard.
When an administrator enables container run or build capabilities on the server, workspaces that were created before this change will have a different SCC than the current server configuration. These workspaces will display a warning status with an explanatory tooltip, but can still be started.
Key Changes:
selectCurrentSccselector - Detects the current SCC from server configuration based on container run/build capabilitiesgetContainerSccmethod - Retrieves the SCC attribute from a DevWorkspacecontainerRunCapabilitiesbranding docs URL - Added documentation link for the tooltipsccMismatch.tshelper module - Contains:SCC_MISMATCH_WARNING_MESSAGEconstant - Centralized warning message used across componentshasSccMismatchfunction - Determines if there's a mismatch between workspace and server SCCgetSccMismatchTooltipfunction - Generates the tooltip content with warning message and documentation linkWorkspaceStatusIndicatorupdate - Shows warning triangle icon with tooltip when workspace SCC doesn't match server SCC (only for stopped workspaces)WorkspaceStatusLabelupdate - Shows actual status with warning icon and tooltip when SCC mismatch is detected (only for stopped workspaces)StartingStepStartWorkspaceSCC check - Shows warning alert when starting workspace with SCC mismatch (does not block start)WorkspaceActionsProviderSCC check - Logs warning when starting workspace with SCC mismatch (does not block start)Behavior:
Note: SCC mismatch warning is only shown for stopped workspaces. Running or starting workspaces show their actual status.
Screenshot/screencast of this PR
What issues does this PR fix or reference?
fixes eclipse-che/che#23636
Is it tested? How?
Deploy Eclipse-Che with the image from this PR.
Test SCC Mismatch Detection:
Deploy Eclipse-Che with the image from this PR.:
Verify:
Test containerScc undefined scenario:
Verify:
Test no server SCC requirement:
Verify:
Test matching SCC:
Verify:
Release Notes
Docs PR