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

[Fleet] [Cloud Security Posture] Add CloudFormation agent install method #155045

Merged
merged 43 commits into from
Apr 26, 2023

Conversation

opauloh
Copy link
Contributor

@opauloh opauloh commented Apr 17, 2023

Summary

It solves: #153067

This PR introduces the new CloudFormation method to install the elastic agent.

Changes Summary

Fleet

  • Added cloud_formation_template_url to the AgentPolicy schema.
  • Added CloudFormation to the Platform selector (Fleet Managed only).
  • Added the onChangeAgentPolicy method to the fleet UI Extension of type package-policy-replace-define-step
  • Updated Platform selector to auto select CloudFormation tab when it's available

Cloud Security Posture

  • Updated the Cloud Security Posture integration to automatically set the cloud_formation_template_url in the PackagePolicy for the Vulnerability Management integration, it fetches the CloudFormation template from the @elastic/integrations repository

Screenshots

Add Agent Flyout when CloudFormation is provided

image

The Launch CloudFormation button opens the Launch CloudFormation Stack

image

@opauloh opauloh added Team:Cloud Security Cloud Security team related v8.8.0 labels Apr 17, 2023
@opauloh opauloh requested review from a team as code owners April 17, 2023 13:57
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security)

@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Apr 17, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@opauloh opauloh added release_note:skip Skip the PR/issue when compiling release notes release_note:feature Makes this part of the condensed release notes and removed release_note:skip Skip the PR/issue when compiling release notes labels Apr 17, 2023
@kfirpeled kfirpeled requested a review from jloleysens April 20, 2023 20:04
Copy link
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

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

Thanks for the PR here. The Fleet team wasn't aware of these incoming changes as far as I know, so please forgive me as I try to get some context here.

Is there any documentation or writing around why we only present CloudFormation here compared to other orchestration tools? Fleet hasn't necessarily coalesced on a single cloud platform or orchestration tool anywhere else in the docs/UI (yet), so it does seem a little jarring to present an AWS product in our UI like this.

Also, this is limited via a UI extension, right? So only CSP policies will ever display the CF interface in the policy selector, correct?

Few minor changes suggested in the diff.

@opauloh
Copy link
Contributor Author

opauloh commented Apr 21, 2023

Thanks for reviewing it @kpollich

Also, this is limited via a UI extension, right? So only CSP policies will ever display the CF interface in the policy selector, correct?

After chatting with @kfirpeled, we realized it's better not to add CloudFormation in the AgentPolicy like initially suggested because CSP is the only integration that will trigger that, so I reverted those changes. Instead, I added a utility that checks for cloud_formation_template_url as config in the Package Policy.

Is there any documentation or writing around why we only present CloudFormation here compared to other orchestration tools? Fleet hasn't necessarily coalesced on a single cloud platform or orchestration tool anywhere else in the docs/UI (yet), so it does seem a little jarring to present an AWS product in our UI like this.

There will be public documentation for deploying Elastic Agent with CloudFormation. Still, for now, it will be related to the CSP integration that supports it, so that is one more reason why it was better to remove it from the Agent Policy as a generally available feature.

Few minor changes suggested in the diff.

Thanks for those! I addressed the suggestions and would appreciate it if you could review them again.

Copy link
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

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

A few more React specific things to clean up in the UI here. Thanks for addressing the previous comments!

@opauloh opauloh requested a review from kpollich April 25, 2023 05:08
Copy link
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

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

LGTM 🚀 - thanks for making those changes! Appreciate the contributions 🙏

@opauloh opauloh enabled auto-merge (squash) April 25, 2023 20:35
@kibana-ci
Copy link
Collaborator

kibana-ci commented Apr 26, 2023

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
fleet 805 807 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
cloudSecurityPosture 192.3KB 193.2KB +912.0B
fleet 957.4KB 959.7KB +2.3KB
total +3.2KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
fleet 127.4KB 128.1KB +633.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
cloudSecurityPosture 11 12 +1
enterpriseSearch 17 19 +2
securitySolution 399 402 +3
total +6

Total ESLint disabled count

id before after diff
cloudSecurityPosture 12 13 +1
enterpriseSearch 18 20 +2
securitySolution 479 482 +3
total +6

History

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

@opauloh opauloh merged commit 0dad0c5 into elastic:main Apr 26, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Apr 26, 2023
jloleysens added a commit to jloleysens/kibana that referenced this pull request Apr 26, 2023
* main: (1294 commits)
  [SecuritySolution] Refactor security packages (elastic#155365)
  [Discover] Show "Temporary" badge for ad-hoc data views in Alerts flyout (elastic#155717)
  [RAM] Conditional actions feedback on pr review (elastic#155804)
  [Files] Adds bulk delete method (elastic#155628)
  [Lens] Use proper way to generate absolute short URL (elastic#155512)
  [Guided onboarding] Use Kibana features to grant access (elastic#155065)
  [Index Management] Fix duped mock (elastic#155844)
  [Lens] Enhance visualization modifier popup with layer palette (elastic#155280)
  Fix flaky combobox tests on role management screen (elastic#155711)
  [Infrastructure UI] Create InventoryViewsService and InventoryViewsClient (elastic#155126)
  [Fleet] always create agent upload write indices (elastic#155729)
  [Fleet] [Cloud Security Posture] Add CloudFormation agent install method (elastic#155045)
  Add tech preview label for search applications (elastic#155649)
  [ML] AIOps: Stabilize flaky functional tests. (elastic#155710)
  [ES UI Shared] Migrate JsonEditor to monaco (elastic#155610)
  [Security Solution] Fixes security_solution storybooks always rendering in a flyout (elastic#155814)
  [Synthetics] Make error popover disappear `onMouseLeave` of metric item card (elastic#155800)
  Remove Exploratory View components from Observability (elastic#155629)
  [Discover] Remove redundant "Filter was added" toast (elastic#155645)
  [RAM][Security Solution][Alerts] Support the ability to trigger a rule action per alert generated (elastic#153611) (elastic#155384)
  ...
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 ci:cloud-deploy Create or update a Cloud deployment release_note:feature Makes this part of the condensed release notes Team:Cloud Security Cloud Security team related Team:Fleet Team label for Observability Data Collection Fleet team v8.8.0
Projects
None yet
7 participants