From the course: ASP.NET Core: Health Checks and Logging

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Securing health check endpoints

Securing health check endpoints - ASP.NET Core Tutorial

From the course: ASP.NET Core: Health Checks and Logging

Start my 1-month free trial

Securing health check endpoints

- [Instructor] I would like to finish with a brief glimpse at a few security-related features for health checks. The first one is the RequireHost method. This makes sure that the health check endpoints that have RequireHost, and we'll see that in a minute, are only available for specific hostnames. So for instance, in our case, we access the application so far via localhost port and then something. However, once deployed, the server name, the hostname is a different one and maybe on a production system, we would not like to have access to that health check endpoint, only locally, or vice versa. And therefore we can provide that hostname. Here's how that works. In Startup.cs where we set up our health check endpoints, how about this one? We just use the extension method, RequireHost and then we can just provide one string, with one host or several hosts and actually, since we have a list of hosts, which we are…

Contents