Repository navigation
Conversation
P2.7 (vault-fail-closed) corrupted the shared openshell-vault/openshell-gateway-vault-tls ca.crt and restored it only from a Go defer. A cancelled CI job left an orphaned e2e.test that was SIGKILLed mid-step on 2026-11-20, and vault.sh reused the broken Secret, so every OpenShift e2e on the shared cluster failed in P1. - vault.sh copies the validated CA into the environment namespace (hypershell-vault-ca); the OpenShift and Kind drivers point GATEWAY_VAULT_CA_SECRET at that copy. - P2.7 discovers the CA Secret from the controller env, refuses the shared namespace, refuses to save a non-PEM "original", and restores via t.Cleanup plus an idempotent defer. - vault.sh validates a reused TLS Secret (openssl verify) and regenerates it, then reloads Vault TLS with SIGHUP (storage is emptyDir, so a restart would wipe Vault). - Fake-Vault unit tests for the probes and the reconciler fail-closed path. - Spec text for OSG-CRED-14 and the e2e phase list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Ai-Attribution | AI use is disclosed, and the attribution is wrong. Evidence: - The PR description ends with "Generated with Claude Code". This states AI tool use. - The only commit i… | Amend the commit message on branch claude/fix-p2-7-vault-ca-isolation-cde9f5: 1. Remove the line Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>. 2. Add an Assisted-by or Generated-by trailer that names the AI tool and model, … |

Passed checks: 5 passed
-
Check name Status Explanation No-Weak-Crypto PR #1167(openshift-online/hypershell, author rh-amarin) introduces no weak cryptography. Checked against the committed diff (origin/main..HEAD, 15 files, non-Markdown). Findings by criterion: - Weak …Container-Privileges The check flags privileged: true, hostPID, hostNetwork, hostIPC, SYS_ADMIN, root without justification, and allowPrivilegeEscalation: true in container or Kubernetes manifests. The PR (openshift-onlin… No-Sensitive-Data-In-Logs Scope: CWE-532 (Insertion of Sensitive Information into Log File). Diff reviewed as main..HEAD (main=b5b5f36, HEAD=e8bd19f) across 15 files. Added log, echo, and print statements checked: - scripts/cl… No-Hardcoded-Secrets No hardcoded secret found in the PR diff (main..HEAD, 15 files, commit e8bd19f on top of main b5b5f36). Checks run on added lines only: - Private key PEM blocks ( BEGIN ... PRIVATE KEY): none added. …No-Injection-Vectors No injection vector from the listed classes is introduced by PR #1167(head e8bd19f). Scope and method: - The clone is shallow. HEAD is a grafted root, sogit diff main...HEADhas no merge base. - I…Full details: No-Weak-Crypto
-
Explanation
PR
#1167(openshift-online/hypershell, author rh-amarin) introduces no weak cryptography. Checked against the committed diff (origin/main..HEAD, 15 files, non-Markdown). Findings by criterion: - Weak algorithms (MD5, SHA1, DES, 3DES, RC4, Blowfish, ECB): no added lines reference these primitives. A word-boundary scan of the added lines returned no matches. Related CWE: CWE-327 (broken or risky algorithm). Not triggered. - Custom crypto: none. The new code calls standard libraries only.vault_probe_test.gogenerates a test CA withecdsa.GenerateKey(elliptic.P256())andx509.CreateCertificate.scripts/cluster/vault-tls.shvalidates chains withopenssl x509andopenssl verify. Certificate and key generation reuses the existingscripts/gen-postgres-tls.sh, which is unchanged and uses RSA-2048 with SHA-256. Related CWE: CWE-327. Not triggered. - Non-constant-time comparison of secrets or tokens (CWE-208): no comparison touches a secret or token. -scripts/cluster/vault.sh(around line 518) compares base64tls.crtvalues with=.tls.crtis a public certificate, not a secret. Thetls.keyis not compared. -scripts/cluster/vault-tls_test.shcompares fixture strings in a test helper. -tests/e2e/vault_phases.gocompares env var names and certificate PEM block types, not credentials. - The Go probe test uses a fixed fake token (hvs.PROBE) and does not compare it. Residual note: the shell=comparison on certificate bytes is not constant-time. It is not a secret comparison, so this check does not cover it.
Full details: Container-Privileges
-
Explanation
The check flags privileged: true, hostPID, hostNetwork, hostIPC, SYS_ADMIN, root without justification, and allowPrivilegeEscalation: true in container or Kubernetes manifests. The PR (openshift-online/hypershell
#1167, head e8bd19f against base b5b5f36) does not add any of these. Evidence: - The diff touches 15 files. Only one is a Kubernetes manifest: deploy/kind/kustomization.yaml. Its change adds one env var, GATEWAY_VAULT_CA_SECRET=hypershell-system/hypershell-vault-ca. It adds no securityContext, capability, host namespace, or privilege setting. - A search of added and removed diff lines found no matches for privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, allowPrivilegeEscalation, runAsUser, runAsNonRoot, hostPath, or securityContext. - The openshift.sh change adds an oc set env call for the same env var. The vault.sh and vault-tls.sh changes copy a CA Secret and run openssl checks. None of these changes creates or alters a pod spec. - The only "capabilities" hits are gateway capability labels in Go e2e test code (for example, "runtime/kata"). These are not Linux capabilities. No manifest in the PR adds or changes a flagged setting.
Full details: No-Sensitive-Data-In-Logs
-
Explanation
Scope: CWE-532 (Insertion of Sensitive Information into Log File). Diff reviewed as main..HEAD (main=b5b5f36, HEAD=e8bd19f) across 15 files. Added log, echo, and print statements checked: - scripts/cluster/vault.sh:
success/error/infomessages name only the TLS Secret (${VAULT_TLS_SECRET}) and the copy target (${VAULT_CA_COPY_NAMESPACE}/${VAULT_CA_COPY_SECRET}). No CA bytes, tls.key, or tokens are printed.openssl x509andopenssl verifyoutput is redirected to /dev/null. The SIGHUP block prints no certificate content. - scripts/cluster/drivers/openshift.sh:infoprints the namespace/secret name forGATEWAY_VAULT_CA_SECRET. This is a name, not a secret value. - tests/e2e/vault_phases.go:t.LogfWARN lines print the Secret namespace/name and the Kubernetes API error. They do not printData[ca.crt], the original CA, or the broken placeholder. - components/control-plane/internal/gateway/vault_probe_test.go: the fake client tokenhvs.PROBEis a test fixture and is not logged.t.Errorfmessages print only namespace, role, and report struct values. - No new Go production logging calls were found in the diff. No new logging exposes passwords, tokens, API keys, PII, session IDs, internal hostnames, or customer data. Namespace and Secret names appear in logs. The check does not list them as sensitive. Limit: the shallow checkout exposes only the PR commit and base history. The review covers the added lines, not pre-existing output that vault.sh or openshift.sh already produced.
Full details: No-Hardcoded-Secrets
-
Explanation
No hardcoded secret found in the PR diff (main..HEAD, 15 files, commit e8bd19f on top of main b5b5f36). Checks run on added lines only: - Private key PEM blocks (
BEGIN ... PRIVATE KEY): none added. - Cloud and SaaS key formats (AKIA, ghp_, xox, sk-, Vaults.): none added. - URLs with embedded credentials (scheme://user:***REDACTED_URI_PASSWORD***@host): none added. - Long base64-like literals (33+ chars): none. The matches were Go identifiers such as test function names. - Variables named token, secret, password, key, or cred assigned string literals: none with a real value. Secret-related names hold Secret object names (hypershell-vault-ca) or env var names (GATEWAY_VAULT_CA_SECRET), which are not credentials. One literal needs a note.components/control-plane/internal/gateway/vault_probe_test.goreturns{"auth":{"client_token":"***REDACTED_SECRET_ASSIGNMENT***"}}from anhttptest.NewTLSServerfake Vault (lines 47 and 162 of the added code). The value uses the Vaulthvs.prefix, but it is a fixed placeholder. It is not a live token. It appears only in test code and does not match a credential format that CWE-798 would cover. It does not trigger the check. Maintainers may prefer a non-prefixed placeholder to avoid secret-scanner alerts. Other literals in the diff, such asfail-closed-e2e: not a certificateand the fake CA PEM generated at runtime, are test fixtures. They are not secrets.
Full details: No-Injection-Vectors
-
Explanation
No injection vector from the listed classes is introduced by PR
#1167(head e8bd19f). Scope and method: - The clone is shallow. HEAD is a grafted root, sogit diff main...HEADhas no merge base. - I compared each PR-related file toorigin/maindirectly. Changed files:scripts/cluster/vault.sh,scripts/cluster/drivers/openshift.sh,scripts/kind/up.sh,deploy/kind/kustomization.yaml,tests/e2e/suite.go,tests/e2e/vault_phases.go, and the two spec files.components/control-plane/internal/gateway/vault_probe_test.gois new.vault_probe.gois unchanged. Check against each listed class: - SQL concatenation (CWE-89): no SQL or database query code in the changed files. -shell=Trueor shell command built from user input (CWE-78): no Python. The new shell code passes variables as quoted arguments tovkube,oc_cli set env, andkubectl. TheGATEWAY_VAULT_CA_SECRETvalue is built fromOPENSHIFT_NAMESPACE, which is operator configuration. Noeval,sh -c,bash -c, orxargsappears in added lines. -evalorexecon untrusted data (CWE-95): none. The onlyexecisvkube ... exec "${VPOD}" -- cat /vault/tls/tls.crtandkill -HUP 1, both with fixed arguments. -pickle.loads(CWE-502) andyaml.loadwithout SafeLoader: no Python or YAML deserialization in the diff. -os.systemwith variables: not used. -dangerouslySetInnerHTML(CWE-79): no frontend changes in the PR. Go changes: -vault_phases.goparses the controller env value withstrings.Cut. It uses PEM decoding andx509.ParseCertificate. It does not pass the value to a shell or query. -vault_probe_test.gouseshttptestfake servers and JSON decoding of test requests. I checked it with pattern searches only, not a full line-by-line read. Pattern hits show noexec,Sprintf-built command, SQL, or unsafe deserialization. Residual gap: the base comparison covers the files the PR changes. It does not show a full PR patch. This does not change the result, because no sink in the listed classes appears in any added line I inspected.
-
Full details: Ai-Attribution
-
Explanation
AI use is disclosed, and the attribution is wrong. Evidence: - The PR description ends with "Generated with Claude Code". This states AI tool use. - The only commit in the PR (
main..HEAD, e8bd19f, author Angel Marin <amarin@redhat.com>) ends withCo-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>. - The commit has noAssisted-byorGenerated-bytrailer. A search of the last 30 commits found no such trailer. The check requires Red Hat attribution throughAssisted-byorGenerated-bytrailers. It also flagsCo-Authored-Byfor AI tools. The commit uses the flagged form and lacks the required trailer. Scope: the author identity and PR number were taken from the provider record (PR#1167, author login rh-amarin). The commit text came from the local checkout. The PR description and commit text are contributor-authored, but they are used here only as evidence of AI use and trailer format.Resolution
Amend the commit message on branch claude/fix-p2-7-vault-ca-isolation-cde9f5: 1. Remove the line
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>. 2. Add anAssisted-byorGenerated-bytrailer that names the AI tool and model, following the Red Hat attribution convention. 3. Force-push the amended commit. 4. Optionally, replace the "Generated with Claude Code" footer in the PR description with the same attribution, so the PR body and commit agree.
HyperShell environment destroyedThis ephemeral OpenShift environment has been destroyed. Comment |
|
Tick the box to add this pull request to the merge queue (same as
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1167 +/- ##
==========================================
+ Coverage 46.92% 47.04% +0.12%
==========================================
Files 424 424
Lines 33633 33633
==========================================
+ Hits 15783 15824 +41
+ Misses 15896 15852 -44
- Partials 1954 1957 +3
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
The per-environment CA copy already keeps P2.7 away from the shared Secret, so the reuse check, regeneration and SIGHUP reload are not needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Incident
Since 2026-11-20, every OpenShift e2e on the shared CI cluster hysh-aws-01 fails in P1 with "Vault credential backend is unreachable". The controller logs "vault CA bundle contains no usable certificate".
What happened:
e2e.testkept running and reached P2.7 (vault-fail-closed).openshell-vault/openshell-gateway-vault-tlsca.crtwith a placeholder. It restores the CA only from a Godefer.scripts/cluster/vault.shreuses an existing TLS Secret without checking it, so the broken CA persisted for every later PR environment.This PR does not repair the live cluster. That is handled separately.
Fix
vault.shcopiesca.crtinto the environment's own namespace (Secrethypershell-vault-ca,VAULT_CA_COPY_NAMESPACE). The OpenShift driver (oc set env) and the Kind overlay setGATEWAY_VAULT_CA_SECRET=<env-ns>/hypershell-vault-caon the controller. The controller ClusterRole already grants Secret reads.GATEWAY_VAULT_CA_SECRET. It refuses to run when the env var is unset or namesopenshell-vault.ca.crtis not a valid PEM certificate, so a broken value is never saved as the "original". The restore is idempotent and is registered with botht.Cleanupanddefer.vault_probe_test.goruns fake-Vault (httptest.NewTLSServer) cases: non-PEM CA, CA from a different authority, sealed Vault (503), missing CA Secret, theGATEWAY_VAULT_CA_SECREToverride, and denied login.ReconcileGatewaymarksEnvironmentReadyFailed and stops before any deploy step or cluster write when the probe fails.openshell-gateway-credentials.spec.md(OSG-CRED-14 text, 14.02, coverage boundaries) and the P2.7 entry ine2e-testing.spec.md.vault.shstill reuses an existing shared TLS Secret without checking it. That is enough now, because P2.7 no longer writes to the shared Secret.Verification
make check: passcd components/control-plane && go test ./...: passmake ci-test: six unrelated suites fail the same way on unmodifiedmain:deploy/oce-kind/{automation,install-oce,readme,render-oce}_test.sh,scripts/funnel-dispatch_test.sh,scripts/skillspector-scan_test.sh.🤖 Generated with Claude Code