Add support for CLI flag for mTLS client certificate key passphrase#5494
Conversation
|
This pull request does not have a backport label. Could you fix it @AndersonQ? 🙏
|
5c9c606 to
3351e32
Compare
cd98d59 to
2c94c5b
Compare
| absPath, err := filepath.Abs("/path/to/token") | ||
| require.NoError(t, err, "could not get absolute absPath") |
There was a problem hiding this comment.
I honestly do not know why it was working on windows before, but it started to fail on elastic-agent-cert-key does not require key-passphrase, so I fixed all tests.
|
|
cbdb682 to
1fa216d
Compare
|
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
It adds support for encrypted client certificate key during install/enroll, which done by the cli flag `--elastic-agent-cert-key-passphrase`.
c4dcbdf to
4d283ea
Compare
|
…lastic#5494) It adds support for encrypted client certificate key during install/enroll, which done by the cli flag `--elastic-agent-cert-key-passphrase`.




What does this PR do?
It adds support for encrypted client certificate key during install/enroll, which done by the cli flag
--elastic-agent-cert-key-passphrase.Why is it important?
It enables Elastic Agent to be configured with passphrase-protected private keys for client mTLS certificates.
Checklist
[ ] I have made corresponding change to the default configuration files./changelog/fragmentsusing the changelog tool[ ] I have added an integration test or an E2E testAuthor's checklist
Tests
--elastic-agent-cert-key-passphraseadheres to the same requirements as--fleet-server-cert-key-passphrase.--elastic-agent-cert-keyand--elastic-agent-certare provided when--elastic-agent-cert-key-passphraseis present.*enrollCmdOption.remoteConfig()accurately incorporates the passphrase intotlscommon.CertificateConfig.fleetclient.NewWithConfiggenerates a valid client capable of establishing an mTLS connection to a mock server.policy with SSL configto ensure the client certificate key passphrase from the cli is not left in the config when the policy's client client certificate key is not passphrase-protected.Disruptive User Impact
How to test this PR locally
Related issues
Questions to ask yourself