Skip to content

Add netlify.toml configuration to set X-Frame-Options header to DENY#935

Merged
gardener-prow[bot] merged 1 commit intogardener:masterfrom
marc1404:ci/add-netlify-toml
Apr 16, 2026
Merged

Add netlify.toml configuration to set X-Frame-Options header to DENY#935
gardener-prow[bot] merged 1 commit intogardener:masterfrom
marc1404:ci/add-netlify-toml

Conversation

@marc1404
Copy link
Copy Markdown
Member

@marc1404 marc1404 commented Apr 14, 2026

How to categorize this PR?

/kind enhancement

What this PR does / why we need it:

Although there's (currently) no real risk from clickjacking attacks and alike, we still would like to set the X-Frame-Options: DENY header. Using Netlify, this can be done with a special _headers file in the public directory's root or with the netlify.toml file. I find the latter more explicit, and it allows for better configuration options (ref).

Which issue(s) this PR fixes:

n.a.

Special notes for your reviewer:

Once the preview has been deployed by Netlify, we can verify that the response header is set appropriately.

/cc @HeckEK @n-boshnakov

Summary by CodeRabbit

  • Chores
    • Added X-Frame-Options header configuration to apply across all application routes.

@marc1404 marc1404 requested a review from a team as a code owner April 14, 2026 12:38
@gardener-prow gardener-prow Bot requested review from HeckEK and n-boshnakov April 14, 2026 12:38
@gardener-prow gardener-prow Bot added the kind/enhancement Enhancement, improvement, extension label Apr 14, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 14, 2026

Deploy Preview for gardener-docs ready!

Name Link
🔨 Latest commit 6059f42
🔍 Latest deploy log https://app.netlify.com/projects/gardener-docs/deploys/69de3549b0bddc0008394788
😎 Deploy Preview https://deploy-preview-935--gardener-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 71 (🟢 up 4 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (no change from production)
PWA: 90 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@gardener-prow gardener-prow Bot added cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 14, 2026
@marc1404 marc1404 changed the title ci: Add netlify.toml configuration Add netlify.toml configuration to set X-Frame-Options header to DENY Apr 14, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 14, 2026

📝 Walkthrough

Walkthrough

A Netlify configuration file is updated to add a security header rule that applies the X-Frame-Options: DENY header to all HTTP responses across all routes, mitigating clickjacking attacks by preventing the site from being embedded in frames.

Changes

Cohort / File(s) Summary
Security Header Configuration
netlify.toml
Adds a Netlify header rule applying X-Frame-Options: DENY to all routes (/*), enforcing frame embedding restrictions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A frame so strong, a wall so high,
X-Frame-Options says "no, not I!"
Clickjackers beware, denied they'll be,
Security headers wild and free! 🔒

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description follows the template structure with categorization, explanation of purpose, and notes for reviewers, though the issue reference section is marked as n.a.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately describes the main change: adding a netlify.toml configuration file to set the X-Frame-Options header to DENY, which is the primary objective of this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@marc1404 marc1404 changed the title Add netlify.toml configuration to set X-Frame-Options header to DENY Add netlify.toml configuration to set X-Frame-Options header to DENY Apr 14, 2026
@marc1404
Copy link
Copy Markdown
Member Author

Screenshot 2026-04-14 at 14 42 26

The header is being set correctly.

Copy link
Copy Markdown
Member

@klocke-io klocke-io left a comment

Choose a reason for hiding this comment

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

/lgtm

@marc1404 thanks for pushing this

@gardener-prow gardener-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Apr 16, 2026
@gardener-prow
Copy link
Copy Markdown

gardener-prow Bot commented Apr 16, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: klocke-io

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gardener-prow
Copy link
Copy Markdown

gardener-prow Bot commented Apr 16, 2026

LGTM label has been added.

DetailsGit tree hash: 98ec19540d8c06b7abc77f1c3a2be2922cdd17a4

@gardener-prow gardener-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 16, 2026
@gardener-prow gardener-prow Bot merged commit d4f4e7b into gardener:master Apr 16, 2026
8 checks passed
@marc1404 marc1404 deleted the ci/add-netlify-toml branch April 16, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/enhancement Enhancement, improvement, extension lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants