Skip to content

fix(api7ee): harden Dashboard cookie and CSP defaults (3.9) - #444

Open
hanzhenfang wants to merge 2 commits into
release/3.9from
fix/dashboard-browser-defaults-3.9
Open

hanzhenfang wants to merge 2 commits into
release/3.9from
fix/dashboard-browser-defaults-3.9

Conversation

@hanzhenfang

@hanzhenfang hanzhenfang commented Nov 30, 2026 •

Copy link
Copy Markdown

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', and frame-ancestors 'self'.

Compatibility review

  • HTTP-only installations must explicitly set dashboard_configuration.session_options_config.secure: false to retain login over plain HTTP. The new default also applies when an HTTPS ingress forwards over HTTP.
  • Sites that embed the Dashboard in a cross-origin iframe must supply a CSP allowing the portal origin.
  • Please review whether these changes to existing installation defaults are suitable for the 3.9 maintenance line. The chart patch advances from 3.9.16 to 3.9.17 (appVersion 3.9.25). The README was regenerated with helm-docs v1.13.1 and a second generation produced no further changes.

Validation

  • On the PR base (appVersion 3.9.25), Helm lint passed. Rendered the Dashboard ConfigMap with the default and an explicit false override and checked the resulting cookie setting and CSP.
  • Browser smoke test on Dashboard 3.9.13 with the same values change: HTTPS login returned a Secure session cookie, the authenticated session survived reload, and the Monaco plugin editor saved and reloaded changes. Same-origin embedding worked and Chrome blocked cross-origin embedding under frame-ancestors.

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 77fb72cb-b7d4-4e00-9c00-5ad1a0816e0e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
Pre-merge checks: Passed 1 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
E2e Test Quality Review Warning E2E Completeness (Blocking) is not met. PR #444 (api7/api7-helm-chart, base release/3.9, head fix/dashboard-browser-defaults-3.9, author hanzhenfang) changes only chart files. Verified against… 1. 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 new `Content-S…
Passed Passed checks: 1 passed

Check name Status Explanation
Security Check Passed 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.yaml in two places. dashboard_configuration.session_options_config.secure moves from false to true. The Dashboard content_security_policy gains object-src 'none', base-uri 'self' and frame-ancestors 'self'. - Commit 73aa9eb changes Chart.yaml (version 3.9.16 to 3.9.17) and the regenerated README.md. It has no logic changes. - No template, code, logging, serialization, storage, permission, or TLS verification files changed. git diff 652a6ec HEAD lists 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: true is the secure value. It is not an inverted flag. insecure_skip_verify stays false. 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, base release/3.9, head fix/dashboard-browser-defaults-3.9, author hanzhenfang) changes only chart files. Verified against the head commits f36756c and 73aa9eb: - charts/api7/values.yaml: session_options_config.secure changes from false to true, and dashboard_configuration.security.content_security_policy is now set to the policy with object-src 'none'; base-uri 'self'; frame-ancestors 'self' added. - charts/api7/Chart.yaml and charts/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 under charts/. The existing CI (.github/workflows/ci.yaml) runs ct install and 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 by frame-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

  1. 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 new Content-Security-Policy directives. Add it to CI, for example as a ct install extra or a dedicated job. 2. Add scenario tests for the following cases: - HTTP-only install with dashboard_configuration.session_options_config.secure: false keeps login working and the cookie is not Secure. - Cross-origin framing is blocked under frame-ancestors 'self'. Same-origin framing is allowed. - An explicit custom content_security_policy overrides 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.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@hanzhenfang
hanzhenfang marked this pull request as ready for review November 30, 2026 06:56

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant