feat: Control API uses automatic cross-pinning mTLS (Closes #119)
. kapow server generates on startup a pair of certificates that will use to secure communications to its control server. It will communicate the server and client certificates as well as the client private key to the init programs it launches, via environment variables. . kapow server now understands a new flag --control-reachable-addr which accepts either a IP address or a DNS name, that can be used to ensure that the generated server certificate will be appropiate in case the control server must be accessed from something other than localhost. Co-authored-by: Roberto Abdelkader Martínez Pérez <robertomartinezp@gmail.com>
This commit is contained in:
@@ -19,6 +19,7 @@ package server
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/BBVA/kapow/internal/certs"
|
||||
"github.com/BBVA/kapow/internal/server/control"
|
||||
"github.com/BBVA/kapow/internal/server/data"
|
||||
"github.com/BBVA/kapow/internal/server/user"
|
||||
@@ -34,13 +35,16 @@ type ServerConfig struct {
|
||||
|
||||
ClientAuth,
|
||||
Debug bool
|
||||
|
||||
ControlServerCert certs.Cert
|
||||
ControlClientCert certs.Cert
|
||||
}
|
||||
|
||||
// StartServer Starts one instance of each server in a goroutine and remains listening on a channel for trace events generated by them
|
||||
func StartServer(config ServerConfig) {
|
||||
var wg = sync.WaitGroup{}
|
||||
wg.Add(3)
|
||||
go control.Run(config.ControlBindAddr, &wg)
|
||||
go control.Run(config.ControlBindAddr, &wg, config.ControlServerCert, config.ControlClientCert)
|
||||
go data.Run(config.DataBindAddr, &wg)
|
||||
go user.Run(config.UserBindAddr, &wg, config.CertFile, config.KeyFile, config.ClientCaFile, config.ClientAuth, config.Debug)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user