OGSEC-39 Add anti-clickjacking security headers to ZGW API - #208
Open
roxit-ai-agent wants to merge 1 commit into
Open
OGSEC-39 Add anti-clickjacking security headers to ZGW API#208roxit-ai-agent wants to merge 1 commit into
roxit-ai-agent wants to merge 1 commit into
Conversation
…eline Introduce a SecurityHeadersMiddleware in OneGround.ZGW.Common.Web that sets X-Frame-Options: DENY and Content-Security-Policy: frame-ancestors 'none' via Response.OnStarting, and wire it as the first call in ConfigureZgwApi so every ZGW API host (and its Swagger UI and error responses) emits the headers. The headers are set through OnStarting and assigned (not added) so they survive the response re-executed by UseExceptionHandler and cannot be duplicated by a second registration. Adds unit tests covering a successful response and an exception-handled response. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: roxit-ai-agent <316607320+roxit-ai-agent@users.noreply.github.com>
Grabauskas
force-pushed
the
OGSEC-39-anti-clickjacking-headers
branch
from
August 13, 2026 14:46
f6bd2eb to
b4de562
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Introduce a SecurityHeadersMiddleware in OneGround.ZGW.Common.Web that sets X-Frame-Options: DENY and Content-Security-Policy: frame-ancestors 'none' via Response.OnStarting, and wire it as the first call in ConfigureZgwApi so every ZGW API host (and its Swagger UI and error responses) emits the headers.
The headers are set through OnStarting and assigned (not added) so they survive the response re-executed by UseExceptionHandler and cannot be duplicated by a second registration. Adds unit tests covering a successful response and an exception-handled response.
Type of Change
Related Issues
Testing
Checklist