-
Notifications
You must be signed in to change notification settings - Fork 40
Bugfix/coep default header value #173
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
base: main
Are you sure you want to change the base?
Bugfix/coep default header value #173
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements support for the experimental Reporting-Endpoints HTTP header, which allows website administrators to specify endpoints for receiving reports from the browser's Reporting API. The header is intended to work with Content Security Policy (CSP) and other security policies that can generate violation reports.
- Adds
ReportingEndpointsPolicy
model with configuration and header value generation - Implements middleware support for the new header with
UseReportingEndpointsPolicy
extension method - Updates CSP configuration to support the modern
report-to
directive alongside the deprecatedreport-uri
Reviewed Changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
src/Models/ReportingEndpointsPolicy.cs |
New model class for configuring Reporting-Endpoints header with endpoint name-to-URI mappings |
src/Extensions/SecureHeadersMiddlewareBuilder.cs |
Adds builder method for configuring Reporting-Endpoints policy and updates CSP methods |
src/Models/ContentSecurityPolicyConfiguration.cs |
Adds support for report-to directive and marks report-uri as obsolete |
src/Extensions/StringBuilderExtensions.cs |
New utility method for removing trailing characters from StringBuilder |
tests/OwaspHeaders.Core.Tests/CustomHeaders/ReportingEndpointsTests.cs |
Test coverage for the new Reporting-Endpoints functionality |
docs/configuration/ReportingEndpoints.md |
Documentation for the experimental header with appropriate warnings |
As PR #189 will likely be merged ahead of this one, we'll need a version bump on this PR. |
Deleted the wrong branch when trying to clean up. Sorry all. |
Rationale for this PR
This PR adds the Reporting-Endpoints header, configuration for it, updates the relevant documentation, and increases the version number.
This PR closes #170
The following is a minimal code sample for the new feature:
PR Checklist
Feel free to either check the following items (by place an
x
inside of the square brackets) or by replacing the square brackets with a relevant emoji from the following list:Essential
These items are essential and must be completed for each commit. If they are not completed, the PR may not be accepted.
dotnet-format
command and fixed any .editorconfig issuesOptional
Any Other Information
This PR adds experimental functionality. Depending on feedback, it might not be closed.