-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Cloud Security] Render Setup Technology Selector based on deployment…
… mode (#194347)
- Loading branch information
1 parent
d0fb004
commit 2609a53
Showing
12 changed files
with
150 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
x-pack/test/cloud_security_posture_functional/agentless/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { FtrProviderContext } from '../ftr_provider_context'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default function ({ loadTestFile }: FtrProviderContext) { | ||
describe('Cloud Security Posture', function () { | ||
loadTestFile(require.resolve('./create_agent')); | ||
loadTestFile(require.resolve('./security_posture')); | ||
}); | ||
} |
87 changes: 87 additions & 0 deletions
87
x-pack/test/cloud_security_posture_functional/agentless/security_posture.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { CLOUD_CREDENTIALS_PACKAGE_VERSION } from '@kbn/cloud-security-posture-plugin/common/constants'; | ||
import expect from '@kbn/expect'; | ||
import type { FtrProviderContext } from '../ftr_provider_context'; | ||
// eslint-disable-next-line import/no-default-export | ||
export default function ({ getPageObjects, getService }: FtrProviderContext) { | ||
const testSubjects = getService('testSubjects'); | ||
const pageObjects = getPageObjects([ | ||
'common', | ||
'cspSecurity', | ||
'security', | ||
'header', | ||
'cisAddIntegration', | ||
]); | ||
|
||
const KSPM_RADIO_OPTION = 'policy-template-radio-button-kspm'; | ||
const CSPM_RADIO_OPTION = 'policy-template-radio-button-cspm'; | ||
const CNVM_RADIO_OPTION = 'policy-template-radio-button-vuln_mgmt'; | ||
|
||
const POLICY_NAME_FIELD = 'createAgentPolicyNameField'; | ||
const SETUP_TECHNOLOGY_SELECTOR = 'setup-technology-selector-accordion'; | ||
|
||
describe('Agentless Security Posture Integration Options', function () { | ||
let cisIntegration: typeof pageObjects.cisAddIntegration; | ||
|
||
before(async () => { | ||
cisIntegration = pageObjects.cisAddIntegration; | ||
}); | ||
|
||
after(async () => { | ||
await pageObjects.cspSecurity.logout(); | ||
}); | ||
|
||
it(`should show kspm without agentless option`, async () => { | ||
await cisIntegration.navigateToAddIntegrationWithVersionPage( | ||
CLOUD_CREDENTIALS_PACKAGE_VERSION | ||
); | ||
|
||
await cisIntegration.clickOptionButton(KSPM_RADIO_OPTION); | ||
await pageObjects.header.waitUntilLoadingHasFinished(); | ||
|
||
const hasSetupTechnologySelector = await testSubjects.exists(SETUP_TECHNOLOGY_SELECTOR); | ||
const hasAgentBased = await testSubjects.exists(POLICY_NAME_FIELD); | ||
|
||
expect(hasSetupTechnologySelector).to.be(false); | ||
expect(hasAgentBased).to.be(true); | ||
}); | ||
|
||
it(`should show cnvm without agentless option`, async () => { | ||
// const integrationPolicyName = `cloud_security_posture-${new Date().toISOString()}`; | ||
await cisIntegration.navigateToAddIntegrationWithVersionPage( | ||
CLOUD_CREDENTIALS_PACKAGE_VERSION | ||
); | ||
|
||
await cisIntegration.clickOptionButton(CNVM_RADIO_OPTION); | ||
await pageObjects.header.waitUntilLoadingHasFinished(); | ||
|
||
const hasSetupTechnologySelector = await testSubjects.exists(SETUP_TECHNOLOGY_SELECTOR); | ||
const hasAgentBased = await testSubjects.exists(POLICY_NAME_FIELD); | ||
|
||
expect(hasSetupTechnologySelector).to.be(false); | ||
expect(hasAgentBased).to.be(true); | ||
}); | ||
|
||
it(`should show cspm with agentless option`, async () => { | ||
// const integrationPolicyName = `cloud_security_posture-${new Date().toISOString()}`; | ||
await cisIntegration.navigateToAddIntegrationWithVersionPage( | ||
CLOUD_CREDENTIALS_PACKAGE_VERSION | ||
); | ||
|
||
await cisIntegration.clickOptionButton(CSPM_RADIO_OPTION); | ||
await pageObjects.header.waitUntilLoadingHasFinished(); | ||
|
||
const hasSetupTechnologySelector = await testSubjects.exists(SETUP_TECHNOLOGY_SELECTOR); | ||
const hasAgentBased = await testSubjects.exists(POLICY_NAME_FIELD); | ||
|
||
expect(hasSetupTechnologySelector).to.be(true); | ||
expect(hasAgentBased).to.be(true); | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters