diff --git a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form_agentless.tsx b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form_agentless.tsx index 4e849197854ba..c730153a96254 100644 --- a/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form_agentless.tsx +++ b/x-pack/plugins/cloud_security_posture/public/components/fleet_extensions/aws_credentials_form/aws_credentials_form_agentless.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { EuiButton, EuiCallOut, EuiLink, EuiSpacer, EuiText } from '@elastic/eui'; +import { EuiAccordion, EuiButton, EuiCallOut, EuiLink, EuiSpacer, EuiText } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import semverCompare from 'semver/functions/compare'; import semverValid from 'semver/functions/valid'; @@ -68,7 +68,7 @@ Utilize AWS CloudFormation (a built-in AWS tool) or a series of manual steps to ), }} /> - +
    {isOrganization ? ( @@ -251,8 +251,16 @@ export const AwsCredentialsFormAgentless = ({ {awsCredentialsType === DEFAULT_AGENTLESS_AWS_CREDENTIALS_TYPE && showCloudCredentialsButton && ( <> - + Steps to Generate AWS Account Credentials} + paddingSize="l" + > + + + - +
    1. @@ -102,7 +110,7 @@ const GoogleCloudShellCredentialsGuide = (props: {
    2. Launch Google Cloud Shell, }} @@ -206,11 +214,19 @@ export const GcpCredentialsFormAgentless = ({ )} {showCloudCredentialsButton && ( <> - + Steps to Generate GCP Account Credentials} + paddingSize="l" + > + + + 0) && - !isAgentlessPackagePolicy(data!.item) && + !isAgentlessConfigured && hasFleetAddAgentsPrivileges; if (promptForAgentEnrollment && hasAzureArmTemplate) { diff --git a/x-pack/test/cloud_security_posture_functional/agentless/create_agent.ts b/x-pack/test/cloud_security_posture_functional/agentless/create_agent.ts index b4a72d355c68d..1b1497140875e 100644 --- a/x-pack/test/cloud_security_posture_functional/agentless/create_agent.ts +++ b/x-pack/test/cloud_security_posture_functional/agentless/create_agent.ts @@ -27,11 +27,13 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { describe('Agentless cloud', function () { let cisIntegration: typeof pageObjects.cisAddIntegration; + let cisIntegrationAws: typeof pageObjects.cisAddIntegration.cisAws; let mockApiServer: http.Server; before(async () => { cisIntegration = pageObjects.cisAddIntegration; - mockApiServer = mockAgentlessApiService.listen(8089); // Start the usage api mock server on port 8089 + cisIntegrationAws = pageObjects.cisAddIntegration.cisAws; + mockApiServer = await mockAgentlessApiService.listen(8089); // Start the usage api mock server on port 8081 }); after(async () => { @@ -58,6 +60,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await cisIntegration.clickSaveButton(); await pageObjects.header.waitUntilLoadingHasFinished(); + expect(await cisIntegrationAws.showPostInstallCloudFormationModal()).to.be(false); + await cisIntegration.navigateToIntegrationCspList(); await pageObjects.header.waitUntilLoadingHasFinished(); @@ -84,6 +88,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await cisIntegration.clickSaveButton(); await pageObjects.header.waitUntilLoadingHasFinished(); + expect(await cisIntegrationAws.showPostInstallCloudFormationModal()).to.be(true); + const agentPolicyName = await cisIntegration.getAgentBasedPolicyValue(); await cisIntegration.navigateToIntegrationCspList(); diff --git a/x-pack/test/cloud_security_posture_functional/page_objects/add_cis_integration_form_page.ts b/x-pack/test/cloud_security_posture_functional/page_objects/add_cis_integration_form_page.ts index 37b93d0864c2c..5337e23d985ae 100644 --- a/x-pack/test/cloud_security_posture_functional/page_objects/add_cis_integration_form_page.ts +++ b/x-pack/test/cloud_security_posture_functional/page_objects/add_cis_integration_form_page.ts @@ -54,6 +54,9 @@ export function AddCisIntegrationFormPageProvider({ getPostInstallCloudFormationModal: async () => { return await testSubjects.find('postInstallCloudFormationModal'); }, + showPostInstallCloudFormationModal: async () => { + return await testSubjects.exists('postInstallCloudFormationModal'); + }, showLaunchCloudFormationAgentlessButton: async () => { return await testSubjects.exists('launchCloudFormationAgentlessButton'); },