-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add mTLS flags to install and enroll commands #4007
Conversation
This pull request does not have a backport label. Could you fix it @michel-laterman? 🙏
NOTE: |
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
Pinging @elastic/fleet (Team:Fleet) |
Is there a way to test that an mTLS exchange between agent and Fleet server actually works? We have a test fleet server you could configure to test the agent side of this, or just use a real fleet server if that is simpler: https://github.com/elastic/elastic-agent/tree/main/testing/fleetservertest Example usage:
|
@cmacknz, i'm trying to test that locally. However there are issues starting an agent + fleet-server instance with some of the changes I made, i'm going to set this as a draft and see if I can fix it.
|
After changing the version of elastic-agent-libs to one that includes the changes in elastic/elastic-agent-libs#176, the agent is able to pass the cert + key to the output (for es) and mTLS to connect. The local config contains: server:
ssl:
certificate: <REDACTED>
certificate_authorities:
- /etc/ssl/certs/ca-certificates.crt
- /tmp/ca.crt
client_authentication: required
key: <REDACTED>
ssl:
certificate: <REDACTED>
certificate_authorities:
- /etc/ssl/certs/ca-certificates.crt
- /tmp/ca.crt
key: <REDACTED>
renegotiation: never And fleet-server's config has: tls:
enabled: null
verificationmode: full
versions: []
ciphersuites: []
cas:
- /etc/ssl/certs/ca-certificates.crt
- /tmp/ca.crt
certificate:
certificate: /tmp/fleet-server.crt
key: '[redacted]'
curvetypes: []
clientauth: 4 # corresponds to required However, I would expect client_auth to be set to |
Co-authored-by: Anderson Queiroz <[email protected]>
df5949a
to
9c6d0fb
Compare
@michel-laterman I tried to test it but I could not. I don't understand how I'd install fleet-server under agent and also pass in |
The |
This pull request is now in conflicts. Could you fix it? 🙏
|
|
What does this PR do?
Add mTLS flags to install and enroll commands
Why is it important?
Certain proxy setups for customer's on-prem deployments require mTLS certificates for communication.
How to test
I created custom builds of the elastic-agent and fleet-server using a currently unreleased version of elastic-agent-libs with ability to specifyServerConfig.ClientAuth
.elastic-agent-libs has been updated to v0.7.4 which includes these changes
Create a ES cluster and enroll elastic-agent with fleet-server.
I used a self-signed CA to create all the certs:
Gather a diagnostics bundle and inspect
fleet-server.yml
Checklist
I have made corresponding change to the default configuration filesI have added tests that prove my fix is effective or that my feature works./changelog/fragments
using the changelog toolI have added an integration test or an E2E test