Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/admin-guide/configuration/proxy-protocol.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ with the PROXY v1 header. Any request not preface by this header will be
dropped.

As a security measure, an optional whitelist of trusted IP addresses may be
configured with :ts:cv:`proxy.config.http.proxy_protocol_whitelist`.
configured with :ts:cv:`proxy.config.http.proxy_protocol_allowlist`.

.. important::

Expand Down
4 changes: 2 additions & 2 deletions doc/admin-guide/files/records.config.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1770,9 +1770,9 @@ Proxy User Variables
is prohibited by RFC 7239. Currently, for the ``host`` parameter to provide the original host from the
incoming client request, `proxy.config.url_remap.pristine_host_hdr`_ must be enabled.

.. ts:cv:: CONFIG proxy.config.http.proxy_protocol_whitelist STRING ```<ip list>```
.. ts:cv:: CONFIG proxy.config.http.proxy_protocol_allowlist STRING ```<ip list>```

This defines a whitelist of server IPs that are trusted to provide
This defines a allowlist of server IPs that are trusted to provide
connections with Proxy Protocol information. This is a comma delimited list
of IP addresses. Addressed may be listed individually, in a range separated
by a dash or by using CIDR notation.
Expand Down
8 changes: 4 additions & 4 deletions iocore/net/SSLNetVConnection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -410,25 +410,25 @@ SSLNetVConnection::read_raw_data()
if (this->get_is_proxy_protocol()) {
Debug("proxyprotocol", "proxy protocol is enabled on this port");
if (pp_ipmap->count() > 0) {
Debug("proxyprotocol", "proxy protocol has a configured whitelist of trusted IPs - checking");
Debug("proxyprotocol", "proxy protocol has a configured allowlist of trusted IPs - checking");

// At this point, using get_remote_addr() will return the ip of the
// proxy source IP, not the Proxy Protocol client ip. Since we are
// checking the ip of the actual source of this connection, this is
// what we want now.
void *payload = nullptr;
if (!pp_ipmap->contains(get_remote_addr(), &payload)) {
Debug("proxyprotocol", "proxy protocol src IP is NOT in the configured whitelist of trusted IPs - "
Debug("proxyprotocol", "proxy protocol src IP is NOT in the configured allowlist of trusted IPs - "
"closing connection");
r = -ENOTCONN; // Need a quick close/exit here to refuse the connection!!!!!!!!!
goto proxy_protocol_bypass;
} else {
char new_host[INET6_ADDRSTRLEN];
Debug("proxyprotocol", "Source IP [%s] is in the trusted whitelist for proxy protocol",
Debug("proxyprotocol", "Source IP [%s] is in the trusted allowlist for proxy protocol",
ats_ip_ntop(this->get_remote_addr(), new_host, sizeof(new_host)));
}
} else {
Debug("proxyprotocol", "proxy protocol DOES NOT have a configured whitelist of trusted IPs but "
Debug("proxyprotocol", "proxy protocol DOES NOT have a configured allowlist of trusted IPs but "
"proxy protocol is enabled on this port - processing all connections");
}

Expand Down
2 changes: 1 addition & 1 deletion mgmt/RecordsConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ static const RecordElement RecordsConfig[] =
,
{RECT_CONFIG, "proxy.config.http.insert_forwarded", RECD_STRING, "none", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.proxy_protocol_whitelist", RECD_STRING, "none", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
{RECT_CONFIG, "proxy.config.http.proxy_protocol_allowlist", RECD_STRING, "none", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
,
{RECT_CONFIG, "proxy.config.http.insert_age_in_response", RECD_INT, "1", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
,
Expand Down
10 changes: 5 additions & 5 deletions proxy/ProtocolProbeSessionAccept.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct ProtocolProbeTrampoline : public Continuation, public ProtocolProbeSessio
}

// if proxy_protocol is enabled via port descriptor AND the src IP is in
// the trusted whitelist for proxy protocol, then check to see if it is
// the trusted allowlist for proxy protocol, then check to see if it is
// present

IpMap *pp_ipmap;
Expand All @@ -103,20 +103,20 @@ struct ProtocolProbeTrampoline : public Continuation, public ProtocolProbeSessio
if (netvc->get_is_proxy_protocol()) {
Debug("proxyprotocol", "ioCompletionEvent: proxy protocol is enabled on this port");
if (pp_ipmap->count() > 0) {
Debug("proxyprotocol", "ioCompletionEvent: proxy protocol has a configured whitelist of trusted IPs - checking");
Debug("proxyprotocol", "ioCompletionEvent: proxy protocol has a configured allowlist of trusted IPs - checking");
void *payload = nullptr;
if (!pp_ipmap->contains(netvc->get_remote_addr(), &payload)) {
Debug("proxyprotocol",
"ioCompletionEvent: proxy protocol src IP is NOT in the configured whitelist of trusted IPs - closing connection");
"ioCompletionEvent: proxy protocol src IP is NOT in the configured allowlist of trusted IPs - closing connection");
goto done;
} else {
char new_host[INET6_ADDRSTRLEN];
Debug("proxyprotocol", "ioCompletionEvent: Source IP [%s] is trusted in the whitelist for proxy protocol",
Debug("proxyprotocol", "ioCompletionEvent: Source IP [%s] is trusted in the allowlist for proxy protocol",
ats_ip_ntop(netvc->get_remote_addr(), new_host, sizeof(new_host)));
}
} else {
Debug("proxyprotocol",
"ioCompletionEvent: proxy protocol DOES NOT have a configured whitelist of trusted IPs but proxy protocol is "
"ioCompletionEvent: proxy protocol DOES NOT have a configured allowlist of trusted IPs but proxy protocol is "
"ernabled on this port - processing all connections");
}

Expand Down
2 changes: 1 addition & 1 deletion proxy/http/HttpConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ HttpConfig::startup()

RecHttpLoadIp("proxy.local.incoming_ip_to_bind", c.inbound_ip4, c.inbound_ip6);
RecHttpLoadIp("proxy.local.outgoing_ip_to_bind", c.outbound_ip4, c.outbound_ip6);
RecHttpLoadIpMap("proxy.config.http.proxy_protocol_whitelist", c.config_proxy_protocol_ipmap);
RecHttpLoadIpMap("proxy.config.http.proxy_protocol_allowlist", c.config_proxy_protocol_ipmap);
SSLConfigInit(&c.config_proxy_protocol_ipmap);

HttpEstablishStaticConfigLongLong(c.server_max_connections, "proxy.config.http.server_max_connections");
Expand Down
6 changes: 3 additions & 3 deletions tests/gold_tests/ip_allow/ip_allow.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"The PUSH request should be denied by ip_allow")

#
# TEST 1: Perform a GET request. Should be allowed because GET is in the whitelist.
# TEST 1: Perform a GET request. Should be allowed because GET is in the allowlist.
#
tr = Test.AddTestRun()
tr.Processes.Default.StartBefore(server, ready=When.PortOpen(server.Variables.SSL_Port))
Expand All @@ -156,7 +156,7 @@

#
# TEST 2: Perform a CONNECT request. Should not be allowed because CONNECT is
# not in the whitelist.
# not in the allowlist.
#
tr = Test.AddTestRun()
tr.Processes.Default.Command = ('curl --verbose -X CONNECT -H "Host: localhost" http://localhost:{ts_port}/connect'.
Expand All @@ -168,7 +168,7 @@

#
# TEST 3: Perform a PUSH request over HTTP/2. Should not be allowed because
# PUSH is not in the whitelist.
# PUSH is not in the allowlist.
#
tr = Test.AddTestRun()
tr.Processes.Default.Command = ('curl --http2 --verbose -k -X PUSH -H "Host: localhost" https://localhost:{ts_port}/h2_push'.
Expand Down