Secure Swagger on ASP.NET Core by address and port
This follows on from my previous post Secure ASP.NET Core Health Checks to a specific port and assumes that you already have your service running over 2 ports and have specified a ManagementPort
in the appsettings.json file.
Secure ASP.NET Core Health Checks to a specific port
Health Checks in ASP.NET Core can give valuable insights into the health of services, but that includes sensitive data that should not be leaked externally.
To secure Health Checks it is possible to make them available on internal addresses only and on a different port to the publicly served pages/API endpoints.