Class FrontEndProxyCheck

java.lang.Object
com.iizix.server.web.FrontEndProxyCheck

public final class FrontEndProxyCheck extends Object
Checks at server start that a server behind a front end knows its front end (CC-FIX-SIGNIN-THROTTLE-SOURCE, D-8).

A port that is front-end secured (PortConfig.isFrontEndSecured) is reached through a reverse proxy, so that every connection on it has the proxy's address. The address of the client is the one the proxy forwards, and it is believed only from a proxy the server setting ServerSettings.GEO_TRUSTED_PROXIES names (ClientAddressResolver). The setting is empty by default. While it is, every client of such a port is one and the same address to the server: the sign-in throttle counts all of them as one source, so that the failed sign-ins of anybody hold everybody back, and the session geolocation locates the proxy.

Nothing is changed or refused here: the operator is told, once, at start. The port flag is not taken as trust by itself, because it does not say who the front end is.

The other warning of a front-end secured port at start - the port is bound to every interface, so that it is reachable without its front end - needs the ports only and is with the code that binds them: FrontEndBindingCheck.

Author:
Christopher Mindus
  • Method Details

    • describe

      public static String describe(PortConfig[] portConfigs, String trustedProxies)
      Describes what is wrong with the trusted proxies of a server with these ports.
      Parameters:
      portConfigs - The ports of the web server, null for none.
      trustedProxies - The value of the server setting $geo.trustedProxies, null or blank for none.
      Returns:
      The warning, or null when there is nothing to warn of: no port is front-end secured, or at least one trusted proxy is named and every entry is an address.
    • warn

      public static boolean warn(PortConfig[] portConfigs, String trustedProxies)
      Logs the warning of describe(PortConfig[],String), when there is one.
      Parameters:
      portConfigs - The ports of the web server, null for none.
      trustedProxies - The value of the server setting $geo.trustedProxies.
      Returns:
      true when a warning was logged.