Skip to content
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

[CSP] Added object-src to Content-Security-Policy-Report-Only header #209306

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

elena-shostak
Copy link
Contributor

@elena-shostak elena-shostak commented Feb 3, 2025

Summary

Added support for object_src directive in reporting mode.

How to test

  • Add in your kibana.dev.yml.
server.customResponseHeaders.Reporting-Endpoints: violations-endpoint="https://localhost:5601/kibana/internal/security/analytics/_record_violations"
permissionsPolicy.report_to: [violations-endpoint]
  • Make sure you have dev tools configured for Reporting API.
  • Add <embed src="https://not-example.com/flash" /> anywhere in the page body in src/platform/plugins/shared/home/public/application/components/home.tsx
  • Open Dev Tools -> Console
    You should be able to see the violation
Screenshot 2025-02-03 at 14 30 03

Note

Hopefully, you should be able to see the violation in the Dev Tools -> Application -> Reporting, but it's sometimes hard to catch. My recent Chrome 132.0.6834.160 shows only CSP reports with disposition enforce, not report.

Checklist

  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines

Release Notes

Added object_src directive to Content-Security-Policy-Report-Only header.

Closes: #208590

Copy link
Contributor

github-actions bot commented Feb 3, 2025

It looks like this PR modifies one or more .asciidoc files. These files are being migrated to Markdown, and any changes merged now will be lost. See the migration guide for details.

Copy link
Contributor

github-actions bot commented Feb 3, 2025

A documentation preview will be available soon.

Request a new doc build by commenting
  • Rebuild this PR: run docs-build
  • Rebuild this PR and all Elastic docs: run docs-build rebuild

run docs-build is much faster than run docs-build rebuild. A rebuild should only be needed in rare situations.

If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here.

@elasticmachine
Copy link
Contributor

elasticmachine commented Feb 3, 2025

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!

@elena-shostak elena-shostak added Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! Feature:Security/CSP Platform Security - Content Security Policy labels Feb 3, 2025
@elena-shostak elena-shostak changed the title [CSP] Added object-src to Content-Security-Policy-Report-Only header [CSP] Added object-src to Content-Security-Policy-Report-Only header Feb 3, 2025
@elena-shostak elena-shostak changed the title [CSP] Added object-src to Content-Security-Policy-Report-Only header [CSP] Added object-src to Content-Security-Policy-Report-Only header Feb 3, 2025
Copy link
Contributor

github-actions bot commented Feb 3, 2025

It looks like this PR modifies one or more .asciidoc files. These files are being migrated to Markdown, and any changes merged now will be lost. See the migration guide for details.

@elasticmachine
Copy link
Contributor

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #9 / Alerting builtin alertTypes circuit_breakers index threshold rule that hits max alerts circuit breaker persist existing alerts to next execution if circuit breaker is hit
  • [job] [logs] Jest Integration Tests #1 / runs with default preResponse handlers does not allow overwriting of the "kbn-name", "Content-Security-Policy" and "Content-Security-Policy-Report-Only" headers
  • [job] [logs] Jest Integration Tests #1 / runs with default preResponse handlers does not allow overwriting of the "kbn-name", "Content-Security-Policy" and "Content-Security-Policy-Report-Only" headers
  • [job] [logs] Jest Tests #21 / useReplaceCustomField calls the api when invoked with the correct parameters

Metrics [docs]

✅ unchanged

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Security/CSP Platform Security - Content Security Policy release_note:enhancement Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add object_src to report-only Content Security Policy
2 participants