[Cloud Security] Add Cloud Connectors CSPM Support#212200
[Cloud Security] Add Cloud Connectors CSPM Support#212200Omolola-Akinleye merged 32 commits intoelastic:mainfrom
Conversation
|
/ci |
|
/ci |
|
/ci |
|
/ci |
|
/ci |
|
Pinging @elastic/fleet (Team:Fleet) |
seanrathier
left a comment
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Since we are checking for other CSPs, should we be checking for gcp.supports_cloud_connectors and azure.supports_cloud_connectors?
There was a problem hiding this comment.
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')) { |
There was a problem hiding this comment.
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);
x-pack/solutions/security/plugins/cloud_security_posture/common/types_old.ts
Show resolved
Hide resolved
x-pack/solutions/security/plugins/cloud_security_posture/common/types_old.ts
Outdated
Show resolved
Hide resolved
| }: { | ||
| disabled: boolean; | ||
| setupTechnology: SetupTechnology; | ||
| isAgentless: boolean; |
There was a problem hiding this comment.
This makes sense, thanks!
seanrathier
left a comment
There was a problem hiding this comment.
Sorry, I approved by accident instead of commenting.
|
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
Page load bundle
History
|
## 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
## 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
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 providerLocally,
xpack.cloudSecurityPosture.enableExperimental: ['cloudConnectorsEnabled']will be setkibana.dev.ymlIn prod,
xpack.cloudSecurityPosture.enableExperimental: ['cloudConnectorsEnabled']will be set inkibana.ymland - Cloud Connector support is only available on AWS setup and AWS Deployed environmentHow 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_arnandexternal idshowCloudConnectors={true}