Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
| Check name | Status | Explanation |
|---|---|---|
| Container-Privileges | The container-privileges check finds no introduced privileged container settings in PR #1114. Evidence: - The checkout is a single root commit (d15af38). It has no parent, so the PR patch cannot be di… |
|
| No-Sensitive-Data-In-Logs | No log statement in the default-workspace bootstrap code exposes a token, password, client secret, API key, session ID, PII, or customer data. Checked for CWE-532 (Insertion of Sensitive Information i… | |
| No-Hardcoded-Secrets | No hardcoded production secret found in the PR-scope code (CWE-798 not observed). Scope and evidence limits: - The local checkout is a single squashed commit (d15af38). No merge base with main exists,… | |
| No-Injection-Vectors | No explicit injection-vector condition from the check was found in the PR-related code. Evidence limits: The checkout is shallow. HEAD is one squashed commit with no reachable parent, so the PR patch … | |
| Ai-Attribution | Check ai-attribution applies only when AI tools were used and are mentioned in the PR or its commits. The PR description (title, summary, rollout notes, validation list, and screenshots section) does … |
Full details: Container-Privileges
-
Explanation
The container-privileges check finds no introduced privileged container settings in PR
#1114. Evidence: - The checkout is a single root commit (d15af38). It has no parent, so the PR patch cannot be diffed against a base. The verdict therefore relies on the PR's declared scope and on the files that implement the feature. - The PR description lists Go API, control-plane, TypeScript/UI, SDK/TUI contract, and E2E changes. It lists no Kubernetes manifest, Helm chart, or pod-spec change. - Files that implement the feature (for examplecomponents/api-server/plugins/defaultWorkspaceBootstrap/*,components/control-plane/internal/defaultworkspace/*,components/control-plane/internal/gateway/provisioning.go,components/api-server/plugins/gatewayAccess/*, and thepackages/gateway-management-uifiles) contain noprivileged,hostPID,hostNetwork,hostIPC,SYS_ADMIN,allowPrivilegeEscalation: true, or rootrunAsUser: 0settings. - A repository-wide search found privilege-related fields only in pre-existing manifests and scripts (for exampledeploy/*,charts/openshell/*,scripts/kind/up.sh). Those files are not part of the PR scope described. They are not attributed to this PR. - Where the Go container specs set security context, they setrunAsNonRoot: trueandallowPrivilegeEscalation: false(components/control-plane/internal/gateway/console.go,components/control-plane/internal/reconciler/agent_runtime_resources.go). - The bootstrap admin is a Keycloak service account with theopenshell-adminrole. This is an identity grant, not a container privilege, so it is outside this check. Residual gap: the PR patch itself is not available in this checkout. If the PR also changeddeploy/,charts/, orscripts/manifests, those changes were not inspected.
Full details: No-Sensitive-Data-In-Logs
-
Explanation
No log statement in the default-workspace bootstrap code exposes a token, password, client secret, API key, session ID, PII, or customer data. Checked for CWE-532 (Insertion of Sensitive Information into Log File). Evidence: - The checkout is one squashed commit with no parent. Git reports no merge base with origin/main. The PR diff therefore cannot be isolated. I did not treat the whole tree as PR-introduced. I reviewed the new bootstrap packages and the logging in the files the PR touches, by content. - components/control-plane/internal/defaultworkspace/manager.go:282-287 logs gateway_id, namespace, reason, and error when an Event create fails. None of these is a secret. - components/api-server/plugins/defaultWorkspaceBootstrap/service.go:94-98 logs gateway_id, subject_type, and error. It does not log the subject identity (username or email). The subject is persisted only in the audit record. - components/control-plane/internal/defaultworkspace/token_client.go:14-43 sends client_secret only in the POST body. Error returns are fixed strings or the HTTP status code. The response body is discarded, not logged. - components/control-plane/internal/defaultworkspace/openshell_client.go:48,74,108 places accessToken in gRPC metadata. It does not log it. - components/control-plane/internal/defaultworkspace/manager.go:301-341 handles the client secret through Kubernetes Secret storage and comparison only. It has no log call. - components/api-server/plugins/defaultWorkspaceBootstrap/plugin.go:21 and components/api-server/plugins/serviceAccounts/plugin.go:31,102 log configuration or reconciliation errors only. - components/control-plane/internal/reconciler/reconciler.go:940 logs client_id and the Keycloak client UUID. These are identifiers, not credentials. Residual gap: without a usable diff, I could not confirm which lines in existing files (for example main.go:215, which logs cfg.OIDCTokenEndpoint) are PR-introduced. Those lines do not log credentials, but the endpoint URL could name an internal host. This is an existing log, and the check's hostname clause does not change the result here.
Full details: No-Hardcoded-Secrets
-
Explanation
No hardcoded production secret found in the PR-scope code (CWE-798 not observed). Scope and evidence limits: - The local checkout is a single squashed commit (d15af38). No merge base with main exists, so the exact PR diff could not be isolated. I scanned the PR-scope packages in the current tree instead:
components/control-plane/internal/defaultworkspace,components/control-plane/cmd/hypershell-controller,components/api-server/plugins/defaultWorkspaceBootstrap,components/api-server/plugins/gatewayAccess,components/api-server/plugins/serviceAccounts,packages/gateway-management-ui/src, andcomponents/cli/pkg/gatewayaccess. Production code: - Secret-named identifiers are Kubernetes Secret names and data keys only (bootstrapAdminSecretName,clientSecretSecretKey,keycloakAdminSecretName, and similar). They are not credential values. - Environment reads (HYPERSHELL_SERVICE_ACCOUNT_PROVISIONER_ADDR,HELM_BINARY,HYPERSHELL_LOG_LEVEL,GATEWAY_API_BASE_DOMAIN) have no literal credential fallbacks. - No private key blocks, provider token prefixes (AKIA, ghp_, xox, sk-), JWTs, long base64 literals, or URLs with embedded credentials appear in these paths. Test fixtures: - Placeholder literals match the name-plus-literal heuristic. Examples:ClientSecret: "client-secret"indefaultworkspace/manager_test.go,"one-time-secret"inserviceAccountstests,{"access_token":"***REDACTED_SECRET_ASSIGNMENT***"}inmanager_test.go, and"client-secret": "***REDACTED_SECRET_ASSIGNMENT***"inkeycloak_admin_test.go. The frontend tests also useclientSecret: "***REDACTED_SECRET_ASSIGNMENT***". - These values are fake test doubles, not usable credentials. I did not treat them as a failure. If the policy requires flagging any literal assigned to a secret-named variable, including test doubles, this verdict would change to FAIL for those test lines. Conclusion: the PR-scope code introduces no real hardcoded credential.
Full details: No-Injection-Vectors
-
Explanation
No explicit injection-vector condition from the check was found in the PR-related code. Evidence limits: The checkout is shallow. HEAD is one squashed commit with no reachable parent, so the PR patch could not be isolated. I scanned the PR-named areas in the tree instead: the
defaultWorkspaceBootstrapandgatewayAccessplugins,serviceAccounts,control-plane/internal/defaultworkspace,hsctl/CLI gateway-access code, andgateway-management-uiaccess and service-account code. Results by check item: - SQL string concatenation (CWE-89): Not found. Filters use bound parameters, for exampleWhere("rb.gateway_id = ? ...", gatewayID, ...)andLIKE ... ESCAPEwith escaped bound patterns (gatewayAccess/dao.go48–57;serviceAccounts/dao.go103–113). The dynamicOrder(sortCol + " " + order)(gatewayAccess/dao.go68–80) andOrder(sortColumn + " " + direction)(serviceAccounts/dao.go119–131) use values from fixed maps, and direction is limited toASC/DESC. The migrationExecconcatenations (serviceAccounts/migration.go33, 46, 49) use the constantfuncTable. - shell=True, os.system, exec, or eval with user input (CWE-78, CWE-95): None in the scanned files. The Go bootstrap and control-plane code has noexecor shell calls. - Copy-paste shell commands in the UI:buildWorkspaceMembershipCommand(service-account-commands.ts36–51) quotessubjectthroughshellArgument, which escapes single quotes correctly (gateway-connections.ts44–50).WORKSPACE_NAME='${workspace}'is not escaped, but the only callers pass the constant"default"(workspace-access-command.tsx32, 88) or the constant placeholder. No user-controlled value reaches it. - pickle, yaml.load, dangerouslySetInnerHTML, innerHTML (CWE-502, CWE-79): None in the scanned files. Available workspace names render as React text (workspace-access-command.tsx121–133). Residual risk: A file outside the named PR areas could contain a match, and the full PR file list could not be confirmed from git.
Full details: Ai-Attribution
-
Explanation
Check ai-attribution applies only when AI tools were used and are mentioned in the PR or its commits. The PR description (title, summary, rollout notes, validation list, and screenshots section) does not mention any AI tool. The linked issue
#976also does not mention one. The PR's original commit subjects are unavailable. The local checkout is shallow and contains only one commit (d15af38, "fix(defaultworkspace): compare bootstrap secrets in constant time"), so the PR's commit messages could not be inspected. A repository-wide search for Assisted-by, Generated-by, Co-Authored-By, and common AI tool names in the available commit history returned no hits. No AI use is shown, so no attribution trailer is required and no Co-Authored-By for an AI tool is present in the evidence. The verdict is PASS on the absence of an AI-use mention. It does not confirm the PR's own commit trailers. If the contributor used AI tools, the commit messages must still be checked for an Assisted-by or Generated-by trailer.
Full details: No-Weak-Crypto
-
Explanation
FAIL: the PR adds a SHA-1 primitive, which the no-weak-crypto check flags. Finding 1 (matches "SHA1 usage"): - File: components/control-plane/internal/defaultworkspace/openshell_client.go, lines 153-155. - Code:
bootstrapRequestIDreturnsuuid.NewSHA1(uuid.NameSpaceURL, ...). - Caller: line 52 setsRequestId: bootstrapRequestID(namespace, subject, role)onAddWorkspaceMember. - Causality: the line is an added line ingit diff main HEAD(not present on main). The PR introduces it. - Context: the SHA-1 output is a deterministic UUIDv5 idempotency key for OpenShell replay handling. It is not used for secrecy, integrity, or authentication. Severity is low. The check still names SHA1 usage without a purpose exception, so the literal condition is met. CWE-327 and CWE-328 apply to the primitive. Checked and not flagged: - MD5, DES, 3DES, RC4, Blowfish, and ECB: no hits in the full PR diff (Go, TS, Python, shell, and config). - Custom crypto: none. The PR uses standardcrypto/tls,crypto/x509, andcrypto/subtle. Theecdsa/P256use is in test code only. - Secret/token comparison:writeAdmininmanager.gonow usessubtle.ConstantTimeComparethroughsecretValuesEqual(HEAD commit d15af38). This addresses the non-constant-time comparison condition (CWE-208). Remaining==/!=checks on secrets are emptiness checks or test fixtures. Evidence gap: the local clone has a shallow HEAD parent (3dd3d76) that is not an ancestor of main. Themain..HEADdiff was used as the PR patch.Resolution
- Replace
uuid.NewSHA1inbootstrapRequestID(openshell_client.go:154) with a SHA-256-based derivation. Build the UUID fromsha256output (for example, a UUIDv5-style layout with a SHA-256 digest), or use a stable non-cryptographic key. Keep the existing determinism and theopenshell_client_test.gostability checks. 2. If the check owner accepts non-security SHA-1 use, record a scoped exception forbootstrapRequestIDthat names its purpose. Do this in the check configuration, not in the code. 3. No change is required for the secret comparison. It already usessubtle.ConstantTimeCompare.
- Replace
|
Tick the box to add this pull request to the merge queue (same as
|
2824446 to
81fc094
Compare
81fc094 to
ad6b58b
Compare
Summary
openshell-userservice accounts.skip_default_workspace_bootstrapopt-out to the human user grant API and exposes it in the web console.DefaultWorkspaceBootstrapReadygateway provisioning condition as a mixed-version rollout compatibility boundary.defaultworkspace.Closes #976.
Console experience
defaultworkspace.defaultworkspace.Rollout behavior
The API server only calls OpenShell membership APIs for gateways whose
DefaultWorkspaceBootstrapReadyprovisioning condition is complete. Gateways without that completed condition, including gateways served by an older control plane during a mixed-version rollout, skip the one-shot bootstrap while user grants and service-account creation retain their pre-bootstrap success behavior.Once the new control plane starts or reconnects to the gateway watch stream, it reconciles existing gateways. For each converged gateway it validates the Keycloak client, ensures the bootstrap admin exists, and publishes the completed readiness condition. Small installations normally converge within seconds; larger fleets or transient Keycloak/Kubernetes failures can take longer and retry with the normal reconcile backoff. No strict API-server-before-control-plane or control-plane-before-api-server deployment order is required.
Existing gateways may be enrolled lazily by control-plane reconciliation. If an existing gateway remains unmarked, its access operations continue to succeed without default-workspace bootstrap. Once marked, subsequent eligible requests bootstrap automatically; requests that occurred while the gateway was unmarked are not retroactively repaired.
Idempotent membership handling
OpenShell can reject a duplicate membership add with
AlreadyExistsorFailedPrecondition, depending on whether its request-replay window has expired. HyperShell now treats an already-existing member as success:defaultworkspace membership list.AddMemberand returns success.AlreadyExists.FailedPrecondition, HyperShell rechecks membership and succeeds only when the principal is present; unrelated failures remain errors.This prevents a previously successful membership from causing later grant/regrant attempts to return
default_workspace_bootstrap_failed.Bootstrap admin permissions
The bootstrap admin is a persistent HyperShell-owned Keycloak service account, not a Kubernetes ServiceAccount and not a human User.
openshell-adminrole on exactly one gateway's Keycloak client.defaultworkspace.OpenShell currently has no narrower workspace-admin privilege, so the gateway-scoped
openshell-adminrole is broader than the single membership operation. HyperShell deliberately limits its own use to default-workspace membership management; narrowing the OpenShell privilege to a dedicated workspace-admin role is documented as a follow-up contract change.Screenshots
Users
Service accounts
Validation
API_ENV=integration_testing go test ./plugins/gatewayAccess -count=1API_ENV=unit_testing go test ./plugins/serviceAccounts -count=1go test ./...incomponents/control-planepnpm --filter @openshift-online/hypershell-gateway-management-ui checkmake check-forbidden-dom-injection201 Created