Skip to content

Add Kestrel security considerations article#37328

Merged
BrennanConroy merged 4 commits into
mainfrom
brennanconroy-kestrel-security-considerations-doc
Jul 16, 2026
Merged

Add Kestrel security considerations article#37328
BrennanConroy merged 4 commits into
mainfrom
brennanconroy-kestrel-security-considerations-doc

Conversation

@BrennanConroy

@BrennanConroy BrennanConroy commented Jul 9, 2026

Copy link
Copy Markdown
Member

Why

Kestrel has a large surface of security-relevant behaviors, configurable limits, and request-parsing decisions that weren't documented anywhere. This publishes that guidance as a proper Learn article so application developers configuring Kestrel in production and security auditors reviewing its threat surface have a single reference.

What

  • Adds aspnetcore/fundamentals/servers/kestrel/security-considerations.md, a new article covering trust boundaries and reverse-proxy topologies, transport security (TLS/mTLS), HTTP/1.1, HTTP/2, and HTTP/3 limits, request smuggling and parsing validation, forwarded headers, host filtering, rate limiting, WebSockets, named pipes, monitoring/metrics, and a production security checklist.
  • Adds a "Security considerations" entry under the Kestrel node in aspnetcore/toc.yml.

Notes for reviewers

  • Content was adapted from the source file to Learn conventions: frontmatter, sentence-case headings, Learn alerts (NOTE/TIP/IMPORTANT/WARNING), xref/site-relative links, and contractions.
  • API names are kept as inline code rather than <xref:...> cross-references to avoid fabricating unverified API doc IDs, per the repo's guidance. These can be linked later once IDs are confirmed.
  • Uses the not-latest-version-without-not-supported-content.md include, which is the required variant for articles targeting >= aspnetcore-8.0.
  • All in-page anchors, xref uids, the metrics bookmark, the include path, and external links were verified to resolve.
  • monikerRange is set to >= aspnetcore-8.0; adjust if a different lower bound is preferred.

This content is AI-assisted (ai-usage: ai-assisted in frontmatter).


Internal previews

📄 File 🔗 Preview link
aspnetcore/fundamentals/servers/kestrel/security-considerations.md aspnetcore/fundamentals/servers/kestrel/security-considerations
aspnetcore/toc.yml aspnetcore/toc

BrennanConroy and others added 2 commits July 9, 2026 15:42
Publish a new Learn article covering Kestrel's security considerations, configurable limits, and request-parsing behavior, and add a TOC entry under the Kestrel node.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Spell out 'and' in section headings (replacing '&' and '/') so the OPS-generated bookmarks use clean single-dash anchors, and update the in-page links to match. Resolves the bookmark-not-found build warnings.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@BrennanConroy
BrennanConroy marked this pull request as ready for review July 9, 2026 23:04
Comment thread aspnetcore/fundamentals/servers/kestrel/security-considerations.md Outdated
Comment thread aspnetcore/fundamentals/servers/kestrel/security-considerations.md Outdated

@wadepickett wadepickett 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.

Looks great! Approved. See my two suggestions inline.

@wadepickett

Copy link
Copy Markdown
Contributor

@tdykstra, watch in case any timely review merge help needed, since I am not available for a week starting today.

Comment thread aspnetcore/fundamentals/servers/kestrel/security-considerations.md
Comment thread aspnetcore/fundamentals/servers/kestrel/security-considerations.md Outdated
@SamMonoRT

Copy link
Copy Markdown
Member

cc fyi - @GrabYourPitchforks @blowdart @artl93

@blowdart

Copy link
Copy Markdown
Contributor

🥂

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@BrennanConroy

Copy link
Copy Markdown
Member Author

@tdykstra Need a new approval since a new commit was made.

@DeagleGross DeagleGross left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great article, I really like the ordering of story telling here starting from server topology and going into details of specific defence mechanisms.

Left comments, but up to you to react to them. Sorry for taking longer time to review

Comment thread aspnetcore/fundamentals/servers/kestrel/security-considerations.md Outdated
Comment thread aspnetcore/fundamentals/servers/kestrel/security-considerations.md Outdated
| [**HSTS**](#http-strict-transport-security-hsts) | Not enabled | Enable | Enable | [Security Middleware](#security-middleware) |
| [**Forwarded Headers**](#forwarded-headers) | Not enabled | **Don't enable** | Enable with `KnownProxies` | [Security Middleware](#security-middleware) |
| [**Rate Limiting**](#rate-limiting) | Disabled | Enable | Enable (app-level) | [Security Middleware](#security-middleware) |
| [**CORS**](#cors) | Disabled | Configure per API (if needed) | Configure per API (if needed) | [Security Middleware](#security-middleware) |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

do we want to add a section about Antiforgery?

Comment thread aspnetcore/fundamentals/servers/kestrel/security-considerations.md Outdated
Co-authored-by: Korolev Dmitry <dmkorolev@microsoft.com>
Co-authored-by: Brennan <brecon@microsoft.com>
@BrennanConroy
BrennanConroy merged commit d46a8f3 into main Jul 16, 2026
4 checks passed
@BrennanConroy
BrennanConroy deleted the brennanconroy-kestrel-security-considerations-doc branch July 16, 2026 17:25
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.

6 participants