[Security Solution][Endpoint] Cleanup and improvements to run_endpoint_agent.js CLI tool#155730
Merged
paul-tavares merged 7 commits intoelastic:mainfrom Apr 27, 2023
Conversation
…mon fleet service function
… calls to new common services
Contributor
|
Pinging @elastic/security-defend-workflows (Team:Defend Workflows) |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
To update your PR or re-run it, just comment with: |
joeypoon
approved these changes
Apr 26, 2023
dasansol92
reviewed
Apr 27, 2023
| super('agent_download_storage_settings.json', { | ||
| defaultSettings: { | ||
| maxFileAge: 1.728e8, // 2 days | ||
| lastCleanup: new Date().toISOString(), |
Contributor
There was a problem hiding this comment.
How this works? Each time we run the script this is gonna take the current Date, so last cleanup will be always now right? Am I missing something?
Contributor
Author
There was a problem hiding this comment.
Yes and no.
This is the default value for the configuration for this tool. If you look at super.ensureExists() you will see that it uses this only if the settings file does not yet exist.
Contributor
There was a problem hiding this comment.
Got it, thanks for the explanation!
dasansol92
approved these changes
Apr 27, 2023
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
As a follow up to PR #155455 :
run_endpoint_agentCLI: Removed internal code that handles the creation of a VM and the enrollment of the agent with fleet and replaced it with use of methods now found inendpoint_host_servicesrun_endpoint_agentto use cached version of agent download, and thus increase the performance of this tool