Skip to content

[Cloud Security] Add Cloud Connectors CSPM Support#212200

Merged
Omolola-Akinleye merged 32 commits intoelastic:mainfrom
Omolola-Akinleye:cspm_cloud_connectors
May 9, 2025
Merged

[Cloud Security] Add Cloud Connectors CSPM Support#212200
Omolola-Akinleye merged 32 commits intoelastic:mainfrom
Omolola-Akinleye:cspm_cloud_connectors

Conversation

@Omolola-Akinleye
Copy link
Contributor

@Omolola-Akinleye Omolola-Akinleye commented Feb 24, 2025

Summary

Summarize your PR. If it involves visual changes include a screenshot or gif.
This PR adds support to Cloud Connector for CSPM.

  • Adds Cloud Connector Option for Credentials type

  • Cloud Formation UI opens an external Link to run Cloud Formation template which will generate the Role_ARN and External ID.

  • User will copy and paste those fields to input fields

  • Updates Agentless Policy to include cloud connector enabled support and the target cloud server provider

  • Locally, xpack.cloudSecurityPosture.enableExperimental: ['cloudConnectorsEnabled'] will be set kibana.dev.yml

  • In prod, xpack.cloudSecurityPosture.enableExperimental: ['cloudConnectorsEnabled'] will be set in kibana.yml and - Cloud Connector support is only available on AWS setup and AWS Deployed environment

Screenshot 2025-05-05 at 9 47 17 AM Screenshot 2025-05-05 at 9 47 32 AM

How to run Locally:

E2E workflow is not supported yet for Cloud Connectors but we can see the updated UX with AgentPolicy being configured with cloud connector properties {enabled: true, target_csp: 'aws'} and Package Policy being configured
role_arn and external id

  1. Search for `showCloudConnectors={showCloudConnectors}
  2. Change property to true showCloudConnectors={true}
  3. Select Cloud Connectors options and you should see the feature screenshot above
@Omolola-Akinleye Omolola-Akinleye added the ci:cloud-deploy Create or update a Cloud deployment label Feb 24, 2025
@Omolola-Akinleye Omolola-Akinleye self-assigned this Feb 24, 2025
@Omolola-Akinleye
Copy link
Contributor Author

/ci

@Omolola-Akinleye
Copy link
Contributor Author

/ci

@Omolola-Akinleye
Copy link
Contributor Author

/ci

@Omolola-Akinleye
Copy link
Contributor Author

/ci

@Omolola-Akinleye Omolola-Akinleye marked this pull request as ready for review March 18, 2025 15:30
@Omolola-Akinleye Omolola-Akinleye requested review from a team as code owners March 18, 2025 15:30
@Omolola-Akinleye Omolola-Akinleye changed the title [Cloud Security] Add Cloud Connectors CSPM Support Mar 18, 2025
@Omolola-Akinleye
Copy link
Contributor Author

/ci

@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Mar 20, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@Omolola-Akinleye Omolola-Akinleye changed the title [Cloud Security] Add Cloud Connectors CSPM Support poc May 5, 2025
@Omolola-Akinleye Omolola-Akinleye added backport:skip This PR does not require backporting v8.19.0 v9.1.0 release_note:feature Makes this part of the condensed release notes labels May 5, 2025
Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

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

Fleet change LGTM

Copy link
Contributor

@seanrathier seanrathier left a comment

Choose a reason for hiding this comment

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

Great work, just one comment but not blocking.

I was fixated on this section for a while trying to figure out what was happening. Might be good to add a comment if you can.

const input = packagePolicy.inputs?.filter(
(pinput: NewPackagePolicyInput) => pinput.enabled === true
)[0];
const enabled = input?.streams?.[0]?.vars?.['aws.supports_cloud_connectors']?.value;
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we are checking for other CSPs, should we be checking for gcp.supports_cloud_connectors and azure.supports_cloud_connectors?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So for right now, Cloud Connectors is supported for aws. However, you raise a good point and maybe we should change the name field to be more generic support_cloud_connectors.

if (input?.type.includes('aws')) {
targetCsp = 'aws';
}
if (input?.type.includes('gcp')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I've seen a similar pattern here and I quickly looked it up. While this is not wrong, but something to consider the following.

function findFirstInstanceCsp(inputType, pattern) {
    const regex = new RegExp("aws|gcp|azure", "i");
    const match = inputType.match(regex);
    return match ? match[0] : null;
}

const targetCsp = findFirstInstanceCsp(input?.type);

}: {
disabled: boolean;
setupTechnology: SetupTechnology;
isAgentless: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes sense, thanks!

Copy link
Contributor

@seanrathier seanrathier left a comment

Choose a reason for hiding this comment

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

Sorry, I approved by accident instead of commenting.

@seanrathier seanrathier self-requested a review May 6, 2025 21:18
@Omolola-Akinleye Omolola-Akinleye enabled auto-merge (squash) May 8, 2025 18:42
@Omolola-Akinleye Omolola-Akinleye removed the request for review from seanrathier May 9, 2025 14:06
@Omolola-Akinleye
Copy link
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

elasticmachine commented May 9, 2025

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Fleet Cypress Tests #1 / View agents list Agent status filter should filter on healthy and unhealthy
  • [job] [logs] Fleet Cypress Tests #1 / View agents list Bulk actions should allow to bulk upgrade agents and cancel that upgrade

Metrics [docs]

Async chunks

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

id before after diff
cloudSecurityPosture 518.4KB 524.4KB +6.0KB
fleet 1.7MB 1.7MB +783.0B
total +6.7KB

Page load bundle

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

id before after diff
cloudSecurityPosture 18.0KB 18.1KB +101.0B

History

cc @Omolola-Akinleye

@Omolola-Akinleye Omolola-Akinleye merged commit 2bae707 into elastic:main May 9, 2025
9 checks passed
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.
This PR adds support to Cloud Connector for CSPM.

- Adds Cloud Connector Option for Credentials type

- Cloud Formation UI opens an external Link to run Cloud Formation
template which will generate the Role_ARN and External ID.
- User will copy and paste those fields to input fields
- Updates Agentless Policy to include cloud connector enabled support
and the target `cloud server provider`
- Locally, ` xpack.cloudSecurityPosture.enableExperimental:
['cloudConnectorsEnabled']` will be set `kibana.dev.yml`
- In prod, ` xpack.cloudSecurityPosture.enableExperimental:
['cloudConnectorsEnabled']` will be set in `kibana.yml` and - Cloud
Connector support is only available on AWS setup and AWS Deployed
environment

<img width="1723" alt="Screenshot 2025-05-05 at 9 47 17 AM"
src="https://github.com/user-attachments/assets/13d29190-abfb-4cd0-9f1b-9d0012d1f70c"
/>

<img width="971" alt="Screenshot 2025-05-05 at 9 47 32 AM"
src="https://github.com/user-attachments/assets/043cb3a0-0760-4dfd-9381-5fee37068848"
/>


### How to run Locally:

E2E workflow is not supported yet for Cloud Connectors but we can see
the updated UX with AgentPolicy being configured with cloud connector
properties {enabled: true, target_csp: 'aws'} and Package Policy being
configured
`role_arn` and `external id`  

1.  Search for `showCloudConnectors={showCloudConnectors}
2. Change property to true  `showCloudConnectors={true}`
3. Select Cloud Connectors options and you should see the feature
screenshot above
qn895 pushed a commit to qn895/kibana that referenced this pull request Jun 3, 2025
## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.
This PR adds support to Cloud Connector for CSPM.

- Adds Cloud Connector Option for Credentials type

- Cloud Formation UI opens an external Link to run Cloud Formation
template which will generate the Role_ARN and External ID.
- User will copy and paste those fields to input fields
- Updates Agentless Policy to include cloud connector enabled support
and the target `cloud server provider`
- Locally, ` xpack.cloudSecurityPosture.enableExperimental:
['cloudConnectorsEnabled']` will be set `kibana.dev.yml`
- In prod, ` xpack.cloudSecurityPosture.enableExperimental:
['cloudConnectorsEnabled']` will be set in `kibana.yml` and - Cloud
Connector support is only available on AWS setup and AWS Deployed
environment

<img width="1723" alt="Screenshot 2025-05-05 at 9 47 17 AM"
src="https://github.com/user-attachments/assets/13d29190-abfb-4cd0-9f1b-9d0012d1f70c"
/>

<img width="971" alt="Screenshot 2025-05-05 at 9 47 32 AM"
src="https://github.com/user-attachments/assets/043cb3a0-0760-4dfd-9381-5fee37068848"
/>


### How to run Locally:

E2E workflow is not supported yet for Cloud Connectors but we can see
the updated UX with AgentPolicy being configured with cloud connector
properties {enabled: true, target_csp: 'aws'} and Package Policy being
configured
`role_arn` and `external id`  

1.  Search for `showCloudConnectors={showCloudConnectors}
2. Change property to true  `showCloudConnectors={true}`
3. Select Cloud Connectors options and you should see the feature
screenshot above
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 ci:cloud-deploy Create or update a Cloud deployment release_note:feature Makes this part of the condensed release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.19.0 v9.1.0

4 participants