Loading docs/manual/developer/new_api_2_4.xml +8 −8 Changes for docs/manual/developer/new_api_2_4.xml: 8 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -153,9 +153,9 @@ <li>Modules that load other modules later than the EXEC_ON_READ config reading stage need to call ap_reserve_module_slots() or ap_reserve_module_slots_directive() in their pre_config hook.</li> <li>The client IP address per request can now be specified independently of the peer IP address of the connection for the benefit of load balancers</li> <li>The useragent IP address per request can now be specified independently of the client IP address of the connection for the benefit of load balancers</li> </ul> </section> Loading Loading @@ -459,8 +459,8 @@ <dd>This has been renamed to ap_unixd_config.</dd> <dt><code>conn_rec->remote_ip and conn_rec->remote_addr</code></dt> <dd>In order to distinguish between the peer IP address of the connection, and the client IP address of the request potentially <dd>In order to distinguish between the client IP address of the connection, and the useragent IP address of the request potentially overridden by a load balancer or proxy, the above variables have been renamed. If a module makes reference to either of the above variables, they need to be replaced with one of the following two Loading @@ -471,10 +471,10 @@ separated from the server by a transparent load balancer or proxy, use request_rec->useragent_ip and request_rec->useragent_addr.</li> <li>When you require the IP address of the peer that is connected directly to the server, which might be the client or <li>When you require the IP address of the client that is connected directly to the server, which might be the useragent or might be the load balancer or proxy itself, use conn_rec->peer_ip and conn_rec->peer_addr.</li> conn_rec->client_ip and conn_rec->client_addr.</li> </ul> </dd> </dl> Loading docs/manual/mod/mod_remoteip.xml +27 −26 Changes for docs/manual/mod/mod_remoteip.xml: 27 added lines, 26 removed lines. Original line number Diff line number Diff line Loading @@ -23,8 +23,8 @@ <modulesynopsis metafile="mod_remoteip.xml.meta"> <name>mod_remoteip</name> <description>Replaces the original peer IP address for the connection with the client IP address list presented by a proxies or a load balancer <description>Replaces the original client IP address for the connection with the useragent IP address list presented by a proxies or a load balancer via the request headers. </description> Loading @@ -33,26 +33,27 @@ via the request headers. <identifier>remoteip_module</identifier> <summary> <p>This module is used to treat the client which initiated the request as the originating client as identified by httpd for the purposes of authorization and logging, even where that client is <p>This module is used to treat the useragent which initiated the request as the originating useragent as identified by httpd for the purposes of authorization and logging, even where that useragent is behind a load balancer, front end server, or proxy server.</p> <p>The module overrides the peer IP address for the connection with the client IP address reported in the request header configured <p>The module overrides the client IP address for the connection with the useragent IP address reported in the request header configured with the <directive>RemoteIPHeader</directive> directive.</p> <p>Once replaced as instructed, this overridden client IP address is <p>Once replaced as instructed, this overridden useragent IP address is then used for the <module>mod_authz_host</module> <directive module="mod_authz_host" type="section">Require ip</directive> feature, is reported by <module>mod_status</module>, and is recorded by <module>mod_log_config</module> <code>%a</code> and <module>core</module> <code>%a</code> format strings. The underlying peer IP of the connection <code>%a</code> format strings. The underlying client IP of the connection is available in the <code>%{c}a</code> format string.</p> <note type="warning">It is critical to only enable this behavior from intermediate hosts (proxies, etc) which are trusted by this server, since it is trivial for the remote client to impersonate another client.</note> it is trivial for the remote useragent to impersonate another useragent.</note> </summary> <seealso><module>mod_authz_host</module></seealso> Loading @@ -61,22 +62,22 @@ via the request headers. <section id="processing"><title>Remote IP Processing</title> <p>Apache by default identifies the client with the connection's peer_ip value, and the connection remote_host and remote_logname are <p>Apache by default identifies the useragent with the connection's client_ip value, and the connection remote_host and remote_logname are derived from this value. These fields play a role in authentication, authorization and logging and other purposes by other loadable modules.</p> <p>mod_remoteip overrides the peer IP of the connection with the advertised client IP as provided by a proxy or load balancer, for <p>mod_remoteip overrides the client IP of the connection with the advertised useragent IP as provided by a proxy or load balancer, for the duration of the request. A load balancer might establish a long lived keepalive connection with the server, and each request will have the correct client IP, even though the underlying peer IP have the correct useragent IP, even though the underlying client IP address of the load balancer remains unchanged.</p> <p>When multiple, comma delimited client IP addresses are listed in the <p>When multiple, comma delimited useragent IP addresses are listed in the header value, they are processed in Right-to-Left order. Processing halts when a given client IP address is not trusted to present the halts when a given useragent IP address is not trusted to present the preceding IP address. The header field is updated to this remaining list of unconfirmed IP addresses, or if all IP addresses were trusted, this header is removed from the request altogether.</p> Loading @@ -102,15 +103,15 @@ via the request headers. <directivesynopsis> <name>RemoteIPHeader</name> <description>Declare the header field which should be parsed for client IP addresses</description> <description>Declare the header field which should be parsed for useragent IP addresses</description> <syntax>RemoteIPHeader <var>header-field</var></syntax> <contextlist><context>server config</context><context>virtual host</context></contextlist> <usage> <p>The <directive>RemoteIPHeader</directive> directive triggers <module>mod_remoteip</module> to treat the value of the specified <var>header-field</var> header as the client IP address, or list of intermediate client IP addresses, subject to further configuration <var>header-field</var> header as the useragent IP address, or list of intermediate useragent IP addresses, subject to further configuration of the <directive>RemoteIPInternalProxy</directive> and <directive>RemoteIPTrustedProxy</directive> directives. Unless these other directives are used, <module>mod_remoteip</module> will trust all Loading @@ -135,7 +136,7 @@ via the request headers. <usage> <p>The <directive>RemoteIPInternalProxy</directive> directive adds one or more addresses (or address blocks) to trust as presenting a valid RemoteIPHeader value of the client IP. Unlike the RemoteIPHeader value of the useragent IP. Unlike the <directive>RemoteIPTrustedProxy</directive> directive, any IP address presented in this header, including private intranet addresses, are trusted when passed from these proxies.</p> Loading @@ -157,7 +158,7 @@ via the request headers. <usage> <p>The <directive>RemoteIPInternalProxyList</directive> directive specifies a file parsed at startup, and builds a list of addresses (or address blocks) to trust as presenting a valid RemoteIPHeader value of the client IP.</p> to trust as presenting a valid RemoteIPHeader value of the useragent IP.</p> <p>The '<code>#</code>' hash character designates a comment line, otherwise each whitespace or newline separated entry is processed identically to Loading Loading @@ -185,7 +186,7 @@ via the request headers. <usage> <p>The <directive>RemoteIPProxiesHeader</directive> directive specifies a header into which <module>mod_remoteip</module> will collect a list of all of the intermediate client IP addresses trusted to resolve the client all of the intermediate client IP addresses trusted to resolve the useragent IP of the request. Note that intermediate <directive>RemoteIPTrustedProxy</directive> addresses are recorded in this header, while any intermediate Loading @@ -207,11 +208,11 @@ via the request headers. <usage> <p>The <directive>RemoteIPTrustedProxy</directive> directive adds one or more addresses (or address blocks) to trust as presenting a valid RemoteIPHeader value of the client IP. Unlike the RemoteIPHeader value of the useragent IP. Unlike the <directive>RemoteIPInternalProxy</directive> directive, any intranet or private IP address reported by such proxies, including the 10/8, 172.16/12, 192.168/16, 169.254/16 and 127/8 blocks (or outside of the IPv6 public 2000::/3 block) are not trusted as the client IP, and are left in the 2000::/3 block) are not trusted as the useragent IP, and are left in the <directive>RemoteIPHeader</directive> header's value.</p> <example><title>Trusted (Load Balancer) Example</title> Loading @@ -231,7 +232,7 @@ via the request headers. <usage> <p>The <directive>RemoteIPTrustedProxyList</directive> directive specifies a file parsed at startup, and builds a list of addresses (or address blocks) to trust as presenting a valid RemoteIPHeader value of the client IP.</p> to trust as presenting a valid RemoteIPHeader value of the useragent IP.</p> <p>The '<code>#</code>' hash character designates a comment line, otherwise each whitespace or newline seperated entry is processed identically to Loading include/httpd.h +2 −2 Changes for include/httpd.h: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -1053,10 +1053,10 @@ struct conn_rec { /** local address */ apr_sockaddr_t *local_addr; /** remote address */ apr_sockaddr_t *peer_addr; apr_sockaddr_t *client_addr; /** Client's IP address */ char *peer_ip; char *client_ip; /** Client's DNS name, if known. NULL if DNS hasn't been checked, * "" if it has and no address was found. N.B. Only access this though * get_remote_host() */ Loading modules/cluster/mod_heartmonitor.c +1 −1 Changes for modules/cluster/mod_heartmonitor.c: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -761,7 +761,7 @@ static int hm_handler(request_rec *r) buf[len] = '\0'; tbl = apr_table_make(r->pool, 10); qs_to_table(buf, tbl, r->pool); apr_sockaddr_ip_get(&ip, r->connection->peer_addr); apr_sockaddr_ip_get(&ip, r->connection->client_addr); hmserver.ip = ip; hmserver.port = 80; if (apr_table_get(tbl, "port") != NULL) Loading modules/echo/mod_echo.c +3 −3 Changes for modules/echo/mod_echo.c: 3 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -154,7 +154,7 @@ static int process_echo_connection(conn_rec *c) if (!APR_STATUS_IS_EOF(rv) && ! APR_STATUS_IS_TIMEUP(rv)) ap_log_error(APLOG_MARK, APLOG_INFO, rv, c->base_server, APLOGNO(01611) "ProtocolEcho: Failure reading from %s", c->peer_ip); c->client_ip); break; } Loading @@ -163,7 +163,7 @@ static int process_echo_connection(conn_rec *c) apr_brigade_cleanup(bb); ap_log_error(APLOG_MARK, APLOG_INFO, rv, c->base_server, APLOGNO(01612) "ProtocolEcho: Error - read empty brigade from %s!", c->peer_ip); c->client_ip); break; } Loading @@ -181,7 +181,7 @@ static int process_echo_connection(conn_rec *c) if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_INFO, rv, c->base_server, APLOGNO(01613) "ProtocolEcho: Failure writing to %s", c->peer_ip); c->client_ip); break; } apr_brigade_cleanup(bb); Loading Loading
docs/manual/developer/new_api_2_4.xml +8 −8 Changes for docs/manual/developer/new_api_2_4.xml: 8 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -153,9 +153,9 @@ <li>Modules that load other modules later than the EXEC_ON_READ config reading stage need to call ap_reserve_module_slots() or ap_reserve_module_slots_directive() in their pre_config hook.</li> <li>The client IP address per request can now be specified independently of the peer IP address of the connection for the benefit of load balancers</li> <li>The useragent IP address per request can now be specified independently of the client IP address of the connection for the benefit of load balancers</li> </ul> </section> Loading Loading @@ -459,8 +459,8 @@ <dd>This has been renamed to ap_unixd_config.</dd> <dt><code>conn_rec->remote_ip and conn_rec->remote_addr</code></dt> <dd>In order to distinguish between the peer IP address of the connection, and the client IP address of the request potentially <dd>In order to distinguish between the client IP address of the connection, and the useragent IP address of the request potentially overridden by a load balancer or proxy, the above variables have been renamed. If a module makes reference to either of the above variables, they need to be replaced with one of the following two Loading @@ -471,10 +471,10 @@ separated from the server by a transparent load balancer or proxy, use request_rec->useragent_ip and request_rec->useragent_addr.</li> <li>When you require the IP address of the peer that is connected directly to the server, which might be the client or <li>When you require the IP address of the client that is connected directly to the server, which might be the useragent or might be the load balancer or proxy itself, use conn_rec->peer_ip and conn_rec->peer_addr.</li> conn_rec->client_ip and conn_rec->client_addr.</li> </ul> </dd> </dl> Loading
docs/manual/mod/mod_remoteip.xml +27 −26 Changes for docs/manual/mod/mod_remoteip.xml: 27 added lines, 26 removed lines. Original line number Diff line number Diff line Loading @@ -23,8 +23,8 @@ <modulesynopsis metafile="mod_remoteip.xml.meta"> <name>mod_remoteip</name> <description>Replaces the original peer IP address for the connection with the client IP address list presented by a proxies or a load balancer <description>Replaces the original client IP address for the connection with the useragent IP address list presented by a proxies or a load balancer via the request headers. </description> Loading @@ -33,26 +33,27 @@ via the request headers. <identifier>remoteip_module</identifier> <summary> <p>This module is used to treat the client which initiated the request as the originating client as identified by httpd for the purposes of authorization and logging, even where that client is <p>This module is used to treat the useragent which initiated the request as the originating useragent as identified by httpd for the purposes of authorization and logging, even where that useragent is behind a load balancer, front end server, or proxy server.</p> <p>The module overrides the peer IP address for the connection with the client IP address reported in the request header configured <p>The module overrides the client IP address for the connection with the useragent IP address reported in the request header configured with the <directive>RemoteIPHeader</directive> directive.</p> <p>Once replaced as instructed, this overridden client IP address is <p>Once replaced as instructed, this overridden useragent IP address is then used for the <module>mod_authz_host</module> <directive module="mod_authz_host" type="section">Require ip</directive> feature, is reported by <module>mod_status</module>, and is recorded by <module>mod_log_config</module> <code>%a</code> and <module>core</module> <code>%a</code> format strings. The underlying peer IP of the connection <code>%a</code> format strings. The underlying client IP of the connection is available in the <code>%{c}a</code> format string.</p> <note type="warning">It is critical to only enable this behavior from intermediate hosts (proxies, etc) which are trusted by this server, since it is trivial for the remote client to impersonate another client.</note> it is trivial for the remote useragent to impersonate another useragent.</note> </summary> <seealso><module>mod_authz_host</module></seealso> Loading @@ -61,22 +62,22 @@ via the request headers. <section id="processing"><title>Remote IP Processing</title> <p>Apache by default identifies the client with the connection's peer_ip value, and the connection remote_host and remote_logname are <p>Apache by default identifies the useragent with the connection's client_ip value, and the connection remote_host and remote_logname are derived from this value. These fields play a role in authentication, authorization and logging and other purposes by other loadable modules.</p> <p>mod_remoteip overrides the peer IP of the connection with the advertised client IP as provided by a proxy or load balancer, for <p>mod_remoteip overrides the client IP of the connection with the advertised useragent IP as provided by a proxy or load balancer, for the duration of the request. A load balancer might establish a long lived keepalive connection with the server, and each request will have the correct client IP, even though the underlying peer IP have the correct useragent IP, even though the underlying client IP address of the load balancer remains unchanged.</p> <p>When multiple, comma delimited client IP addresses are listed in the <p>When multiple, comma delimited useragent IP addresses are listed in the header value, they are processed in Right-to-Left order. Processing halts when a given client IP address is not trusted to present the halts when a given useragent IP address is not trusted to present the preceding IP address. The header field is updated to this remaining list of unconfirmed IP addresses, or if all IP addresses were trusted, this header is removed from the request altogether.</p> Loading @@ -102,15 +103,15 @@ via the request headers. <directivesynopsis> <name>RemoteIPHeader</name> <description>Declare the header field which should be parsed for client IP addresses</description> <description>Declare the header field which should be parsed for useragent IP addresses</description> <syntax>RemoteIPHeader <var>header-field</var></syntax> <contextlist><context>server config</context><context>virtual host</context></contextlist> <usage> <p>The <directive>RemoteIPHeader</directive> directive triggers <module>mod_remoteip</module> to treat the value of the specified <var>header-field</var> header as the client IP address, or list of intermediate client IP addresses, subject to further configuration <var>header-field</var> header as the useragent IP address, or list of intermediate useragent IP addresses, subject to further configuration of the <directive>RemoteIPInternalProxy</directive> and <directive>RemoteIPTrustedProxy</directive> directives. Unless these other directives are used, <module>mod_remoteip</module> will trust all Loading @@ -135,7 +136,7 @@ via the request headers. <usage> <p>The <directive>RemoteIPInternalProxy</directive> directive adds one or more addresses (or address blocks) to trust as presenting a valid RemoteIPHeader value of the client IP. Unlike the RemoteIPHeader value of the useragent IP. Unlike the <directive>RemoteIPTrustedProxy</directive> directive, any IP address presented in this header, including private intranet addresses, are trusted when passed from these proxies.</p> Loading @@ -157,7 +158,7 @@ via the request headers. <usage> <p>The <directive>RemoteIPInternalProxyList</directive> directive specifies a file parsed at startup, and builds a list of addresses (or address blocks) to trust as presenting a valid RemoteIPHeader value of the client IP.</p> to trust as presenting a valid RemoteIPHeader value of the useragent IP.</p> <p>The '<code>#</code>' hash character designates a comment line, otherwise each whitespace or newline separated entry is processed identically to Loading Loading @@ -185,7 +186,7 @@ via the request headers. <usage> <p>The <directive>RemoteIPProxiesHeader</directive> directive specifies a header into which <module>mod_remoteip</module> will collect a list of all of the intermediate client IP addresses trusted to resolve the client all of the intermediate client IP addresses trusted to resolve the useragent IP of the request. Note that intermediate <directive>RemoteIPTrustedProxy</directive> addresses are recorded in this header, while any intermediate Loading @@ -207,11 +208,11 @@ via the request headers. <usage> <p>The <directive>RemoteIPTrustedProxy</directive> directive adds one or more addresses (or address blocks) to trust as presenting a valid RemoteIPHeader value of the client IP. Unlike the RemoteIPHeader value of the useragent IP. Unlike the <directive>RemoteIPInternalProxy</directive> directive, any intranet or private IP address reported by such proxies, including the 10/8, 172.16/12, 192.168/16, 169.254/16 and 127/8 blocks (or outside of the IPv6 public 2000::/3 block) are not trusted as the client IP, and are left in the 2000::/3 block) are not trusted as the useragent IP, and are left in the <directive>RemoteIPHeader</directive> header's value.</p> <example><title>Trusted (Load Balancer) Example</title> Loading @@ -231,7 +232,7 @@ via the request headers. <usage> <p>The <directive>RemoteIPTrustedProxyList</directive> directive specifies a file parsed at startup, and builds a list of addresses (or address blocks) to trust as presenting a valid RemoteIPHeader value of the client IP.</p> to trust as presenting a valid RemoteIPHeader value of the useragent IP.</p> <p>The '<code>#</code>' hash character designates a comment line, otherwise each whitespace or newline seperated entry is processed identically to Loading
include/httpd.h +2 −2 Changes for include/httpd.h: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -1053,10 +1053,10 @@ struct conn_rec { /** local address */ apr_sockaddr_t *local_addr; /** remote address */ apr_sockaddr_t *peer_addr; apr_sockaddr_t *client_addr; /** Client's IP address */ char *peer_ip; char *client_ip; /** Client's DNS name, if known. NULL if DNS hasn't been checked, * "" if it has and no address was found. N.B. Only access this though * get_remote_host() */ Loading
modules/cluster/mod_heartmonitor.c +1 −1 Changes for modules/cluster/mod_heartmonitor.c: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -761,7 +761,7 @@ static int hm_handler(request_rec *r) buf[len] = '\0'; tbl = apr_table_make(r->pool, 10); qs_to_table(buf, tbl, r->pool); apr_sockaddr_ip_get(&ip, r->connection->peer_addr); apr_sockaddr_ip_get(&ip, r->connection->client_addr); hmserver.ip = ip; hmserver.port = 80; if (apr_table_get(tbl, "port") != NULL) Loading
modules/echo/mod_echo.c +3 −3 Changes for modules/echo/mod_echo.c: 3 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -154,7 +154,7 @@ static int process_echo_connection(conn_rec *c) if (!APR_STATUS_IS_EOF(rv) && ! APR_STATUS_IS_TIMEUP(rv)) ap_log_error(APLOG_MARK, APLOG_INFO, rv, c->base_server, APLOGNO(01611) "ProtocolEcho: Failure reading from %s", c->peer_ip); c->client_ip); break; } Loading @@ -163,7 +163,7 @@ static int process_echo_connection(conn_rec *c) apr_brigade_cleanup(bb); ap_log_error(APLOG_MARK, APLOG_INFO, rv, c->base_server, APLOGNO(01612) "ProtocolEcho: Error - read empty brigade from %s!", c->peer_ip); c->client_ip); break; } Loading @@ -181,7 +181,7 @@ static int process_echo_connection(conn_rec *c) if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_INFO, rv, c->base_server, APLOGNO(01613) "ProtocolEcho: Failure writing to %s", c->peer_ip); c->client_ip); break; } apr_brigade_cleanup(bb); Loading