Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Enable mTLS on connections between inputs and the shipper #275

Open
2 tasks
Tracked by #16
cmacknz opened this issue Mar 1, 2023 · 1 comment
Open
2 tasks
Tracked by #16

Enable mTLS on connections between inputs and the shipper #275

cmacknz opened this issue Mar 1, 2023 · 1 comment
Labels
Team:Elastic-Agent Label for the Agent team

Comments

@cmacknz
Copy link
Member

cmacknz commented Mar 1, 2023

Connections between inputs like Beats and the shipper are intended to be encrypted using mTLS. This is currently disabled because of some challenges in configuring the server based on the way the configuration is provided by the agent, see #224.

func (c *clientHandler) startgRPC(unit *client.Unit, cfg config.ShipperConnectionConfig) {
//TODO: until we get TLS config fixed/figured out, run in insecure mode
// certPool := x509.NewCertPool()
// for _, cert := range cfg.Shipper.Server.TLS.CAs {
// if ok := certPool.AppendCertsFromPEM([]byte(cert)); !ok {
// c.reportError("error appending cert obtained from input in shipper startup", err, outUnit)
// return
// }
// }
_ = unit.UpdateState(client.UnitStateConfiguring, "starting gRPC server", nil)
creds := insecure.NewCredentials() //:= credentials.NewTLS(&tls.Config{
// ClientAuth: tls.RequireAndVerifyClientCert,
// ClientCAs: certPool,
// GetCertificate: c.getCertificate,
// MinVersion: tls.VersionTLS12,
// })

Regardless of the way TLS is configured, it needs to be possible to enable TLS for connections between the inputs and the shipper. The scope of this issue is to reenable TLS between the inputs and shipper, and measure the performance impact of enabling TLS so we can decide if it needs to be optional.

Acceptance Criteria:

  • A test exists proving that a shipper client can communicate with the shipper server using a TLS encrypted connection.
  • A performance comparison between the shipper with TLS and the shipper without TLS has been documented.
@cmacknz cmacknz added the Team:Elastic-Agent Label for the Agent team label Mar 1, 2023
@cmacknz cmacknz changed the title Enable TLS on connections between inputs and the shipper Enable mTLS on connections between inputs and the shipper Mar 8, 2023
@cmacknz
Copy link
Member Author

cmacknz commented Mar 8, 2023

Another aspect of this besides encryption is the authentication element added by mTLS, to ensure that any user on a machine can publish events through the shipper.

Without mTLS we are relying on the unix socket/named pipe created for communication with the shipper being owned by root, which prevents non-root users from writing through the shipper. This is likely fine for an initial release but would still want to add an explicit authentication step in the future.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Team:Elastic-Agent Label for the Agent team
Projects
None yet
Development

No branches or pull requests

1 participant