mirror of
https://github.com/google/nomulus.git
synced 2025-07-25 20:18:34 +02:00
Reject handshakes with bad TLS protocols and ciphers (#970)
* Reject handshakes with bad TLS protocols and ciphers * Fix protocols * make cipher suite list static and fix tests * Delete unnecessary line * Add start time configuration for enforcement * small format fix * Add multiple ciphersuite test * fix gradle lint * fix indentation
This commit is contained in:
parent
cd415fe846
commit
c35f92f54b
13 changed files with 292 additions and 12 deletions
|
@ -50,6 +50,7 @@ import javax.inject.Named;
|
|||
import javax.inject.Provider;
|
||||
import javax.inject.Qualifier;
|
||||
import javax.inject.Singleton;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
/** A module that provides the {@link FrontendProtocol} used for epp protocol. */
|
||||
@Module
|
||||
|
@ -159,11 +160,19 @@ public final class EppProtocolModule {
|
|||
@Provides
|
||||
@EppProtocol
|
||||
static SslServerInitializer<NioSocketChannel> provideSslServerInitializer(
|
||||
ProxyConfig config,
|
||||
SslProvider sslProvider,
|
||||
Supplier<PrivateKey> privateKeySupplier,
|
||||
Supplier<ImmutableList<X509Certificate>> certificatesSupplier) {
|
||||
Supplier<ImmutableList<X509Certificate>> certificatesSupplier,
|
||||
Clock clock) {
|
||||
return new SslServerInitializer<>(
|
||||
true, false, sslProvider, privateKeySupplier, certificatesSupplier);
|
||||
true,
|
||||
false,
|
||||
sslProvider,
|
||||
privateKeySupplier,
|
||||
certificatesSupplier,
|
||||
DateTime.parse(config.tlsEnforcementStartTime),
|
||||
clock);
|
||||
}
|
||||
|
||||
@Provides
|
||||
|
|
|
@ -48,6 +48,7 @@ public class ProxyConfig {
|
|||
public WebWhois webWhois;
|
||||
public HttpsRelay httpsRelay;
|
||||
public Metrics metrics;
|
||||
public String tlsEnforcementStartTime;
|
||||
|
||||
/** Configuration options that apply to GCS. */
|
||||
public static class Gcs {
|
||||
|
|
|
@ -21,6 +21,8 @@ import dagger.multibindings.IntoSet;
|
|||
import google.registry.networking.handler.SslServerInitializer;
|
||||
import google.registry.proxy.Protocol.FrontendProtocol;
|
||||
import google.registry.proxy.handler.WebWhoisRedirectHandler;
|
||||
import google.registry.util.Clock;
|
||||
import google.registry.util.DateTimeUtils;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.socket.nio.NioSocketChannel;
|
||||
import io.netty.handler.codec.http.HttpServerCodec;
|
||||
|
@ -133,8 +135,15 @@ public final class WebWhoisProtocolsModule {
|
|||
static SslServerInitializer<NioSocketChannel> provideSslServerInitializer(
|
||||
SslProvider sslProvider,
|
||||
Supplier<PrivateKey> privateKeySupplier,
|
||||
Supplier<ImmutableList<X509Certificate>> certificatesSupplier) {
|
||||
Supplier<ImmutableList<X509Certificate>> certificatesSupplier,
|
||||
Clock clock) {
|
||||
return new SslServerInitializer<>(
|
||||
false, false, sslProvider, privateKeySupplier, certificatesSupplier);
|
||||
false,
|
||||
false,
|
||||
sslProvider,
|
||||
privateKeySupplier,
|
||||
certificatesSupplier,
|
||||
DateTimeUtils.END_OF_TIME,
|
||||
clock);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,9 @@
|
|||
# GCP project ID
|
||||
projectId: your-gcp-project-id
|
||||
|
||||
# Time to begin enforcement of TLS versions and cipher suites.
|
||||
tlsEnforcementStartTime: "2021-04-01T16:00:00Z"
|
||||
|
||||
# OAuth scope that the GoogleCredential will be constructed with. This list
|
||||
# should include all service scopes that the proxy depends on.
|
||||
gcpScopes:
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
# Add environment-specific proxy configuration here.
|
||||
|
||||
# Time to begin enforcement of TLS versions and cipher suites.
|
||||
tlsEnforcementStartTime: "1970-01-01T00:00:00Z"
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
# Add environment-specific proxy configuration here.
|
||||
|
||||
# Time to begin enforcement of TLS versions and cipher suites.
|
||||
tlsEnforcementStartTime: "1970-01-01T00:00:00Z"
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
# Add environment-specific proxy configuration here.
|
||||
|
||||
# Time to begin enforcement of TLS versions and cipher suites.
|
||||
tlsEnforcementStartTime: "1970-01-01T00:00:00Z"
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
# Add environment-specific proxy configuration here.
|
||||
|
||||
# Time to begin enforcement of TLS versions and cipher suites.
|
||||
tlsEnforcementStartTime: "1970-01-01T00:00:00Z"
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
# Add environment-specific proxy configuration here.
|
||||
|
||||
# Time to begin enforcement of TLS versions and cipher suites.
|
||||
tlsEnforcementStartTime: "1970-01-01T00:00:00Z"
|
||||
|
|
|
@ -1 +1,4 @@
|
|||
# Add environment-specific proxy configuration here.
|
||||
|
||||
# Time to begin enforcement of TLS versions and cipher suites.
|
||||
tlsEnforcementStartTime: "1970-01-01T00:00:00Z"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue