Skip to content

[Security Solution][Endpoint] Cleanup and improvements to run_endpoint_agent.js CLI tool#155730

Merged
paul-tavares merged 7 commits intoelastic:mainfrom
paul-tavares:task/endpoint-agent-runner-cli-tool-cleanup
Apr 27, 2023
Merged

[Security Solution][Endpoint] Cleanup and improvements to run_endpoint_agent.js CLI tool#155730
paul-tavares merged 7 commits intoelastic:mainfrom
paul-tavares:task/endpoint-agent-runner-cli-tool-cleanup

Conversation

@paul-tavares
Copy link
Copy Markdown
Contributor

Summary

As a follow up to PR #155455 :

  • run_endpoint_agent CLI: 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 in endpoint_host_services
  • created new service for managing agent download cache on local system
  • enhanced run_endpoint_agent to use cached version of agent download, and thus increase the performance of this tool

@paul-tavares paul-tavares added release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v8.9.0 labels Apr 25, 2023
@paul-tavares paul-tavares requested a review from a team as a code owner April 25, 2023 15:09
@paul-tavares paul-tavares self-assigned this Apr 25, 2023
@paul-tavares paul-tavares requested a review from a team as a code owner April 25, 2023 15:09
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/security-defend-workflows (Team:Defend Workflows)

@kibana-ci
Copy link
Copy Markdown

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #46 / spaces api without security get can't access not-a-space from within the default space "before all" hook for "should return 404 when referencing the default space implicitly"

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 17 19 +2
securitySolution 397 400 +3
total +5

Total ESLint disabled count

id before after diff
enterpriseSearch 18 20 +2
securitySolution 477 480 +3
total +5

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @paul-tavares

super('agent_download_storage_settings.json', {
defaultSettings: {
maxFileAge: 1.728e8, // 2 days
lastCleanup: new Date().toISOString(),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks for the explanation!

@paul-tavares paul-tavares requested a review from dasansol92 April 27, 2023 15:29
@paul-tavares paul-tavares merged commit 99ee941 into elastic:main Apr 27, 2023
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Apr 27, 2023
@paul-tavares paul-tavares deleted the task/endpoint-agent-runner-cli-tool-cleanup branch April 27, 2023 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting OLM Sprint release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v8.9.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants