Skip to content

Commit bbf2327

Browse files
authored
Customizable security descriptors for HTTP.sys (#35616)
1 parent 4ebaeea commit bbf2327

File tree

3 files changed

+375
-4
lines changed

3 files changed

+375
-4
lines changed

aspnetcore/fundamentals/servers/httpsys.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn about HTTP.sys, a web server for ASP.NET Core on Windows. Bui
55
monikerRange: '>= aspnetcore-2.1'
66
ms.author: tdykstra
77
ms.custom: mvc
8-
ms.date: 10/30/2023
8+
ms.date: 06/12/2025
99
uid: fundamentals/servers/httpsys
1010
---
1111
# HTTP.sys web server implementation in ASP.NET Core
@@ -14,7 +14,7 @@ uid: fundamentals/servers/httpsys
1414

1515
By [Tom Dykstra](https://github.com/tdykstra) and [Chris Ross](https://github.com/Tratcher)
1616

17-
:::moniker range=">= aspnetcore-8.0"
17+
:::moniker range=">= aspnetcore-10.0"
1818

1919
[HTTP.sys](/iis/get-started/introduction-to-iis/introduction-to-iis-architecture#hypertext-transfer-protocol-stack-httpsys) is a [web server for ASP.NET Core](xref:fundamentals/servers/index) that only runs on Windows. HTTP.sys is an alternative to [Kestrel](xref:fundamentals/servers/kestrel) server and offers some features that Kestrel doesn't provide.
2020

@@ -27,9 +27,11 @@ HTTP.sys supports the following features:
2727
* Port sharing
2828
* HTTPS with SNI
2929
* HTTP/2 over TLS (Windows 10 or later)
30+
* HTTP/3 over TLS (Windows 11 or later)
3031
* Direct file transmission
3132
* Response caching
3233
* WebSockets (Windows 8 or later)
34+
* Customizable security descriptors
3335

3436
Supported Windows versions:
3537

@@ -60,7 +62,7 @@ HTTP.sys is mature technology that protects against many types of attacks and pr
6062
* [Application-Layer Protocol Negotiation (ALPN)](https://tools.ietf.org/html/rfc7301#section-3) connection
6163
* TLS 1.2 or later connection
6264

63-
If an HTTP/2 connection is established, [HttpRequest.Protocol](xref:Microsoft.AspNetCore.Http.HttpRequest.Protocol*) reports `HTTP/2`.
65+
If an HTTP/2 connection is established, [HttpRequest.Protocol](xref:Microsoft.AspNetCore.Http.HttpRequest.Protocol%2A) reports `HTTP/2`.
6466

6567
HTTP/2 is enabled by default. If an HTTP/2 connection isn't established, the connection falls back to HTTP/1.1. In a future release of Windows, HTTP/2 configuration flags will be available, including the ability to disable HTTP/2 with HTTP.sys.
6668

@@ -95,7 +97,6 @@ HTTP.sys delegates to kernel mode authentication with the Kerberos authenticatio
9597
### Support for kernel-mode response buffering
9698

9799
In some scenarios, high volumes of small writes with high latency can cause significant performance impact to `HTTP.sys`. This impact is due to the lack of a <xref:System.IO.Pipelines.Pipe> buffer in the `HTTP.sys` implementation. To improve performance in these scenarios, support for response buffering is included in `HTTP.sys`. Enable buffering by setting [HttpSysOptions.EnableKernelResponseBuffering](https://github.com/dotnet/aspnetcore/blob/main/src/Servers/HttpSys/src/HttpSysOptions.cs#L120) to `true`.
98-
99100
Response buffering should be enabled by an app that does synchronous I/O, or asynchronous I/O with no more than one outstanding write at a time. In these scenarios, response buffering can significantly improve throughput over high-latency connections.
100101

101102
Apps that use asynchronous I/O and that may have more than one write outstanding at a time should **_not_** use this flag. Enabling this flag can result in higher CPU and memory usage by HTTP.Sys.
@@ -112,6 +113,18 @@ Additional HTTP.sys configuration is handled through [registry settings](https:/
112113

113114
For more information about HTTP.sys options, see <xref:Microsoft.AspNetCore.Server.HttpSys.HttpSysOptions>.
114115

116+
### Customize security descriptors
117+
118+
A *request queue* in HTTP.sys is a kernel-level structure that temporarily stores incoming HTTP requests until your application is ready to process them. Manage access to the request queue by using the [RequestQueueSecurityDescriptor](https://source.dot.net/#Microsoft.AspNetCore.Server.HttpSys/HttpSysOptions.cs,a556950881fd2d87) property on <xref:Microsoft.AspNetCore.Server.HttpSys.HttpSysOptions>. Set it to a <xref:System.Security.AccessControl.GenericSecurityDescriptor> instance when configuring your HTTP.sys server.
119+
120+
By customizing the security descriptor, you can allow or deny specific users or groups access to the request queue. This is useful in scenarios where you want to restrict or delegate HTTP.sys request handling at the operating system level.
121+
122+
For example, the following code allows all authenticated users but denies guests:
123+
124+
[!code-csharp[](~/fundamentals/servers/httpsys/samples_snapshot/10.x/HttpSysConfig/Program.cs)]
125+
126+
The `RequestQueueSecurityDescriptor` property applies only when creating a new request queue. The property doesn't affect existing request queues.
127+
115128
<a name="maxrequestbodysize"></a>
116129

117130
**MaxRequestBodySize**
@@ -338,3 +351,4 @@ For information about how to get traces from HTTP.sys, see [HTTP.sys Manageabili
338351
:::moniker-end
339352

340353
[!INCLUDE [httpsys5-7](~/fundamentals/servers/httpsys/includes/httpsys5-7.md)]
354+
[!INCLUDE [httpsys8-9](~/fundamentals/servers/httpsys/includes/httpsys8-9.md)]

0 commit comments

Comments
 (0)