diff --git a/config/environments/production.rb b/config/environments/production.rb index 4c25ead7..63fff61e 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -90,4 +90,12 @@ logger.formatter = config.log_formatter config.logger = ActiveSupport::TaggedLogging.new(logger) end + + # Enable DNS rebinding protection and other `Host` header attacks. + config.hosts = [ + /maslow\..*gov.uk?/, + ] + + # Skip DNS rebinding protection for the default health check endpoint. + config.host_authorization = { exclude: ->(request) { request.path.match?("^\/healthcheck") } } end