-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.14](backport #4965) "install -f" uses exec to uninstall an existin…
…g agent (#5021) * "install -f" uses exec to uninstall an existing agent (#4965) * Add explicit check for token and tamper protection in Uninstall func * fix typo * Load features from config, fix protection flag load * Change approach to execute elastic-agent uninstall command Change the approach that is taken when "elastic-agent install -f" is ran to use an exec to run "elastic-agent uninstall -f" in cases where the agent is installed. this allows the process that runs the uninstall to use all the correct path values for the installed agent instead of the values associated with the binary that the install command is ran from. * Add e2e test * lookup agent binary on path, fix test * fix test * Add flag that preserves old approach * fix typo * change args format in test * Use same fixture * Hide new option --------- Co-authored-by: Julien Lind <[email protected]> (cherry picked from commit 1d7b865) # Conflicts: # internal/pkg/agent/cmd/install.go # testing/integration/endpoint_security_test.go * cleanup --------- Co-authored-by: Michel Laterman <[email protected]> Co-authored-by: michel-laterman <[email protected]>
- Loading branch information
1 parent
3d9e68f
commit 4beef2c
Showing
4 changed files
with
182 additions
and
93 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
changelog/fragments/1718833116-Check-for-tamper-protection-when-uninstalling.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Kind can be one of: | ||
# - breaking-change: a change to previously-documented behavior | ||
# - deprecation: functionality that is being removed in a later release | ||
# - bug-fix: fixes a problem in a previous version | ||
# - enhancement: extends functionality but does not break or fix existing behavior | ||
# - feature: new functionality | ||
# - known-issue: problems that we are aware of in a given version | ||
# - security: impacts on the security of a product or a user’s deployment. | ||
# - upgrade: important information for someone upgrading from a prior version | ||
# - other: does not fit into any of the other categories | ||
kind: bug | ||
|
||
# Change summary; a 80ish characters long description of the change. | ||
summary: Use installed agent to uninstall itself when install -f is used. | ||
|
||
# Long description; in case the summary is not enough to describe the change | ||
# this field accommodate a description without length limits. | ||
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment. | ||
description: | | ||
When using "elastic-agent install -f", the agent will exec "elastic-agent uninstall -f" | ||
using the agent found in the system's path. This ensures all path references are correctly | ||
loaded and tamper protection errors will cause the install attempt to fail. | ||
# Affected component; a word indicating the component this changeset affects. | ||
component: | ||
|
||
# PR URL; optional; the PR number that added the changeset. | ||
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added. | ||
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number. | ||
# Please provide it if you are adding a fragment for a different PR. | ||
#pr: https://github.com/owner/repo/1234 | ||
|
||
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of). | ||
# If not present is automatically filled by the tooling with the issue linked to the PR number. | ||
issue: https://github.com/elastic/elastic-agent/issues/4506 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters