大网数据广告活动
Windows Server 管理

Customize WebSocket validation for Windows Admin Center gateway

· 52CE 我爱测

Learn how administrators can customize the WebSocket validation for their Windows Admin Center (Project Honolulu) instance.

To protect WebSocket access, WebSocket connection will now validate origin state from the browser so not any external application could get access the WebSocket API defined on the gateway.

Customization of validation

Validation can be adjusted to customize various conditions.

User can configure WebSocket override setting at a Windows Admin Center registry value, HKLM\Software\Microsoft\ServerManagementGateway\WebSocketValidationOverride, to specify exceptional origin host name and origin port. This include wildcard name such as "*.mydomain.mycompany.net" or just "*" to accept all. Wildcard must be specified single form like "*." and cannot be combined with complex string match condition like "something*something".

Example of accepted formats are as follows:

  • Always allows origin host defined on current TLS certificate. (subject name, alternate DNS names)
  • Always allows origin port configured to Windows Admin Center
  • "*" - accept any origin host and origin port
  • "*:9876" - accept any origin host and origin port 9876
  • ":9876" - accept origin port 9876
  • "*.my.domain.com" - accept origin host <any.any.any...>.my.domain.com
  • "*.my.domain.com:9876" - accept origin host <any.any.any...>.my.domain.com and origin port 9876

Prevention logic

Gateway adds a session cookie (WAC-SESSION) for user browser. It associates the browser session and username always. It prevents different user attempting using the same browser session.

  • When UI starts a WebSocket connection the browser sends the session cookie back to Gateway.
  • Gateway validates authenticated username matched with the session cookie always.

Gateway looks for origin header, which is endpoint URL that original Windows Admin Center site was loaded.

  • Gateway validated origin host and origin port against current SSL certificate settings which includes list of DNS host names. This tells the UI code is loaded from expected DNS name sites and port.

RDP enhancement

On RDP TCP connection, Gateway only allows to use port 3389 (RDP) and port 2179 (VM connection), so TCP forwarding feature cannot be used for any other purpose.

Possible side effect

If user uses Windows Admin Center by IP address or something not described on the SSL certificate, user cannot access WebSocket because it's not trustable. If it needs to support, modify HKLM\Software\Microsoft\ServerManagementGateway\WebSocketValidationOverride registry value to set the IP address or just specify "*" to ignore validation.

Source: Microsoft Learn / Windows Server documentation by Microsoft and contributors (upstream author metadata: robinharwood). Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Server documentation
适用范围
Windows Server · Source date 10/22/2021
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。