mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-08-04 05:29:56 +00:00
Add new CLI flag to enable TLS SAN CN filtering
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
committed by
Brad Davidson
parent
8d6483a59e
commit
f365a9cb98
@@ -47,6 +47,7 @@ type Server struct {
|
||||
KubeConfigMode string
|
||||
HelmJobImage string
|
||||
TLSSan cli.StringSlice
|
||||
TLSSanSecurity bool
|
||||
BindAddress string
|
||||
EnablePProf bool
|
||||
ExtraAPIArgs cli.StringSlice
|
||||
@@ -202,6 +203,11 @@ var ServerFlags = []cli.Flag{
|
||||
Usage: "(listener) Add additional hostnames or IPv4/IPv6 addresses as Subject Alternative Names on the server TLS cert",
|
||||
Value: &ServerConfig.TLSSan,
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "tls-san-security",
|
||||
Usage: "(listener) Protect the server TLS cert by refusing to add Subject Alternative Names not associated with the kubernetes apiserver service, server nodes, or values of the tls-san option (default: false)",
|
||||
Destination: &ServerConfig.TLSSanSecurity,
|
||||
},
|
||||
DataDirFlag,
|
||||
ClusterCIDR,
|
||||
ServiceCIDR,
|
||||
|
||||
@@ -132,6 +132,7 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
|
||||
serverConfig.ControlConfig.Rootless = cfg.Rootless
|
||||
serverConfig.ControlConfig.ServiceLBNamespace = cfg.ServiceLBNamespace
|
||||
serverConfig.ControlConfig.SANs = util.SplitStringSlice(cfg.TLSSan)
|
||||
serverConfig.ControlConfig.SANSecurity = cfg.TLSSanSecurity
|
||||
serverConfig.ControlConfig.BindAddress = cfg.BindAddress
|
||||
serverConfig.ControlConfig.SupervisorPort = cfg.SupervisorPort
|
||||
serverConfig.ControlConfig.HTTPSPort = cfg.HTTPSPort
|
||||
|
||||
Reference in New Issue
Block a user