Skip to content

Update CSP for cookie banner#218

Open
hukho wants to merge 15 commits intomainfrom
bug/273113-cookie-prompt-2
Open

Update CSP for cookie banner#218
hukho wants to merge 15 commits intomainfrom
bug/273113-cookie-prompt-2

Conversation

@hukho
Copy link
Contributor

@hukho hukho commented Mar 5, 2026

PR Classification

Security and code cleanup: strengthens CSP enforcement and removes legacy configuration code.

PR Summary

This pull request enforces stricter Content Security Policy (CSP) rules and improves script security across the application, while removing outdated pipeline configuration code.

  • RequestConfigurationExtensions.cs: removed legacy request pipeline configuration extension.
  • RequestPipelineConfigExtensions.cs: updated to apply strict CSP rules, including strict-dynamic for scripts and blocking object/base URIs; uses report-only mode in DEBUG.
  • Razor view files (.cshtml): all script tags updated to include nws-csp-add-nonce="true" for automatic nonce generation and CSP compliance.
  • _Layout.cshtml and _ValidationScriptsPartial.cshtml: external script references (e.g., Google Tag Manager, jQuery, Bootstrap) now include nonce attribute.
  • CustomSecurityHeadersMiddleware.cs: minor refactoring for clarity.

@hukho hukho requested review from a team and rockydevnet as code owners March 5, 2026 17:19
@snyk-io-eu
Copy link

snyk-io-eu bot commented Mar 5, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copy link
Contributor

@JiviteshT JiviteshT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

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.

2 participants