【Azure 应用服务】App Service 默认开放端口说明, 如何禁用Web app的端口号?
问题描述
基于安全的角度来考虑,在网站上线之前用户会对自己的网站进行安全扫描,以防网站因为某些漏洞而被非法攻击。 而在扫描过程中,会发现除了 80 和 443 之外的一些其他端口也被开放了。例如:454, 455, 4020, 4022, 4024 等端口也处于开放状态。 如何禁用Web app的端口号?
问题解答
基于目前 App Service 架构的特殊性(PaaS, 底层维护有平台掌控),所以并不能从App Service服务的使用层面来关闭这些端口,也无法针对端口的任何的调整。开放的端口都是平台必须端口,每一个端口具体的使用说明如下:
-
454:必需端口,Azure 架构使用此端口来管理和维护服务。
-
455:必需端口,Azure 架构使用此端口来管理和维护服务。
-
80:HTTP 访问时的默认入站端口。
-
443:SSL 访问时的默认入站端口。
-
21:FTP 的控制通道端口。
-
10001~10020:FTP 的数据传输端口。
-
4020:为 Visual Studio 2015 远程调试的预留端口。
-
4022:为 Visual Studio 2017 远程调试的预留端口。
-
4024:为 Visual Studio 2019 远程调试的预留端口。
参考资料
App Service 默认开放端口说明:https://docs.azure.cn/zh-cn/articles/azure-operations-guide/app-service/aog-app-service-description-of-default-open-port
- 21: Control channel for FTP.
- 80: Default port for inbound HTTP traffic to apps running in App Service Plans in an App Service.
- 443: Default port for inbound SSL traffic to apps running in App Service Plans in an App Service.
- 454: Required port used by Azure infrastructure for managing and maintaining App Service via SSL.
- 455: Required port used by Azure infrastructure for managing and maintaining App Service via SSL.
- 990: Control channel for FTPS.
- 4016: Used for remote debugging with Visual Studio 2012.
- 4018: Used for remote debugging with Visual Studio 2013.
- 4020: Used for remote debugging with Visual Studio 2015.
- 4022: Used for remote debugging with Visual Studio 2017.
- 4024: Used for remote debugging with Visual Studio 2019.
- 7654: Metadata endpoint used by the internal service (does not take any input, only returns an IP address).
- 8172: Port used for WebDeploy service (protocol used by Visual Studio for publishing sites)
- 10001-10300: Data channels for FTP or FTPS (Passive Port Range)
当在复杂的环境中面临问题,格物之道需:浊而静之徐清,安以动之徐生。 云中,恰是如此!