elastic / elastic-agent

Elastic Agent - single, unified way to add monitoring for logs, metrics, and other types of data to a host.
Other
15 stars 143 forks source link

Able to install standalone agent with invalid API key and unable to uninstall afterwards. #5787

Open amolnater-qasource opened 2 weeks ago

amolnater-qasource commented 2 weeks ago

Kibana Build details:

VERSION: 8.16.0 SNAPSHOT
BUILD: 79128
COMMIT: d7556c5782195e1a8526c4b52a976597e32ba242

Artifact: https://snapshots.elastic.co/8.16.0-c9f6408b/downloads/beats/elastic-agent/elastic-agent-8.16.0-SNAPSHOT-windows-x86_64.zip

Host: Windows Server 2022- Test Signing ON

Preconditions:

  1. 8.16.0 SNAPSHOT Kibana self-managed environment should be available.

Steps to reproduce:

  1. Create an agent policy.
  2. Click Add agent> Standalone mode.
  3. Do not create api key and copy the yml and replace the same.
  4. Observe user is able to install the standalone agent with invalid API key.
  5. Now attempt to uninstall the agent, observe user is unable to uninstall the agent.

Expected Result: User should not be able to install standalone agent with invalid API key.

Screenshots: Image

elasticmachine commented 2 weeks ago

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

amolnater-qasource commented 2 weeks ago

@muskangulati-qasource Please review.

muskangulati-qasource commented 2 weeks ago

Secondary review is Done for this ticket!

ycombinator commented 2 weeks ago

I don't think we'd want to gate Agent installation on whether the API key used by the Elasticsearch output is valid or not. But I agree that failing to uninstall is a problem. WDYT @cmacknz?

cmacknz commented 2 weeks ago

Failing to uninstall is the problem we should fix, there are a couple issues related to this where invalid syntax in the configuration prevents uninstall: