Repository navigation
fix(api7ee): harden Dashboard cookie and CSP defaults (3.9) - #444
hanzhenfang wants to merge 2 commits into
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
|
| Check name | Status | Explanation |
|---|---|---|
| Security Check | The Security Check passes. The PR changes only Helm chart defaults and docs, and those changes tighten security settings. I confirmed the change set against the checked-out history (base 652a6ec, head… |
Full details: Security Check
-
Explanation
The Security Check passes. The PR changes only Helm chart defaults and docs, and those changes tighten security settings. I confirmed the change set against the checked-out history (base 652a6ec, head 73aa9eb). - Commit f36756c changes
charts/api7/values.yamlin two places.dashboard_configuration.session_options_config.securemoves fromfalsetotrue. The Dashboardcontent_security_policygainsobject-src 'none',base-uri 'self'andframe-ancestors 'self'. - Commit 73aa9eb changesChart.yaml(version 3.9.16 to 3.9.17) and the regeneratedREADME.md. It has no logic changes. - No template, code, logging, serialization, storage, permission, or TLS verification files changed.git diff 652a6ec HEADlists only these three files. Category by category: 1. Sensitive data exposure: No logging, serialization, or response code changed. No issues found. 2. Unencrypted secrets in the database: No persistence code or migrations changed. No issues found. 3. Authorization bypass: No handler or permission code changed. No issues found. 4. Cross-resource access: No API code changed. No issues found. 5. TLS and cryptographic configuration:secure: trueis the secure value. It is not an inverted flag.insecure_skip_verifystaysfalse. The check is satisfied. 6. Resource isolation: No shared-resource code changed. No issues found. 7. Secret reference resolution: No$env://or$secret://handling changed. No issues found. The PR description says that HTTP-only installs and cross-origin iframe embeds break unless they set overrides. That is a compatibility effect. It does not match any failure condition in this check, so it does not change the verdict.
Full details: E2e Test Quality Review
-
Explanation
E2E Completeness (Blocking) is not met. PR
#444(api7/api7-helm-chart, baserelease/3.9, headfix/dashboard-browser-defaults-3.9, author hanzhenfang) changes only chart files. Verified against the head commitsf36756cand73aa9eb: -charts/api7/values.yaml:session_options_config.securechanges fromfalsetotrue, anddashboard_configuration.security.content_security_policyis now set to the policy withobject-src 'none'; base-uri 'self'; frame-ancestors 'self'added. -charts/api7/Chart.yamlandcharts/api7/README.md: version bump to 3.9.17 and regenerated docs. No test file is added or changed. A repository search for test, e2e, spec, and cypress/playwright paths returned nothing undercharts/. The existing CI (.github/workflows/ci.yaml) runsct installand helm-docs. That install step does not exercise the Dashboard cookie flag or the CSP header, so it does not cover this behavior change. The PR description reports validation:helm lint, a rendered ConfigMap check, and a manual browser smoke test on Dashboard 3.9.13. None of this is committed as an automated test. Manual checks do not meet the E2E test requirement for the business flow (HTTPS login → Secure session cookie → CSP enforcement). Scenario Coverage (Important), not assessed in full. No tests cover the HTTP-only override (secure: false), the cross-origin iframe case blocked byframe-ancestors, or invalid or empty CSP values. These gaps are also Major findings. Other criteria. The PR scope is limited to the defaults change, the chart version bump, and generated docs. These changes relate to the PR goal, so no unrelated-change finding applies. No new code logic was added, so no concurrency or error-handling finding applies. Result. FAIL on the blocking E2E Completeness criterion. The PR changes runtime behavior and adds no automated end-to-end coverage for it.Resolution
- Add an automated E2E test that installs the chart and checks the full Dashboard flow. It should run HTTPS login and assert the session cookie carries
Secure. It should also assert that the Dashboard response includes the newContent-Security-Policydirectives. Add it to CI, for example as act installextra or a dedicated job. 2. Add scenario tests for the following cases: - HTTP-only install withdashboard_configuration.session_options_config.secure: falsekeeps login working and the cookie is notSecure. - Cross-origin framing is blocked underframe-ancestors 'self'. Same-origin framing is allowed. - An explicit customcontent_security_policyoverrides the default. 3. Commit the test code and its CI wiring to this PR. Do not rely on the manual smoke test in the PR description. 4. Keep the helm-docs regeneration and version bump as they are. They do not need changes for this check.
- Add an automated E2E test that installs the chart and checks the full Dashboard flow. It should run HTTPS login and assert the session cookie carries
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Summary
Enable Secure for the Dashboard session cookie by default in the API7 chart. Set the Dashboard CSP to the existing policy plus
object-src 'none',base-uri 'self', andframe-ancestors 'self'.Compatibility review
dashboard_configuration.session_options_config.secure: falseto retain login over plain HTTP. The new default also applies when an HTTPS ingress forwards over HTTP.Validation