google-nomulus/java/google/registry
jianglai 9e7c996081 Add fallback headers to GFE specific headers
Currently we exact the client certificate hash from header X-GFE-SSL-Certificate. This works because the proxy running on [] sends the request directly to the AFE via HttpOverRpc, bypassing the frontline GFE, which would strip away this header.

[]

After the proxy moves to GCP we can no longer use that header. Instead we should use X-SSL-Certificate, which does not get stripped by the GFE. In fact the open source build should never have contained X-GFE-SSL-Certificate because obviously external nomulus users have to go through the GFE to reach the registry app and that header would never have survived.

Without changing how the [] proxy works, this CL makes the registry first try to extract the hash from X-GFE-SSL-Certificate, and fallback to X-SSL-Certificate if necessary. This allows the current setup to continue to work, while the new proxy is being tested.

This should not open us up to attacks because even if an attacker uses a proxy that uses X-SSL-Certificate, it still needs to pass OAuth in order to talk to /_dr/epp.

Similarly, we use X-Requested-Servername-SNI as fallback to X-GFE-Requested-Servername-SNI. This can be eliminated altogether when the [] proxy is retired, because the only reason we check if the client request is SNI enabled (by checking the existence of that header) is because the GFE only requests client certificate when SNI is enabled. The GCP proxy does not have that limitation, and also will be only serving one certificate with all SAN listed in it.

Some formatting change is also introduced by the formatter. They seem to be better conforming to the style guide, so I left them there.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165378083
2017-08-29 16:21:00 -04:00
..
backup Map over Key instead of actual instances when deleting old commit logs 2017-08-29 15:40:41 -04:00
batch Change @Auth to an AutoValue, and created a set of predefined Auths 2017-08-01 16:33:10 -04:00
bigquery Add activity report generation code 2017-08-29 15:53:33 -04:00
braintree Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
builddefs Add build rules for "nocron" deployments 2017-04-26 10:53:16 -04:00
config Use config settings for DNS TTL values across all code 2017-08-29 15:50:44 -04:00
cron Change @Auth to an AutoValue, and created a set of predefined Auths 2017-08-01 16:33:10 -04:00
dns Remove temporary variable in DNS queue logging 2017-08-29 16:09:39 -04:00
eclipse Add Cloud KMS as dependency of eclipse package 2017-03-21 15:17:04 -04:00
env Add activity report generation code 2017-08-29 15:53:33 -04:00
export Remove queueing from Lock 2017-08-01 17:06:20 -04:00
flows Add fallback headers to GFE specific headers 2017-08-29 16:21:00 -04:00
gcs Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
groups Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
idn Run buildifier on codebase to format BUILD files 2016-11-28 18:15:21 -05:00
keyring Set KmsKeyring as the default Keyring 2017-07-10 11:40:02 -04:00
loadtest Change @Auth to an AutoValue, and created a set of predefined Auths 2017-08-01 16:33:10 -04:00
mapreduce Retry Datastore errors in CommitLogManifestReader.next() 2017-08-29 16:06:48 -04:00
model Allow multiple DNS writers on TLDs 2017-08-01 17:10:33 -04:00
module Add activity report generation code 2017-08-29 15:53:33 -04:00
monitoring Change @Auth to an AutoValue, and created a set of predefined Auths 2017-08-01 16:33:10 -04:00
pricing Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
rdap Change @Auth to an AutoValue, and created a set of predefined Auths 2017-08-01 16:33:10 -04:00
rde Remove queueing from Lock 2017-08-01 17:06:20 -04:00
reporting Add activity report generation code 2017-08-29 15:53:33 -04:00
request Reduce number of authentication/authorization log statements 2017-08-29 15:39:10 -04:00
security Remove XsrfTokenManager fallback for validating legacy tokens 2017-03-21 15:36:31 -04:00
storage/drive Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
tldconfig/idn Update copyright year on all license headers 2017-02-02 16:27:22 -05:00
tmch Make Registrar load methods return Optionals instead of Nullables 2017-08-01 16:58:59 -04:00
tools Use config settings for DNS TTL values across all code 2017-08-29 15:50:44 -04:00
ui Migrate {css} and {xid} tags to new builtinfunctions css() and xid() 2017-08-29 15:56:43 -04:00
util Retry Datastore errors in CommitLogManifestReader.next() 2017-08-29 16:06:48 -04:00
whois Make Registrar load methods return Optionals instead of Nullables 2017-08-01 16:58:59 -04:00
xjc Fix the build on MacOS 2017-07-12 11:03:50 -04:00
xml Add the ability to generate RDE deposits in lenient mode 2017-05-17 12:22:49 -04:00
BUILD Document procedural changes to restore 2017-05-03 10:43:25 -04:00
repositories.bzl Migrate {css} and {xid} tags to new builtinfunctions css() and xid() 2017-08-29 15:56:43 -04:00