Skip to content

security: add baseline security headers on Netlify - #639

Merged
mesutoezdil merged 2 commits into
Project-HAMi:masterfrom
mesutoezdil:security/netlify-headers
Jul 28, 2026
Merged

security: add baseline security headers on Netlify#639
mesutoezdil merged 2 commits into
Project-HAMi:masterfrom
mesutoezdil:security/netlify-headers

Conversation

@mesutoezdil

@mesutoezdil mesutoezdil commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What

Adds a for = "/*" headers block to netlify.toml with baseline security headers:

  • X-Content-Type-Options: nosniff blocks MIME sniffing
  • X-Frame-Options: SAMEORIGIN blocks clickjacking via third-party framing
  • Referrer-Policy: strict-origin-when-cross-origin avoids leaking full URLs to external sites
  • Permissions-Policy disables camera, microphone and geolocation, which the site never uses
  • Strict-Transport-Security (1 year) keeps browsers on https after the first visit; includeSubDomains is deliberately omitted so a future or legacy non-HTTPS subdomain cannot be hard-failed by a policy served from the apex

Existing per-path header blocks are untouched; Netlify merges them with the wildcard block.

Why

The site currently serves no security headers at all. These five are the standard no-risk baseline for a static documentation site; none of them can break Docusaurus functionality. A CSP is deliberately left out because Docusaurus relies on inline scripts and would need careful nonce handling.

Testing

  • netlify.toml parses as valid TOML (10 header blocks)
  • The Netlify deploy preview on this PR serves the new headers

Copilot AI review requested due to automatic review settings July 22, 2026 13:17
@hami-robot
hami-robot Bot requested review from archlitchi and rootsongjc July 22, 2026 13:17
@hami-robot

hami-robot Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mesutoezdil
Once this PR has been reviewed and has the lgtm label, please assign wawa0210 for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@netlify

netlify Bot commented Jul 22, 2026

Copy link
Copy Markdown

Deploy Preview for project-hami ready!

Name Link
🔨 Latest commit 2de341b
🔍 Latest deploy log https://app.netlify.com/projects/project-hami/deploys/6a63990f00d3210008a9780e
😎 Deploy Preview https://deploy-preview-639--project-hami.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

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

@hami-robot hami-robot Bot added the size/XS label Jul 22, 2026
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@mesutoezdil, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6be866bf-c328-4fe8-88d2-4fbc5f3a6a22

📥 Commits

Reviewing files that changed from the base of the PR and between bf4e9cf and 2de341b.

📒 Files selected for processing (1)
  • netlify.toml
✨ 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds baseline security headers to the Netlify deployment by introducing a global (for = "/*") headers rule in netlify.toml, intended to improve browser-side security defaults for the static Docusaurus site while preserving existing per-path header rules.

Changes:

  • Adds a wildcard Netlify [[headers]] block applying baseline security headers across all routes.
  • Keeps existing per-path header blocks (e.g., /.well-known/*, /robots.txt, /) intact to rely on Netlify’s header rule behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread netlify.toml Outdated
Adds nosniff, clickjacking protection, referrer policy, a minimal
permissions policy and HSTS for all site paths.

Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
Copilot AI review requested due to automatic review settings July 22, 2026 13:22
@mesutoezdil
mesutoezdil force-pushed the security/netlify-headers branch from 576389e to 243dcbb Compare July 22, 2026 13:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@mesutoezdil
mesutoezdil requested a review from windsonsea July 23, 2026 07:34

@rootsongjc rootsongjc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm

@hami-robot hami-robot Bot added the lgtm label Jul 28, 2026
@mesutoezdil
mesutoezdil merged commit 91f8c7c into Project-HAMi:master Jul 28, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants