Skip to content

Commit

Permalink
Merge pull request #1540 from stevendanna/ssd/cipher-suites
Browse files Browse the repository at this point in the history
Use a more conservative set of CipherSuites
  • Loading branch information
JoelSpeed authored Sep 2, 2019
2 parents c854e76 + 46f48b3 commit 179cce3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cmd/dex/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,17 @@ func serve(cmd *cobra.Command, args []string) error {

var grpcOptions []grpc.ServerOption

allowedTLSCiphers := []uint16{
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
}

if c.GRPC.TLSCert != "" {
// Parse certificates from certificate file and key file for server.
cert, err := tls.LoadX509KeyPair(c.GRPC.TLSCert, c.GRPC.TLSKey)
Expand All @@ -107,6 +118,7 @@ func serve(cmd *cobra.Command, args []string) error {
tlsConfig := tls.Config{
Certificates: []tls.Certificate{cert},
MinVersion: tls.VersionTLS12,
CipherSuites: allowedTLSCiphers,
PreferServerCipherSuites: true,
}

Expand Down Expand Up @@ -262,6 +274,7 @@ func serve(cmd *cobra.Command, args []string) error {
Addr: c.Web.HTTPS,
Handler: serv,
TLSConfig: &tls.Config{
CipherSuites: allowedTLSCiphers,
PreferServerCipherSuites: true,
MinVersion: tls.VersionTLS12,
},
Expand Down

0 comments on commit 179cce3

Please sign in to comment.