Skip to content
Merged
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
14 changes: 14 additions & 0 deletions ca/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"math/big"
"math/rand"
"path/filepath"
"slices"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -60,6 +61,17 @@ var (
errInvalidJoinToken = errors.New("invalid join token")
)

// strongTLSCiphers defines a secure, modern set of TLS cipher suites
// with known weak algorithms removed.
var strongTLSCiphers = []uint16{
tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,
tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,
}

// SecurityConfig is used to represent a node's security configuration. It includes information about
// the RootCA and ServerTLSCreds/ClientTLSCreds transport authenticators to be used for MTLS
type SecurityConfig struct {
Expand Down Expand Up @@ -649,6 +661,7 @@ func NewServerTLSConfig(certs []tls.Certificate, rootCAPool *x509.CertPool) (*tl
RootCAs: rootCAPool,
ClientCAs: rootCAPool,
PreferServerCipherSuites: true,
CipherSuites: slices.Clone(strongTLSCiphers),
MinVersion: tls.VersionTLS12,
NextProtos: alpnProtoStr,
}, nil
Expand All @@ -665,6 +678,7 @@ func NewClientTLSConfig(certs []tls.Certificate, rootCAPool *x509.CertPool, serv
ServerName: serverName,
Certificates: certs,
RootCAs: rootCAPool,
CipherSuites: slices.Clone(strongTLSCiphers),
MinVersion: tls.VersionTLS12,
}, nil
}
Expand Down
Loading