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

[Security Solution][Endpoint] several refactors of CLI tooling and associated common services #169987

Merged
merged 83 commits into from
Nov 13, 2023

Conversation

paul-tavares
Copy link
Contributor

@paul-tavares paul-tavares commented Oct 26, 2023

Summary

PR makes a series of refactors to CLI scripts and common services used in CLI scripts and CI, including:

  • Standard interface for interacting with Host VMs that abstracts away the need to know what VM manager was used to start that VM
    • Reduce/eliminate the need to have conditional code when interacting directly with a VM (ex. executing bash commands, stop/kill/delete VM, etc)
  • Removed use of endpoint_agent_runner (CLI script) private implementation methods from Cypress and replace them with calls to common services
  • Removed duplicate code from endpoint_agent_runner CLI script and replace it with calls to common services
  • Enhanced the run_sentinelone_host.js script so that it also ensures that the SentinenlOne fleet integration/policy (agentless policy) has at least one VM host running
    • The VM ensures that the data from S1 is pulled into ES
    • FYI: once changes for SentinelOne are merged and the Connector available, script will also be updated to create an SentinelOne connector instance under "Stack Management > Connectors"
  • Added support for WITH_FLEET_SERVER to the Cypress config. When set to true, fleet server will be automatically started and connected to the stack
    • Cypress parallel runner will now start fleet if this variable is true, right after setting up the stack

NOTE:
There is some work still left to remove dependency on env. variable CI from the common services and convert them back to pure methods/functions. That will be something for a later time

@paul-tavares paul-tavares added release_note:skip Skip the PR/issue when compiling release notes v8.12.0 labels Oct 26, 2023
@paul-tavares paul-tavares self-assigned this Oct 26, 2023
@paul-tavares paul-tavares added the Team:Defend Workflows “EDR Workflows” sub-team of Security Solution label Nov 1, 2023
@paul-tavares paul-tavares changed the title Task/olm scripts cleanup [Security Solution][Endpoint] several refactors of CLI tooling and associated common services Nov 1, 2023
@paul-tavares paul-tavares marked this pull request as ready for review November 12, 2023 16:57
@elasticmachine
Copy link
Contributor

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

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Investigations - Security Solution Cypress Tests #2 / Correlation tab should update timeline after removing eql should update timeline after removing eql

Metrics [docs]

Unknown metric groups

ESLint disabled in files

id before after diff
securitySolution 68 70 +2

ESLint disabled line counts

id before after diff
securitySolution 466 469 +3

Total ESLint disabled count

id before after diff
securitySolution 534 539 +5

History

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

cc @paul-tavares


export class FleetManager extends Manager {
private fleetContainerId?: string;
private log: ToolingLog;
private fleetServer: StartedFleetServer | undefined = undefined;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI: In the future, we may want to consider removing this module and replacing it with env.WITH_FLEET_SERVER in the Cypress config file.

Copy link
Member

@jbudz jbudz left a comment

Choose a reason for hiding this comment

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

src/dev/precommit_hook/casing_check_config.js

Copy link
Contributor

@patrykkopycinski patrykkopycinski left a comment

Choose a reason for hiding this comment

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

Thank you 🙇

Copy link
Member

@ashokaditya ashokaditya left a comment

Choose a reason for hiding this comment

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

🔥

@paul-tavares paul-tavares merged commit 8613b0f into elastic:main Nov 13, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Nov 13, 2023
@paul-tavares paul-tavares deleted the task/olm-scripts-cleanup branch November 13, 2023 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants