Skip to content
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 support for CLI flag for mTLS client certificate key passphrase #5489

Closed
AndersonQ opened this issue Sep 10, 2024 · 1 comment · Fixed by #5494
Closed

Add support for CLI flag for mTLS client certificate key passphrase #5489

AndersonQ opened this issue Sep 10, 2024 · 1 comment · Fixed by #5494
Assignees
Labels
enhancement New feature or request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team

Comments

@AndersonQ
Copy link
Member

AndersonQ commented Sep 10, 2024

In the in progress mTLS implementation we do not expose command line options for reading a passphrase-protected certificate key from a file. We need to add support for that, matching the support for fleet-server certificate and the fleet-server client certificate for connecting to Elasticsearch.

Following the current pattern, the new flag should be --elastic-agent-cert-key-passphrase.

Required tests:

  • Unit tests:

    • Ensure --elastic-agent-cert-key-passphrase adheres to the same requirements as --fleet-server-cert-key-passphrase.
    • Verify that both --elastic-agent-cert-key and --elastic-agent-cert are provided when --elastic-agent-cert-key-passphrase is present.
    • Confirm that *enrollCmdOption) remoteConfig() accurately incorporates the passphrase into tlscommon.CertificateConfig.
    • Validate that fleetclient.NewWithConfig generates a valid client capable of establishing an mTLS connection to a mock server.
    • Ensure the policy TLS client settings take precedence over the CLI. Extend policy with SSL config to 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.
  • Integration tests: Out of scope for this ticket, as they are impacted by

Acceptance criteria:

  • Elastic Agent can be configured to use a passphrase protected private key for the client mTLS certificate with a proxy or fleet-server.
  • the e2e test to assert it works is manual.
@AndersonQ AndersonQ added enhancement New feature or request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team labels Sep 10, 2024
@AndersonQ AndersonQ self-assigned this Sep 10, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants