mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[SecuritySolution] Revert defend-workflows integration tests (#187257)
## Summary https://github.com/elastic/kibana/pull/183611 I moved x-pack/test/security_solution_endpoint to x-pack/test/security_solution_api_integration in https://github.com/elastic/kibana/pull/183611 as I thought all the tests regarding Security Solution should live there. However security_solution_endpoint are not api tests , they are UI tests. After discussions, we decided to move security_solution_endpoint back to `x-pack/test/` The two files below are shared between `x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint_api_int` and `x-pack/test/security_solution_endpoint`, moved them to `services` in this PR to avoid type check confusion. - x-pack/test/common/services/security_solution/endpoint_data_stream_helpers.ts - x-pack/test/common/services/security_solution/endpoint_registry_helpers.ts --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
76cc844cf4
commit
756e9c100b
57 changed files with 966 additions and 1026 deletions
|
@ -13,10 +13,8 @@ disabled:
|
|||
- x-pack/test/security_solution_api_integration/config/ess/config.base.basic.ts
|
||||
- x-pack/test/security_solution_api_integration/config/serverless/config.base.ts
|
||||
- x-pack/test/security_solution_api_integration/config/serverless/config.base.essentials.ts
|
||||
- x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint/configs/config.base.ts
|
||||
- x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint_api_int/configs/config.base.ts
|
||||
- x-pack/test/security_solution_endpoint/config.base.ts
|
||||
- x-pack/test/security_solution_endpoint_api_int/config.base.ts
|
||||
- x-pack/test/security_solution_endpoint/configs/config.base.ts
|
||||
|
||||
# QA suites that are run out-of-band
|
||||
- x-pack/test/stack_functional_integration/configs/config.stack_functional_integration_base.js
|
||||
|
@ -408,6 +406,10 @@ enabled:
|
|||
- x-pack/test/security_functional/insecure_cluster_warning.config.ts
|
||||
- x-pack/test/security_functional/user_profiles.config.ts
|
||||
- x-pack/test/security_functional/expired_session.config.ts
|
||||
- x-pack/test/security_solution_endpoint/configs/endpoint.config.ts
|
||||
- x-pack/test/security_solution_endpoint/configs/serverless.endpoint.config.ts
|
||||
- x-pack/test/security_solution_endpoint/configs/integrations.config.ts
|
||||
- x-pack/test/security_solution_endpoint/configs/serverless.integrations.config.ts
|
||||
- x-pack/test/session_view/basic/config.ts
|
||||
- x-pack/test/spaces_api_integration/security_and_spaces/config_basic.ts
|
||||
- x-pack/test/spaces_api_integration/security_and_spaces/copy_to_space_config_basic.ts
|
||||
|
@ -580,7 +582,3 @@ enabled:
|
|||
- x-pack/test/security_solution_api_integration/test_suites/sources/indices/trial_license_complete_tier/configs/serverless.config.ts
|
||||
- x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint_api_int/configs/config.ts
|
||||
- x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint_api_int/configs/serverless.config.ts
|
||||
- x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint/configs/endpoint.config.ts
|
||||
- x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint/configs/serverless.endpoint.config.ts
|
||||
- x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint/configs/integrations.config.ts
|
||||
- x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint/configs/serverless.integrations.config.ts
|
||||
|
|
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
|
@ -1617,7 +1617,7 @@ x-pack/test/security_solution_cypress/cypress/tasks/expandable_flyout @elastic/
|
|||
/x-pack/plugins/security_solution/server/lib/license/ @elastic/security-defend-workflows
|
||||
/x-pack/plugins/security_solution/server/fleet_integration/ @elastic/security-defend-workflows
|
||||
/x-pack/plugins/security_solution/scripts/endpoint/ @elastic/security-defend-workflows
|
||||
/x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint/ @elastic/security-defend-workflows
|
||||
/x-pack/test/security_solution_endpoint/ @elastic/security-defend-workflows
|
||||
/x-pack/test/security_solution_api_integration/test_suites/security_solution_endpoint_api_int/ @elastic/security-defend-workflows
|
||||
/x-pack/test_serverless/shared/lib/security/kibana_roles/ @elastic/security-defend-workflows
|
||||
/x-pack/plugins/security_solution_serverless/public/upselling/sections/endpoint_management @elastic/security-defend-workflows
|
||||
|
|
|
@ -0,0 +1,145 @@
|
|||
/*
|
||||
* 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 { Client } from '@elastic/elasticsearch';
|
||||
import { AGENTS_INDEX } from '@kbn/fleet-plugin/common';
|
||||
import {
|
||||
alertsIndexPattern,
|
||||
eventsIndexPattern,
|
||||
METADATA_DATASTREAM,
|
||||
METADATA_UNITED_INDEX,
|
||||
metadataCurrentIndexPattern,
|
||||
metadataIndexPattern,
|
||||
policyIndexPattern,
|
||||
telemetryIndexPattern,
|
||||
} from '@kbn/security-solution-plugin/common/endpoint/constants';
|
||||
|
||||
export function SecuritySolutionEndpointDataStreamHelpers() {
|
||||
function deleteDataStream(getService: (serviceName: 'es') => Client, index: string) {
|
||||
const client = getService('es');
|
||||
return client.transport.request(
|
||||
{
|
||||
method: 'DELETE',
|
||||
path: `_data_stream/${index}`,
|
||||
},
|
||||
{
|
||||
ignore: [404],
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
async function deleteAllDocsFromIndex(getService: (serviceName: 'es') => Client, index: string) {
|
||||
const client = getService('es');
|
||||
await client.deleteByQuery(
|
||||
{
|
||||
query: {
|
||||
match_all: {},
|
||||
},
|
||||
index,
|
||||
wait_for_completion: true,
|
||||
refresh: true,
|
||||
},
|
||||
{
|
||||
ignore: [404],
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
async function deleteIndex(getService: (serviceName: 'es') => Client, index: string) {
|
||||
const client = getService('es');
|
||||
await client.indices.delete({ index, ignore_unavailable: true });
|
||||
}
|
||||
|
||||
async function deleteMetadataStream(getService: (serviceName: 'es') => Client) {
|
||||
await deleteDataStream(getService, metadataIndexPattern);
|
||||
}
|
||||
|
||||
async function deleteAllDocsFromMetadataDatastream(getService: (serviceName: 'es') => Client) {
|
||||
await deleteAllDocsFromIndex(getService, METADATA_DATASTREAM);
|
||||
}
|
||||
|
||||
async function deleteAllDocsFromMetadataCurrentIndex(getService: (serviceName: 'es') => Client) {
|
||||
await deleteAllDocsFromIndex(getService, metadataCurrentIndexPattern);
|
||||
}
|
||||
|
||||
async function deleteAllDocsFromMetadataUnitedIndex(getService: (serviceName: 'es') => Client) {
|
||||
await deleteAllDocsFromIndex(getService, METADATA_UNITED_INDEX);
|
||||
}
|
||||
|
||||
async function deleteEventsStream(getService: (serviceName: 'es') => Client) {
|
||||
await deleteDataStream(getService, eventsIndexPattern);
|
||||
}
|
||||
|
||||
async function deleteAlertsStream(getService: (serviceName: 'es') => Client) {
|
||||
await deleteDataStream(getService, alertsIndexPattern);
|
||||
}
|
||||
|
||||
async function deletePolicyStream(getService: (serviceName: 'es') => Client) {
|
||||
await deleteDataStream(getService, policyIndexPattern);
|
||||
}
|
||||
|
||||
async function deleteTelemetryStream(getService: (serviceName: 'es') => Client) {
|
||||
await deleteDataStream(getService, telemetryIndexPattern);
|
||||
}
|
||||
|
||||
function deleteAllDocsFromFleetAgents(getService: (serviceName: 'es') => Client) {
|
||||
return deleteAllDocsFromIndex(getService, AGENTS_INDEX);
|
||||
}
|
||||
|
||||
function stopTransform(getService: (serviceName: 'es') => Client, transformId: string) {
|
||||
const client = getService('es');
|
||||
const stopRequest = {
|
||||
transform_id: transformId,
|
||||
force: true,
|
||||
wait_for_completion: true,
|
||||
allow_no_match: true,
|
||||
};
|
||||
return client.transform.stopTransform(stopRequest);
|
||||
}
|
||||
|
||||
async function startTransform(getService: (serviceName: 'es') => Client, transformId: string) {
|
||||
const client = getService('es');
|
||||
const transformsResponse = await client.transform.getTransform({
|
||||
transform_id: `${transformId}*`,
|
||||
});
|
||||
return Promise.all(
|
||||
transformsResponse.transforms.map((transform) => {
|
||||
const t = transform as unknown as { id: string };
|
||||
return client.transform.startTransform({ transform_id: t.id });
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
function bulkIndex(getService: (serviceName: 'es') => Client, index: string, docs: unknown[]) {
|
||||
const operations = docs.flatMap((doc) => [{ create: { _index: index } }, doc]);
|
||||
const client = getService('es');
|
||||
|
||||
return client.bulk({
|
||||
index,
|
||||
refresh: 'wait_for',
|
||||
operations,
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
deleteDataStream,
|
||||
deleteAllDocsFromIndex,
|
||||
deleteIndex,
|
||||
deleteMetadataStream,
|
||||
deleteAllDocsFromMetadataDatastream,
|
||||
deleteAllDocsFromMetadataCurrentIndex,
|
||||
deleteAllDocsFromMetadataUnitedIndex,
|
||||
deleteEventsStream,
|
||||
deleteAlertsStream,
|
||||
deletePolicyStream,
|
||||
deleteTelemetryStream,
|
||||
deleteAllDocsFromFleetAgents,
|
||||
stopTransform,
|
||||
startTransform,
|
||||
bulkIndex,
|
||||
};
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
* 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 path from 'path';
|
||||
|
||||
import { defineDockerServersConfig } from '@kbn/test';
|
||||
import { dockerImage as ingestDockerImage } from '../../../fleet_api_integration/config.base';
|
||||
|
||||
export function SecuritySolutionEndpointRegistryHelpers() {
|
||||
/**
|
||||
* This is used by CI to set the docker registry port
|
||||
* you can also define this environment variable locally when running tests which
|
||||
* will spin up a local docker package registry locally for you
|
||||
* if this is defined it takes precedence over the `packageRegistryOverride` variable
|
||||
*/
|
||||
const dockerRegistryPort: string | undefined = process.env.FLEET_PACKAGE_REGISTRY_PORT;
|
||||
|
||||
/**
|
||||
* If you don't want to use the docker image version pinned below and instead want to run your own
|
||||
* registry or use an external registry you can define this environment variable when running
|
||||
* the tests to use that registry url instead.
|
||||
*
|
||||
* This is particularly useful when a developer needs to test a new package against the kibana
|
||||
* integration or functional tests. Instead of having to publish a whole new docker image we
|
||||
* can set this environment variable which will point to the location of where your package registry
|
||||
* is serving the updated package.
|
||||
*
|
||||
* This variable will not and should not be used by CI. CI should always use the pinned docker image below.
|
||||
*/
|
||||
const packageRegistryOverride: string | undefined = process.env.PACKAGE_REGISTRY_URL_OVERRIDE;
|
||||
|
||||
const defaultRegistryConfigPath = path.join(__dirname, './fixtures/package_registry_config.yml');
|
||||
|
||||
const getRegistryUrlFromTestEnv = () => {
|
||||
let registryUrl: string | undefined;
|
||||
if (dockerRegistryPort !== undefined) {
|
||||
registryUrl = `--xpack.fleet.registryUrl=http://localhost:${dockerRegistryPort}`;
|
||||
} else if (packageRegistryOverride !== undefined) {
|
||||
registryUrl = `--xpack.fleet.registryUrl=${packageRegistryOverride}`;
|
||||
}
|
||||
return registryUrl;
|
||||
};
|
||||
|
||||
const isRegistryEnabled = () => {
|
||||
return getRegistryUrlFromTestEnv() !== undefined;
|
||||
};
|
||||
|
||||
return {
|
||||
createEndpointDockerConfig(
|
||||
packageRegistryConfig: string = defaultRegistryConfigPath,
|
||||
dockerImage: string = ingestDockerImage,
|
||||
dockerArgs: string[] = []
|
||||
) {
|
||||
const args: string[] = [
|
||||
'-v',
|
||||
`${packageRegistryConfig}:/package-registry/config.yml`,
|
||||
...dockerArgs,
|
||||
];
|
||||
return defineDockerServersConfig({
|
||||
registry: {
|
||||
enabled: !!dockerRegistryPort,
|
||||
image: dockerImage,
|
||||
portInContainer: 8080,
|
||||
port: dockerRegistryPort,
|
||||
args,
|
||||
waitForLogLine: 'package manifests loaded',
|
||||
waitForLogLineTimeoutMs: 60 * 2 * 10000, // 2 minutes,
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
getRegistryUrlFromTestEnv,
|
||||
|
||||
getRegistryUrlAsArray(): string[] {
|
||||
const registryUrl: string | undefined = getRegistryUrlFromTestEnv();
|
||||
return registryUrl !== undefined ? [registryUrl] : [];
|
||||
},
|
||||
|
||||
isRegistryEnabled,
|
||||
};
|
||||
}
|
|
@ -6,3 +6,5 @@
|
|||
*/
|
||||
|
||||
export * from './roles_users_utils';
|
||||
export * from './endpoint_data_stream_helpers';
|
||||
export * from './endpoint_registry_helpers';
|
||||
|
|
|
@ -1,460 +0,0 @@
|
|||
/*
|
||||
* 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 expect from '@kbn/expect';
|
||||
import { IndexedHostsAndAlertsResponse } from '@kbn/security-solution-plugin/common/endpoint/index_data';
|
||||
import { PROTECTION_NOTICE_SUPPORTED_ENDPOINT_VERSION } from '@kbn/security-solution-plugin/public/management/pages/policy/view/policy_settings_form/protection_notice_supported_endpoint_version';
|
||||
import { getPolicySettingsFormTestSubjects } from '@kbn/security-solution-plugin/public/management/pages/policy/view/policy_settings_form/mocks';
|
||||
import { FtrProviderContext } from '../../configs/ftr_provider_context';
|
||||
import { PolicyTestResourceInfo } from '../../services/endpoint_policy';
|
||||
|
||||
export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const browser = getService('browser');
|
||||
const pageObjects = getPageObjects([
|
||||
'common',
|
||||
'endpoint',
|
||||
'policy',
|
||||
'endpointPageUtils',
|
||||
'ingestManagerCreatePackagePolicy',
|
||||
'trustedApps',
|
||||
]);
|
||||
const testSubjects = getService('testSubjects');
|
||||
const policyTestResources = getService('policyTestResources');
|
||||
const endpointTestResources = getService('endpointTestResources');
|
||||
const retry = getService('retry');
|
||||
const timeout = 150000;
|
||||
describe('@ess @serverless When on the Endpoint Policy Details Page', function () {
|
||||
let indexedData: IndexedHostsAndAlertsResponse;
|
||||
const formTestSubjects = getPolicySettingsFormTestSubjects();
|
||||
|
||||
before(async () => {
|
||||
indexedData = await endpointTestResources.loadEndpointData();
|
||||
await browser.refresh();
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await endpointTestResources.unloadEndpointData(indexedData);
|
||||
});
|
||||
|
||||
describe('with an invalid policy id', () => {
|
||||
it('should display an error', async () => {
|
||||
await pageObjects.policy.navigateToPolicyDetails('invalid-id');
|
||||
await testSubjects.existOrFail('policyDetailsIdNotFoundMessage');
|
||||
expect(await testSubjects.getVisibleText('policyDetailsIdNotFoundMessage')).to.equal(
|
||||
'Package policy invalid-id not found'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('with a valid policy id', () => {
|
||||
let policyInfo: PolicyTestResourceInfo;
|
||||
|
||||
before(async () => {
|
||||
policyInfo = await policyTestResources.createPolicy();
|
||||
await pageObjects.policy.navigateToPolicyDetails(policyInfo.packagePolicy.id);
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
if (policyInfo) {
|
||||
await policyInfo.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
it(
|
||||
'should display policy view',
|
||||
async () => {
|
||||
await retry.waitForWithTimeout('policy title is not empty', 120_000, async () => {
|
||||
return (await testSubjects.getVisibleText('header-page-title')) !== '';
|
||||
});
|
||||
expect(await testSubjects.getVisibleText('header-page-title')).to.equal(
|
||||
policyInfo.packagePolicy.name
|
||||
);
|
||||
},
|
||||
timeout
|
||||
);
|
||||
|
||||
describe('@skipInServerless side navigation', function () {
|
||||
it(
|
||||
'should not hide the side navigation',
|
||||
async function () {
|
||||
await testSubjects.scrollIntoView('solutionSideNavItemLink-get_started');
|
||||
// ensure center of button is visible and not hidden by sticky bottom bar
|
||||
await testSubjects.click('solutionSideNavItemLink-administration', 1000, 15);
|
||||
// test cleanup: go back to policy details page
|
||||
await pageObjects.policy.navigateToPolicyDetails(policyInfo.packagePolicy.id);
|
||||
},
|
||||
timeout
|
||||
);
|
||||
});
|
||||
|
||||
it(
|
||||
'Should show/hide advanced section when button is clicked',
|
||||
async () => {
|
||||
await testSubjects.missingOrFail(formTestSubjects.advancedSection.settingsContainer);
|
||||
|
||||
// Expand
|
||||
await pageObjects.policy.showAdvancedSettingsSection();
|
||||
await testSubjects.existOrFail(formTestSubjects.advancedSection.settingsContainer);
|
||||
|
||||
// Collapse
|
||||
await pageObjects.policy.hideAdvancedSettingsSection();
|
||||
await testSubjects.missingOrFail(formTestSubjects.advancedSection.settingsContainer);
|
||||
},
|
||||
timeout
|
||||
);
|
||||
});
|
||||
|
||||
['malware', 'ransomware'].forEach((protection) => {
|
||||
describe(`on the ${protection} protections card`, () => {
|
||||
let policyInfo: PolicyTestResourceInfo;
|
||||
const cardTestSubj:
|
||||
| typeof formTestSubjects['ransomware']
|
||||
| typeof formTestSubjects['malware'] =
|
||||
formTestSubjects[
|
||||
protection as keyof Pick<typeof formTestSubjects, 'malware' | 'ransomware'>
|
||||
];
|
||||
|
||||
beforeEach(async () => {
|
||||
policyInfo = await policyTestResources.createPolicy();
|
||||
await pageObjects.policy.navigateToPolicyDetails(policyInfo.packagePolicy.id);
|
||||
}, timeout);
|
||||
|
||||
afterEach(async () => {
|
||||
if (policyInfo) {
|
||||
await policyInfo.cleanup();
|
||||
|
||||
// @ts-expect-error forcing to undefined
|
||||
policyInfo = undefined;
|
||||
}
|
||||
}, timeout);
|
||||
|
||||
it(
|
||||
'should show the supported Endpoint version for user notification',
|
||||
async () => {
|
||||
expect(await testSubjects.getVisibleText(cardTestSubj.notifySupportedVersion)).to.equal(
|
||||
'Agent version ' +
|
||||
PROTECTION_NOTICE_SUPPORTED_ENDPOINT_VERSION[
|
||||
protection as keyof typeof PROTECTION_NOTICE_SUPPORTED_ENDPOINT_VERSION
|
||||
]
|
||||
);
|
||||
},
|
||||
timeout
|
||||
);
|
||||
|
||||
it(
|
||||
'should show the custom message text area when the Notify User checkbox is checked',
|
||||
async () => {
|
||||
expect(await testSubjects.isChecked(cardTestSubj.notifyUserCheckbox)).to.be(true);
|
||||
await testSubjects.existOrFail(cardTestSubj.notifyCustomMessage);
|
||||
},
|
||||
timeout
|
||||
);
|
||||
|
||||
it(
|
||||
'should not show the custom message text area when the Notify User checkbox is unchecked',
|
||||
async () => {
|
||||
await pageObjects.endpointPageUtils.clickOnEuiCheckbox(cardTestSubj.notifyUserCheckbox);
|
||||
expect(await testSubjects.isChecked(cardTestSubj.notifyUserCheckbox)).to.be(false);
|
||||
await testSubjects.missingOrFail(cardTestSubj.notifyCustomMessage);
|
||||
},
|
||||
timeout
|
||||
);
|
||||
|
||||
it(
|
||||
'should show a sample custom message',
|
||||
async () => {
|
||||
expect(await testSubjects.getVisibleText(cardTestSubj.notifyCustomMessage)).equal(
|
||||
'Elastic Security {action} {filename}'
|
||||
);
|
||||
},
|
||||
timeout
|
||||
);
|
||||
|
||||
it(
|
||||
'should show a tooltip on hover',
|
||||
async () => {
|
||||
await testSubjects.moveMouseTo(cardTestSubj.notifyCustomMessageTooltipIcon);
|
||||
|
||||
await retry.waitFor(
|
||||
'should show a tooltip on hover',
|
||||
async () =>
|
||||
(await testSubjects.getVisibleText(cardTestSubj.notifyCustomMessageTooltipInfo)) ===
|
||||
`Selecting the user notification option will display a notification to the host user when ${protection} is prevented or detected.\nThe user notification can be customized in the text box below. Bracketed tags can be used to dynamically populate the applicable action (such as prevented or detected) and the filename.`
|
||||
);
|
||||
},
|
||||
timeout
|
||||
);
|
||||
|
||||
it(
|
||||
'should preserve a custom notification message upon saving',
|
||||
async () => {
|
||||
await testSubjects.setValue(cardTestSubj.notifyCustomMessage, '', {
|
||||
clearWithKeyboard: true,
|
||||
});
|
||||
await testSubjects.setValue(
|
||||
cardTestSubj.notifyCustomMessage,
|
||||
'a custom notification message @$% 123',
|
||||
{ typeCharByChar: true }
|
||||
);
|
||||
|
||||
await pageObjects.policy.confirmAndSave();
|
||||
await testSubjects.existOrFail('policyDetailsSuccessMessage');
|
||||
expect(await testSubjects.getVisibleText(cardTestSubj.notifyCustomMessage)).to.equal(
|
||||
'a custom notification message @$% 123'
|
||||
);
|
||||
},
|
||||
timeout
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('and the save button is clicked', () => {
|
||||
let policyInfo: PolicyTestResourceInfo;
|
||||
|
||||
beforeEach(async () => {
|
||||
policyInfo = await policyTestResources.createPolicy();
|
||||
await pageObjects.policy.navigateToPolicyDetails(policyInfo.packagePolicy.id);
|
||||
}, timeout);
|
||||
|
||||
afterEach(async () => {
|
||||
if (policyInfo) {
|
||||
await policyInfo.cleanup();
|
||||
|
||||
// @ts-expect-error forcing to undefined
|
||||
policyInfo = undefined;
|
||||
}
|
||||
}, timeout);
|
||||
|
||||
it(
|
||||
'should display success toast on successful save',
|
||||
async () => {
|
||||
await pageObjects.endpointPageUtils.clickOnEuiCheckbox(
|
||||
formTestSubjects.windowsEvents.dnsCheckbox
|
||||
);
|
||||
await pageObjects.policy.confirmAndSave();
|
||||
|
||||
await testSubjects.existOrFail('policyDetailsSuccessMessage');
|
||||
expect(await testSubjects.getVisibleText('policyDetailsSuccessMessage')).to.equal(
|
||||
`Success!\nIntegration ${policyInfo.packagePolicy.name} has been updated.`
|
||||
);
|
||||
},
|
||||
timeout
|
||||
);
|
||||
|
||||
it(
|
||||
'should persist update on the screen',
|
||||
async () => {
|
||||
await pageObjects.endpointPageUtils.clickOnEuiCheckbox(
|
||||
formTestSubjects.windowsEvents.processCheckbox
|
||||
);
|
||||
await pageObjects.policy.confirmAndSave();
|
||||
|
||||
await testSubjects.existOrFail('policyDetailsSuccessMessage');
|
||||
await testSubjects.existOrFail('toastCloseButton');
|
||||
await pageObjects.endpoint.navigateToEndpointList();
|
||||
await pageObjects.policy.navigateToPolicyDetails(policyInfo.packagePolicy.id);
|
||||
|
||||
expect(
|
||||
await (
|
||||
await testSubjects.find(formTestSubjects.windowsEvents.processCheckbox)
|
||||
).isSelected()
|
||||
).to.equal(false);
|
||||
},
|
||||
timeout
|
||||
);
|
||||
|
||||
it(
|
||||
'should have updated policy data in overall Agent Policy',
|
||||
async () => {
|
||||
// This test ensures that updates made to the Endpoint Policy are carried all the way through
|
||||
// to the generated Agent Policy that is dispatch down to the Elastic Agent.
|
||||
|
||||
await Promise.all([
|
||||
pageObjects.endpointPageUtils.clickOnEuiCheckbox(
|
||||
formTestSubjects.windowsEvents.fileCheckbox
|
||||
),
|
||||
pageObjects.endpointPageUtils.clickOnEuiCheckbox(
|
||||
formTestSubjects.linuxEvents.fileCheckbox
|
||||
),
|
||||
pageObjects.endpointPageUtils.clickOnEuiCheckbox(
|
||||
formTestSubjects.macEvents.fileCheckbox
|
||||
),
|
||||
]);
|
||||
|
||||
await pageObjects.policy.showAdvancedSettingsSection();
|
||||
|
||||
const advancedPolicyField = await pageObjects.policy.findAdvancedPolicyField();
|
||||
await advancedPolicyField.clearValue();
|
||||
await advancedPolicyField.click();
|
||||
await advancedPolicyField.type('true');
|
||||
await pageObjects.policy.confirmAndSave();
|
||||
|
||||
await testSubjects.existOrFail('policyDetailsSuccessMessage');
|
||||
await testSubjects.waitForDeleted('toastCloseButton');
|
||||
|
||||
const agentFullPolicy = await policyTestResources.getFullAgentPolicy(
|
||||
policyInfo.agentPolicy.id
|
||||
);
|
||||
|
||||
expect(agentFullPolicy.inputs[0].id).to.eql(policyInfo.packagePolicy.id);
|
||||
expect(agentFullPolicy.inputs[0].policy.linux.advanced.agent.connection_delay).to.eql(
|
||||
'true'
|
||||
);
|
||||
expect(agentFullPolicy.inputs[0].policy.linux.events.file).to.eql(false);
|
||||
expect(agentFullPolicy.inputs[0].policy.mac.events.file).to.eql(false);
|
||||
expect(agentFullPolicy.inputs[0].policy.windows.events.file).to.eql(false);
|
||||
},
|
||||
timeout
|
||||
);
|
||||
|
||||
it(
|
||||
'should have cleared the advanced section when the user deletes the value',
|
||||
async () => {
|
||||
await pageObjects.policy.showAdvancedSettingsSection();
|
||||
|
||||
const advancedPolicyField = await pageObjects.policy.findAdvancedPolicyField();
|
||||
await advancedPolicyField.clearValue();
|
||||
await advancedPolicyField.click();
|
||||
await advancedPolicyField.type('true');
|
||||
await pageObjects.policy.confirmAndSave();
|
||||
|
||||
await testSubjects.existOrFail('policyDetailsSuccessMessage');
|
||||
|
||||
const agentFullPolicy = await policyTestResources.getFullAgentPolicy(
|
||||
policyInfo.agentPolicy.id
|
||||
);
|
||||
|
||||
expect(agentFullPolicy.inputs[0].policy.linux.advanced.agent.connection_delay).to.eql(
|
||||
'true'
|
||||
);
|
||||
|
||||
// Clear the value
|
||||
await advancedPolicyField.click();
|
||||
await advancedPolicyField.clearValueWithKeyboard();
|
||||
|
||||
// Make sure the toast button closes so the save button on the sticky footer is visible
|
||||
await testSubjects.waitForDeleted('toastCloseButton');
|
||||
await pageObjects.policy.confirmAndSave();
|
||||
|
||||
await testSubjects.existOrFail('policyDetailsSuccessMessage');
|
||||
|
||||
const agentFullPolicyUpdated = await policyTestResources.getFullAgentPolicy(
|
||||
policyInfo.agentPolicy.id
|
||||
);
|
||||
|
||||
expect(agentFullPolicyUpdated.inputs[0].policy.linux.advanced).to.eql({
|
||||
capture_env_vars: 'LD_PRELOAD,LD_LIBRARY_PATH',
|
||||
});
|
||||
},
|
||||
timeout
|
||||
);
|
||||
});
|
||||
|
||||
describe('when on Ingest Policy Edit Package Policy page', async () => {
|
||||
let policyInfo: PolicyTestResourceInfo;
|
||||
|
||||
beforeEach(async () => {
|
||||
// Create a policy and navigate to Ingest app
|
||||
policyInfo = await policyTestResources.createPolicy();
|
||||
await pageObjects.ingestManagerCreatePackagePolicy.navigateToAgentPolicyEditPackagePolicy(
|
||||
policyInfo.agentPolicy.id,
|
||||
policyInfo.packagePolicy.id
|
||||
);
|
||||
}, timeout);
|
||||
|
||||
afterEach(async () => {
|
||||
if (policyInfo) {
|
||||
await policyInfo.cleanup();
|
||||
}
|
||||
}, timeout);
|
||||
|
||||
it(
|
||||
'should show the endpoint policy form',
|
||||
async () => {
|
||||
await testSubjects.existOrFail(formTestSubjects.form);
|
||||
},
|
||||
timeout
|
||||
);
|
||||
|
||||
it(
|
||||
'should allow updates to policy items',
|
||||
async () => {
|
||||
const winDnsEventingCheckbox = await testSubjects.find(
|
||||
formTestSubjects.windowsEvents.dnsCheckbox
|
||||
);
|
||||
await pageObjects.ingestManagerCreatePackagePolicy.scrollToCenterOfWindow(
|
||||
winDnsEventingCheckbox
|
||||
);
|
||||
expect(await winDnsEventingCheckbox.isSelected()).to.be(true);
|
||||
await pageObjects.endpointPageUtils.clickOnEuiCheckbox(
|
||||
formTestSubjects.windowsEvents.dnsCheckbox
|
||||
);
|
||||
await pageObjects.policy.waitForCheckboxSelectionChange(
|
||||
formTestSubjects.windowsEvents.dnsCheckbox,
|
||||
false
|
||||
);
|
||||
},
|
||||
timeout
|
||||
);
|
||||
|
||||
it(
|
||||
'should include updated endpoint data when saved',
|
||||
async () => {
|
||||
await pageObjects.ingestManagerCreatePackagePolicy.scrollToCenterOfWindow(
|
||||
await testSubjects.find(formTestSubjects.windowsEvents.dnsCheckbox)
|
||||
);
|
||||
await pageObjects.endpointPageUtils.clickOnEuiCheckbox(
|
||||
formTestSubjects.windowsEvents.dnsCheckbox
|
||||
);
|
||||
const updatedCheckboxValue = await testSubjects.isSelected(
|
||||
formTestSubjects.windowsEvents.dnsCheckbox
|
||||
);
|
||||
|
||||
await pageObjects.policy.waitForCheckboxSelectionChange(
|
||||
formTestSubjects.windowsEvents.dnsCheckbox,
|
||||
false
|
||||
);
|
||||
|
||||
await (await pageObjects.ingestManagerCreatePackagePolicy.findSaveButton(true)).click();
|
||||
await pageObjects.ingestManagerCreatePackagePolicy.waitForSaveSuccessNotification(true);
|
||||
|
||||
await pageObjects.ingestManagerCreatePackagePolicy.navigateToAgentPolicyEditPackagePolicy(
|
||||
policyInfo.agentPolicy.id,
|
||||
policyInfo.packagePolicy.id
|
||||
);
|
||||
|
||||
await pageObjects.policy.waitForCheckboxSelectionChange(
|
||||
formTestSubjects.windowsEvents.dnsCheckbox,
|
||||
updatedCheckboxValue
|
||||
);
|
||||
},
|
||||
timeout
|
||||
);
|
||||
|
||||
['trustedApps', 'eventFilters', 'blocklists', 'hostIsolationExceptions'].forEach(
|
||||
(cardName) => {
|
||||
it(
|
||||
`should show ${cardName} card and link should go back to policy`,
|
||||
async () => {
|
||||
await testSubjects.existOrFail(`${cardName}-fleet-integration-card`);
|
||||
|
||||
const card = await testSubjects.find(`${cardName}-fleet-integration-card`);
|
||||
await pageObjects.ingestManagerCreatePackagePolicy.scrollToCenterOfWindow(card);
|
||||
await (await testSubjects.find(`${cardName}-link-to-exceptions`)).click();
|
||||
|
||||
await testSubjects.existOrFail('policyDetailsPage');
|
||||
|
||||
await (await testSubjects.find('policyDetailsBackLink')).click();
|
||||
await testSubjects.existOrFail('endpointIntegrationPolicyForm');
|
||||
},
|
||||
timeout
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
|
@ -1,141 +0,0 @@
|
|||
/*
|
||||
* 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 { Client } from '@elastic/elasticsearch';
|
||||
import { AGENTS_INDEX } from '@kbn/fleet-plugin/common';
|
||||
import {
|
||||
alertsIndexPattern,
|
||||
eventsIndexPattern,
|
||||
METADATA_DATASTREAM,
|
||||
METADATA_UNITED_INDEX,
|
||||
metadataCurrentIndexPattern,
|
||||
metadataIndexPattern,
|
||||
policyIndexPattern,
|
||||
telemetryIndexPattern,
|
||||
} from '@kbn/security-solution-plugin/common/endpoint/constants';
|
||||
|
||||
export function deleteDataStream(getService: (serviceName: 'es') => Client, index: string) {
|
||||
const client = getService('es');
|
||||
return client.transport.request(
|
||||
{
|
||||
method: 'DELETE',
|
||||
path: `_data_stream/${index}`,
|
||||
},
|
||||
{
|
||||
ignore: [404],
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export async function deleteAllDocsFromIndex(
|
||||
getService: (serviceName: 'es') => Client,
|
||||
index: string
|
||||
) {
|
||||
const client = getService('es');
|
||||
await client.deleteByQuery(
|
||||
{
|
||||
query: {
|
||||
match_all: {},
|
||||
},
|
||||
index,
|
||||
wait_for_completion: true,
|
||||
refresh: true,
|
||||
},
|
||||
{
|
||||
ignore: [404],
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export async function deleteIndex(getService: (serviceName: 'es') => Client, index: string) {
|
||||
const client = getService('es');
|
||||
await client.indices.delete({ index, ignore_unavailable: true });
|
||||
}
|
||||
|
||||
export async function deleteMetadataStream(getService: (serviceName: 'es') => Client) {
|
||||
await deleteDataStream(getService, metadataIndexPattern);
|
||||
}
|
||||
|
||||
export async function deleteAllDocsFromMetadataDatastream(
|
||||
getService: (serviceName: 'es') => Client
|
||||
) {
|
||||
await deleteAllDocsFromIndex(getService, METADATA_DATASTREAM);
|
||||
}
|
||||
|
||||
export async function deleteAllDocsFromMetadataCurrentIndex(
|
||||
getService: (serviceName: 'es') => Client
|
||||
) {
|
||||
await deleteAllDocsFromIndex(getService, metadataCurrentIndexPattern);
|
||||
}
|
||||
|
||||
export async function deleteAllDocsFromMetadataUnitedIndex(
|
||||
getService: (serviceName: 'es') => Client
|
||||
) {
|
||||
await deleteAllDocsFromIndex(getService, METADATA_UNITED_INDEX);
|
||||
}
|
||||
|
||||
export async function deleteEventsStream(getService: (serviceName: 'es') => Client) {
|
||||
await deleteDataStream(getService, eventsIndexPattern);
|
||||
}
|
||||
|
||||
export async function deleteAlertsStream(getService: (serviceName: 'es') => Client) {
|
||||
await deleteDataStream(getService, alertsIndexPattern);
|
||||
}
|
||||
|
||||
export async function deletePolicyStream(getService: (serviceName: 'es') => Client) {
|
||||
await deleteDataStream(getService, policyIndexPattern);
|
||||
}
|
||||
|
||||
export async function deleteTelemetryStream(getService: (serviceName: 'es') => Client) {
|
||||
await deleteDataStream(getService, telemetryIndexPattern);
|
||||
}
|
||||
|
||||
export function deleteAllDocsFromFleetAgents(getService: (serviceName: 'es') => Client) {
|
||||
return deleteAllDocsFromIndex(getService, AGENTS_INDEX);
|
||||
}
|
||||
|
||||
export function stopTransform(getService: (serviceName: 'es') => Client, transformId: string) {
|
||||
const client = getService('es');
|
||||
const stopRequest = {
|
||||
transform_id: transformId,
|
||||
force: true,
|
||||
wait_for_completion: true,
|
||||
allow_no_match: true,
|
||||
};
|
||||
return client.transform.stopTransform(stopRequest);
|
||||
}
|
||||
|
||||
export async function startTransform(
|
||||
getService: (serviceName: 'es') => Client,
|
||||
transformId: string
|
||||
) {
|
||||
const client = getService('es');
|
||||
const transformsResponse = await client.transform.getTransform({
|
||||
transform_id: `${transformId}*`,
|
||||
});
|
||||
return Promise.all(
|
||||
transformsResponse.transforms.map((transform) => {
|
||||
const t = transform as unknown as { id: string };
|
||||
return client.transform.startTransform({ transform_id: t.id });
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
export function bulkIndex(
|
||||
getService: (serviceName: 'es') => Client,
|
||||
index: string,
|
||||
docs: unknown[]
|
||||
) {
|
||||
const operations = docs.flatMap((doc) => [{ create: { _index: index } }, doc]);
|
||||
const client = getService('es');
|
||||
|
||||
return client.bulk({
|
||||
index,
|
||||
refresh: 'wait_for',
|
||||
operations,
|
||||
});
|
||||
}
|
|
@ -14,8 +14,8 @@ import {
|
|||
} from '@kbn/security-solution-plugin/common/endpoint/service/artifacts';
|
||||
import { ExceptionsListItemGenerator } from '@kbn/security-solution-plugin/common/endpoint/data_generators/exceptions_list_item_generator';
|
||||
import { FtrProviderContext } from '../../configs/ftr_provider_context';
|
||||
import { PolicyTestResourceInfo } from '../../../security_solution_endpoint/services/endpoint_policy';
|
||||
import { ArtifactTestData } from '../../../security_solution_endpoint/services/endpoint_artifacts';
|
||||
import { PolicyTestResourceInfo } from '../../../../../security_solution_endpoint/services/endpoint_policy';
|
||||
import { ArtifactTestData } from '../../../../../security_solution_endpoint/services/endpoint_artifacts';
|
||||
import { ROLE } from '../../services/roles_users';
|
||||
|
||||
export default function ({ getService }: FtrProviderContext) {
|
||||
|
|
|
@ -15,8 +15,8 @@ import {
|
|||
toNdJsonString,
|
||||
} from '@kbn/lists-plugin/common/schemas/request/import_exceptions_schema.mock';
|
||||
import { FtrProviderContext } from '../../configs/ftr_provider_context';
|
||||
import { PolicyTestResourceInfo } from '../../../security_solution_endpoint/services/endpoint_policy';
|
||||
import { ArtifactTestData } from '../../../security_solution_endpoint/services/endpoint_artifacts';
|
||||
import { PolicyTestResourceInfo } from '../../../../../security_solution_endpoint/services/endpoint_policy';
|
||||
import { ArtifactTestData } from '../../../../../security_solution_endpoint/services/endpoint_artifacts';
|
||||
import { ROLE } from '../../services/roles_users';
|
||||
|
||||
export default function ({ getService }: FtrProviderContext) {
|
||||
|
|
|
@ -18,8 +18,8 @@ import {
|
|||
} from '@kbn/lists-plugin/common/schemas/request/import_exceptions_schema.mock';
|
||||
import { ExceptionsListItemGenerator } from '@kbn/security-solution-plugin/common/endpoint/data_generators/exceptions_list_item_generator';
|
||||
import { FtrProviderContext } from '../../configs/ftr_provider_context';
|
||||
import { PolicyTestResourceInfo } from '../../../security_solution_endpoint/services/endpoint_policy';
|
||||
import { ArtifactTestData } from '../../../security_solution_endpoint/services/endpoint_artifacts';
|
||||
import { PolicyTestResourceInfo } from '../../../../../security_solution_endpoint/services/endpoint_policy';
|
||||
import { ArtifactTestData } from '../../../../../security_solution_endpoint/services/endpoint_artifacts';
|
||||
import { ROLE } from '../../services/roles_users';
|
||||
|
||||
export default function ({ getService }: FtrProviderContext) {
|
||||
|
|
|
@ -14,8 +14,8 @@ import {
|
|||
} from '@kbn/security-solution-plugin/common/endpoint/service/artifacts';
|
||||
import { ExceptionsListItemGenerator } from '@kbn/security-solution-plugin/common/endpoint/data_generators/exceptions_list_item_generator';
|
||||
import { FtrProviderContext } from '../../configs/ftr_provider_context';
|
||||
import { PolicyTestResourceInfo } from '../../../security_solution_endpoint/services/endpoint_policy';
|
||||
import { ArtifactTestData } from '../../../security_solution_endpoint/services/endpoint_artifacts';
|
||||
import { PolicyTestResourceInfo } from '../../../../../security_solution_endpoint/services/endpoint_policy';
|
||||
import { ArtifactTestData } from '../../../../../security_solution_endpoint/services/endpoint_artifacts';
|
||||
import { ROLE } from '../../services/roles_users';
|
||||
|
||||
export default function ({ getService }: FtrProviderContext) {
|
||||
|
|
|
@ -7,27 +7,28 @@
|
|||
import { getRegistryUrl as getRegistryUrlFromIngest } from '@kbn/fleet-plugin/server';
|
||||
import { isServerlessKibanaFlavor } from '@kbn/security-solution-plugin/scripts/endpoint/common/stack_services';
|
||||
import { FtrProviderContext } from '../configs/ftr_provider_context';
|
||||
import { getRegistryUrlFromTestEnv, isRegistryEnabled } from '../registry';
|
||||
import { ROLE } from '../services/roles_users';
|
||||
|
||||
export default function endpointAPIIntegrationTests(providerContext: FtrProviderContext) {
|
||||
const { loadTestFile, getService } = providerContext;
|
||||
|
||||
describe('Endpoint plugin', function () {
|
||||
describe('Endpoint plugin', async function () {
|
||||
const ingestManager = getService('ingestManager');
|
||||
const rolesUsersProvider = getService('rolesUsersProvider');
|
||||
const kbnClient = getService('kibanaServer');
|
||||
const log = getService('log');
|
||||
|
||||
if (!isRegistryEnabled()) {
|
||||
log.warning('These tests are being run with an external package registry');
|
||||
}
|
||||
|
||||
const registryUrl = getRegistryUrlFromTestEnv() ?? getRegistryUrlFromIngest();
|
||||
log.info(`Package registry URL for tests: ${registryUrl}`);
|
||||
const endpointRegistryHelpers = getService('endpointRegistryHelpers');
|
||||
|
||||
const roles = Object.values(ROLE);
|
||||
before(async () => {
|
||||
if (!endpointRegistryHelpers.isRegistryEnabled()) {
|
||||
log.warning('These tests are being run with an external package registry');
|
||||
}
|
||||
|
||||
const registryUrl =
|
||||
endpointRegistryHelpers.getRegistryUrlFromTestEnv() ?? getRegistryUrlFromIngest();
|
||||
log.info(`Package registry URL for tests: ${registryUrl}`);
|
||||
|
||||
try {
|
||||
await ingestManager.setup();
|
||||
} catch (err) {
|
||||
|
|
|
@ -30,21 +30,14 @@ import {
|
|||
MetadataListResponse,
|
||||
} from '@kbn/security-solution-plugin/common/endpoint/types';
|
||||
import { generateAgentDocs, generateMetadataDocs } from './metadata.fixtures';
|
||||
import {
|
||||
bulkIndex,
|
||||
deleteAllDocsFromFleetAgents,
|
||||
deleteAllDocsFromIndex,
|
||||
deleteAllDocsFromMetadataCurrentIndex,
|
||||
deleteAllDocsFromMetadataDatastream,
|
||||
startTransform,
|
||||
stopTransform,
|
||||
} from './data_stream_helper';
|
||||
|
||||
import { FtrProviderContext } from '../configs/ftr_provider_context';
|
||||
|
||||
export default function ({ getService }: FtrProviderContext) {
|
||||
const supertest = getService('supertest');
|
||||
const endpointTestResources = getService('endpointTestResources');
|
||||
const log = getService('log');
|
||||
const endpointDataStreamHelpers = getService('endpointDataStreamHelpers');
|
||||
|
||||
describe('@ess @serverless test metadata apis', function () {
|
||||
describe('list endpoints GET route', () => {
|
||||
|
@ -54,11 +47,11 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
let metadataTimestamp: number;
|
||||
|
||||
before(async () => {
|
||||
await deleteAllDocsFromFleetAgents(getService);
|
||||
await deleteAllDocsFromMetadataDatastream(getService);
|
||||
await deleteAllDocsFromMetadataCurrentIndex(getService);
|
||||
await endpointDataStreamHelpers.deleteAllDocsFromFleetAgents(getService);
|
||||
await endpointDataStreamHelpers.deleteAllDocsFromMetadataDatastream(getService);
|
||||
await endpointDataStreamHelpers.deleteAllDocsFromMetadataCurrentIndex(getService);
|
||||
try {
|
||||
await deleteAllDocsFromIndex(getService, METADATA_UNITED_INDEX);
|
||||
await endpointDataStreamHelpers.deleteAllDocsFromIndex(getService, METADATA_UNITED_INDEX);
|
||||
} catch (err) {
|
||||
log.warning(`Unable to delete index: ${err}`);
|
||||
}
|
||||
|
@ -80,8 +73,8 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
const metadataDocs = generateMetadataDocs(metadataTimestamp);
|
||||
|
||||
await Promise.all([
|
||||
bulkIndex(getService, AGENTS_INDEX, agentDocs),
|
||||
bulkIndex(getService, METADATA_DATASTREAM, metadataDocs),
|
||||
endpointDataStreamHelpers.bulkIndex(getService, AGENTS_INDEX, agentDocs),
|
||||
endpointDataStreamHelpers.bulkIndex(getService, METADATA_DATASTREAM, metadataDocs),
|
||||
]);
|
||||
|
||||
return {
|
||||
|
@ -94,10 +87,10 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
after(async () => {
|
||||
await deleteAllDocsFromFleetAgents(getService);
|
||||
await deleteAllDocsFromMetadataDatastream(getService);
|
||||
await deleteAllDocsFromMetadataCurrentIndex(getService);
|
||||
await deleteAllDocsFromIndex(getService, METADATA_UNITED_INDEX);
|
||||
await endpointDataStreamHelpers.deleteAllDocsFromFleetAgents(getService);
|
||||
await endpointDataStreamHelpers.deleteAllDocsFromMetadataDatastream(getService);
|
||||
await endpointDataStreamHelpers.deleteAllDocsFromMetadataCurrentIndex(getService);
|
||||
await endpointDataStreamHelpers.deleteAllDocsFromIndex(getService, METADATA_UNITED_INDEX);
|
||||
});
|
||||
|
||||
it('should return one entry for each host with default paging', async () => {
|
||||
|
@ -427,8 +420,8 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
it('correctly returns stopped transform stats', async () => {
|
||||
await stopTransform(getService, `${currentTransformName}*`);
|
||||
await stopTransform(getService, `${unitedTransformName}*`);
|
||||
await endpointDataStreamHelpers.stopTransform(getService, `${currentTransformName}*`);
|
||||
await endpointDataStreamHelpers.stopTransform(getService, `${unitedTransformName}*`);
|
||||
|
||||
const { body } = await supertest
|
||||
.get(METADATA_TRANSFORMS_STATUS_ROUTE)
|
||||
|
@ -453,8 +446,8 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
);
|
||||
expect(unitedTransform).to.be.ok();
|
||||
|
||||
await startTransform(getService, currentTransformName);
|
||||
await startTransform(getService, unitedTransformName);
|
||||
await endpointDataStreamHelpers.startTransform(getService, currentTransformName);
|
||||
await endpointDataStreamHelpers.startTransform(getService, unitedTransformName);
|
||||
});
|
||||
|
||||
it('correctly returns started transform stats', async () => {
|
||||
|
|
|
@ -17,7 +17,6 @@ import {
|
|||
} from '@kbn/security-solution-plugin/common/endpoint/generate_data';
|
||||
import { FtrProviderContext } from '../configs/ftr_provider_context';
|
||||
import { InsertedEvents, processEventsIndex } from '../services/resolver';
|
||||
import { deleteEventsStream } from './data_stream_helper';
|
||||
|
||||
interface EventIngested {
|
||||
event: {
|
||||
|
@ -46,6 +45,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
const resolver = getService('resolverGenerator');
|
||||
const es = getService('es');
|
||||
const generator = new EndpointDocGenerator('data');
|
||||
const endpointDataStreamHelpers = getService('endpointDataStreamHelpers');
|
||||
|
||||
const searchForID = async <T>(id: string) => {
|
||||
return es.search<T>(
|
||||
|
@ -106,7 +106,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
});
|
||||
|
||||
after(async () => {
|
||||
await deleteEventsStream(getService);
|
||||
await endpointDataStreamHelpers.deleteEventsStream(getService);
|
||||
});
|
||||
|
||||
it('does not set dns.question.type if it is already populated', async () => {
|
||||
|
|
|
@ -7,11 +7,12 @@
|
|||
|
||||
import expect from '@kbn/expect';
|
||||
import { FtrProviderContext } from '../configs/ftr_provider_context';
|
||||
import { deletePolicyStream } from './data_stream_helper';
|
||||
|
||||
export default function ({ getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
const supertest = getService('supertest');
|
||||
const endpointDataStreamHelpers = getService('endpointDataStreamHelpers');
|
||||
|
||||
describe('@ess @serverless Endpoint policy api', function () {
|
||||
describe('GET /api/endpoint/policy_response', () => {
|
||||
before(
|
||||
|
@ -23,7 +24,7 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
// the endpoint uses data streams and es archiver does not support deleting them at the moment so we need
|
||||
// to do it manually
|
||||
after(async () => await deletePolicyStream(getService));
|
||||
after(async () => await endpointDataStreamHelpers.deletePolicyStream(getService));
|
||||
|
||||
it('should return one policy response for an id', async () => {
|
||||
const expectedAgentId = 'a10ac658-a3bc-4ac6-944a-68d9bd1c5a5e';
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
*/
|
||||
|
||||
import { Config } from '@kbn/test';
|
||||
import { getRegistryUrlAsArray, createEndpointDockerConfig } from '../registry';
|
||||
import { SUITE_TAGS } from '../../security_solution_endpoint/configs/config.base';
|
||||
import { SecuritySolutionEndpointRegistryHelpers } from '../../../../common/services/security_solution';
|
||||
import { SUITE_TAGS } from '../../../../security_solution_endpoint/configs/config.base';
|
||||
|
||||
export const generateConfig = async ({
|
||||
baseConfig,
|
||||
|
@ -22,6 +22,9 @@ export const generateConfig = async ({
|
|||
target: keyof typeof SUITE_TAGS;
|
||||
services: any;
|
||||
}): Promise<Config> => {
|
||||
// services are not ready yet, so we need to import them here
|
||||
const { createEndpointDockerConfig, getRegistryUrlAsArray } =
|
||||
SecuritySolutionEndpointRegistryHelpers();
|
||||
return {
|
||||
...baseConfig.getAll(),
|
||||
testFiles: [require.resolve('../apis')],
|
||||
|
|
|
@ -1,80 +0,0 @@
|
|||
/*
|
||||
* 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 path from 'path';
|
||||
|
||||
import { defineDockerServersConfig } from '@kbn/test';
|
||||
import { dockerImage as ingestDockerImage } from '../../../fleet_api_integration/config.base';
|
||||
|
||||
/**
|
||||
* This is used by CI to set the docker registry port
|
||||
* you can also define this environment variable locally when running tests which
|
||||
* will spin up a local docker package registry locally for you
|
||||
* if this is defined it takes precedence over the `packageRegistryOverride` variable
|
||||
*/
|
||||
const dockerRegistryPort: string | undefined = process.env.FLEET_PACKAGE_REGISTRY_PORT;
|
||||
|
||||
/**
|
||||
* If you don't want to use the docker image version pinned below and instead want to run your own
|
||||
* registry or use an external registry you can define this environment variable when running
|
||||
* the tests to use that registry url instead.
|
||||
*
|
||||
* This is particularly useful when a developer needs to test a new package against the kibana
|
||||
* integration or functional tests. Instead of having to publish a whole new docker image we
|
||||
* can set this environment variable which will point to the location of where your package registry
|
||||
* is serving the updated package.
|
||||
*
|
||||
* This variable will not and should not be used by CI. CI should always use the pinned docker image below.
|
||||
*/
|
||||
const packageRegistryOverride: string | undefined = process.env.PACKAGE_REGISTRY_URL_OVERRIDE;
|
||||
|
||||
const defaultRegistryConfigPath = path.join(
|
||||
__dirname,
|
||||
'./apis/fixtures/package_registry_config.yml'
|
||||
);
|
||||
|
||||
export function createEndpointDockerConfig(
|
||||
packageRegistryConfig: string = defaultRegistryConfigPath,
|
||||
dockerImage: string = ingestDockerImage,
|
||||
dockerArgs: string[] = []
|
||||
) {
|
||||
const args: string[] = [
|
||||
'-v',
|
||||
`${packageRegistryConfig}:/package-registry/config.yml`,
|
||||
...dockerArgs,
|
||||
];
|
||||
return defineDockerServersConfig({
|
||||
registry: {
|
||||
enabled: !!dockerRegistryPort,
|
||||
image: dockerImage,
|
||||
portInContainer: 8080,
|
||||
port: dockerRegistryPort,
|
||||
args,
|
||||
waitForLogLine: 'package manifests loaded',
|
||||
waitForLogLineTimeoutMs: 60 * 2 * 10000, // 2 minutes,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
export function getRegistryUrlFromTestEnv(): string | undefined {
|
||||
let registryUrl: string | undefined;
|
||||
if (dockerRegistryPort !== undefined) {
|
||||
registryUrl = `--xpack.fleet.registryUrl=http://localhost:${dockerRegistryPort}`;
|
||||
} else if (packageRegistryOverride !== undefined) {
|
||||
registryUrl = `--xpack.fleet.registryUrl=${packageRegistryOverride}`;
|
||||
}
|
||||
return registryUrl;
|
||||
}
|
||||
|
||||
export function getRegistryUrlAsArray(): string[] {
|
||||
const registryUrl: string | undefined = getRegistryUrlFromTestEnv();
|
||||
return registryUrl !== undefined ? [registryUrl] : [];
|
||||
}
|
||||
|
||||
export function isRegistryEnabled() {
|
||||
return getRegistryUrlFromTestEnv() !== undefined;
|
||||
}
|
|
@ -8,13 +8,15 @@
|
|||
import {
|
||||
KibanaSupertestWithCertProvider,
|
||||
KibanaSupertestWithCertWithoutAuthProvider,
|
||||
} from '../../security_solution_endpoint/services/supertest_with_cert';
|
||||
} from '../../../../security_solution_endpoint/services/supertest_with_cert';
|
||||
import { services as xPackAPIServices } from '../../../../api_integration/services';
|
||||
import { ResolverGeneratorProvider } from './resolver';
|
||||
import { RolesUsersProvider } from './roles_users';
|
||||
import { EndpointTestResources } from '../../security_solution_endpoint/services/endpoint';
|
||||
import { EndpointPolicyTestResourcesProvider } from '../../security_solution_endpoint/services/endpoint_policy';
|
||||
import { EndpointArtifactsTestResources } from '../../security_solution_endpoint/services/endpoint_artifacts';
|
||||
import { EndpointTestResources } from '../../../../security_solution_endpoint/services/endpoint';
|
||||
import { EndpointPolicyTestResourcesProvider } from '../../../../security_solution_endpoint/services/endpoint_policy';
|
||||
import { EndpointArtifactsTestResources } from '../../../../security_solution_endpoint/services/endpoint_artifacts';
|
||||
import { SecuritySolutionEndpointDataStreamHelpers } from '../../../../common/services/security_solution/endpoint_data_stream_helpers';
|
||||
import { SecuritySolutionEndpointRegistryHelpers } from '../../../../common/services/security_solution/endpoint_registry_helpers';
|
||||
|
||||
export const services = {
|
||||
...xPackAPIServices,
|
||||
|
@ -23,6 +25,8 @@ export const services = {
|
|||
endpointPolicyTestResources: EndpointPolicyTestResourcesProvider,
|
||||
endpointArtifactTestResources: EndpointArtifactsTestResources,
|
||||
rolesUsersProvider: RolesUsersProvider,
|
||||
endpointDataStreamHelpers: SecuritySolutionEndpointDataStreamHelpers,
|
||||
endpointRegistryHelpers: SecuritySolutionEndpointRegistryHelpers,
|
||||
};
|
||||
|
||||
export const svlServices = {
|
||||
|
|
|
@ -45,8 +45,6 @@
|
|||
"@kbn/task-manager-plugin",
|
||||
"@kbn/utility-types",
|
||||
"@kbn/timelines-plugin",
|
||||
"@kbn/ftr-common-functional-ui-services",
|
||||
"@kbn/test-subj-selector",
|
||||
"@kbn/dev-cli-runner",
|
||||
]
|
||||
}
|
||||
|
|
|
@ -9,11 +9,7 @@ import expect from '@kbn/expect';
|
|||
import { IndexedHostsAndAlertsResponse } from '@kbn/security-solution-plugin/common/endpoint/index_data';
|
||||
import { FtrProviderContext } from '../../configs/ftr_provider_context';
|
||||
|
||||
import {
|
||||
deleteMetadataStream,
|
||||
deleteAllDocsFromMetadataCurrentIndex,
|
||||
deleteAllDocsFromMetadataUnitedIndex,
|
||||
} from '../../../security_solution_endpoint_api_int/apis/data_stream_helper';
|
||||
import { targetTags } from '../../target_tags';
|
||||
|
||||
export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
||||
const pageObjects = getPageObjects(['common', 'endpoint', 'header', 'endpointPageUtils']);
|
||||
|
@ -22,6 +18,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
const retry = getService('retry');
|
||||
const endpointTestResources = getService('endpointTestResources');
|
||||
const policyTestResources = getService('policyTestResources');
|
||||
const endpointDataStreamHelpers = getService('endpointDataStreamHelpers');
|
||||
|
||||
const expectedData = [
|
||||
[
|
||||
|
@ -84,13 +81,15 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
return tableData;
|
||||
};
|
||||
|
||||
describe('@ess @serverless endpoint list', function () {
|
||||
describe('endpoint list', function () {
|
||||
targetTags(this, ['@ess', '@serverless']);
|
||||
|
||||
let indexedData: IndexedHostsAndAlertsResponse;
|
||||
describe('when initially navigating to page', () => {
|
||||
before(async () => {
|
||||
await deleteMetadataStream(getService);
|
||||
await deleteAllDocsFromMetadataCurrentIndex(getService);
|
||||
await deleteAllDocsFromMetadataUnitedIndex(getService);
|
||||
await endpointDataStreamHelpers.deleteMetadataStream(getService);
|
||||
await endpointDataStreamHelpers.deleteAllDocsFromMetadataCurrentIndex(getService);
|
||||
await endpointDataStreamHelpers.deleteAllDocsFromMetadataUnitedIndex(getService);
|
||||
await pageObjects.endpoint.navigateToEndpointList();
|
||||
});
|
||||
it('finds no data in list and prompts onboarding to add policy', async () => {
|
||||
|
@ -125,8 +124,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
);
|
||||
});
|
||||
after(async () => {
|
||||
await deleteAllDocsFromMetadataCurrentIndex(getService);
|
||||
await deleteAllDocsFromMetadataUnitedIndex(getService);
|
||||
await endpointDataStreamHelpers.deleteAllDocsFromMetadataCurrentIndex(getService);
|
||||
await endpointDataStreamHelpers.deleteAllDocsFromMetadataUnitedIndex(getService);
|
||||
if (indexedData) {
|
||||
await endpointTestResources.unloadEndpointData(indexedData);
|
||||
}
|
|
@ -9,17 +9,17 @@ import expect from '@kbn/expect';
|
|||
import { IndexedHostsAndAlertsResponse } from '@kbn/security-solution-plugin/common/endpoint/index_data';
|
||||
import { SecurityRoleName } from '@kbn/security-solution-plugin/common/test';
|
||||
import { FtrProviderContext } from '../../configs/ftr_provider_context';
|
||||
import {
|
||||
createUserAndRole,
|
||||
deleteUserAndRole,
|
||||
} from '../../../../../common/services/security_solution';
|
||||
import { createUserAndRole, deleteUserAndRole } from '../../../common/services/security_solution';
|
||||
import { targetTags } from '../../target_tags';
|
||||
|
||||
export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
||||
const PageObjects = getPageObjects(['security', 'endpoint', 'detections', 'hosts']);
|
||||
const testSubjects = getService('testSubjects');
|
||||
const endpointTestResources = getService('endpointTestResources');
|
||||
|
||||
describe('@ess Endpoint permissions:', function () {
|
||||
describe('Endpoint permissions:', function () {
|
||||
targetTags(this, ['@ess']);
|
||||
|
||||
let indexedData: IndexedHostsAndAlertsResponse;
|
||||
|
||||
before(async () => {
|
|
@ -7,9 +7,11 @@
|
|||
|
||||
import { IndexedHostsAndAlertsResponse } from '@kbn/security-solution-plugin/common/endpoint/index_data';
|
||||
import { TimelineResponse } from '@kbn/security-solution-plugin/common/api/timeline';
|
||||
// @ts-expect-error we have to check types with "allowJs: false" for now, causing this import to fail
|
||||
import { kibanaPackageJson } from '@kbn/repo-info';
|
||||
import { type IndexedEndpointRuleAlerts } from '@kbn/security-solution-plugin/common/endpoint/data_loaders/index_endpoint_rule_alerts';
|
||||
import { FtrProviderContext } from '../../configs/ftr_provider_context';
|
||||
import { targetTags } from '../../target_tags';
|
||||
|
||||
/**
|
||||
* Test suite is meant to cover usages of endpoint functionality or access to endpoint
|
||||
|
@ -23,7 +25,9 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
const testSubjects = getService('testSubjects');
|
||||
const pageObjects = getPageObjects(['common', 'timeline']);
|
||||
|
||||
describe('@ess App level Endpoint functionality', function () {
|
||||
describe('App level Endpoint functionality', function () {
|
||||
targetTags(this, ['@ess']);
|
||||
|
||||
let indexedData: IndexedHostsAndAlertsResponse;
|
||||
let indexedAlerts: IndexedEndpointRuleAlerts;
|
||||
let endpointAgentId: string;
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import expect from '@kbn/expect';
|
||||
import { FtrProviderContext } from '../../configs/ftr_provider_context';
|
||||
import { targetTags } from '../../target_tags';
|
||||
|
||||
export default function ({ getService }: FtrProviderContext) {
|
||||
const esArchiver = getService('esArchiver');
|
||||
|
@ -15,7 +16,9 @@ export default function ({ getService }: FtrProviderContext) {
|
|||
|
||||
// The source of the data for these tests have changed and need to be updated
|
||||
// There are currently tests in the security_solution application being maintained
|
||||
describe.skip('@ess security solution endpoint telemetry', function () {
|
||||
describe.skip('security solution endpoint telemetry', function () {
|
||||
targetTags(this, ['@ess']);
|
||||
|
||||
after(async () => {
|
||||
await kibanaServer.savedObjects.cleanStandardList();
|
||||
});
|
|
@ -8,10 +8,6 @@
|
|||
import { getRegistryUrl as getRegistryUrlFromIngest } from '@kbn/fleet-plugin/server';
|
||||
import { isServerlessKibanaFlavor } from '@kbn/security-solution-plugin/scripts/endpoint/common/stack_services';
|
||||
import { FtrProviderContext } from '../../configs/ftr_provider_context';
|
||||
import {
|
||||
getRegistryUrlFromTestEnv,
|
||||
isRegistryEnabled,
|
||||
} from '../../../security_solution_endpoint_api_int/registry';
|
||||
|
||||
export default function (providerContext: FtrProviderContext) {
|
||||
const { loadTestFile, getService, getPageObjects } = providerContext;
|
||||
|
@ -22,15 +18,17 @@ export default function (providerContext: FtrProviderContext) {
|
|||
const log = getService('log');
|
||||
const endpointTestResources = getService('endpointTestResources');
|
||||
const kbnClient = getService('kibanaServer');
|
||||
|
||||
if (!isRegistryEnabled()) {
|
||||
log.warning('These tests are being run with an external package registry');
|
||||
}
|
||||
|
||||
const registryUrl = getRegistryUrlFromTestEnv() ?? getRegistryUrlFromIngest();
|
||||
log.info(`Package registry URL for tests: ${registryUrl}`);
|
||||
const endpointRegistryHelpers = getService('endpointRegistryHelpers');
|
||||
|
||||
before(async () => {
|
||||
if (!endpointRegistryHelpers.isRegistryEnabled()) {
|
||||
log.warning('These tests are being run with an external package registry');
|
||||
}
|
||||
|
||||
const registryUrl =
|
||||
endpointRegistryHelpers.getRegistryUrlFromTestEnv() ?? getRegistryUrlFromIngest();
|
||||
log.info(`Package registry URL for tests: ${registryUrl}`);
|
||||
|
||||
log.info('calling Fleet setup');
|
||||
await ingestManager.setup();
|
||||
|
|
@ -24,6 +24,7 @@ import {
|
|||
MultipleArtifactActionsType,
|
||||
} from './mocks';
|
||||
import { PolicyTestResourceInfo } from '../../services/endpoint_policy';
|
||||
import { targetTags } from '../../target_tags';
|
||||
|
||||
export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
||||
const pageObjects = getPageObjects(['common', 'artifactEntriesList']);
|
||||
|
@ -38,7 +39,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
const toasts = getService('toasts');
|
||||
const policyTestResources = getService('policyTestResources');
|
||||
const unzipPromisify = promisify(unzip);
|
||||
const timeout = 60000; // ms
|
||||
|
||||
const removeAllArtifacts = async () => {
|
||||
for (const listId of ENDPOINT_ARTIFACT_LIST_IDS) {
|
||||
|
@ -54,7 +54,10 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
|
||||
// Failing: See https://github.com/elastic/kibana/issues/187314
|
||||
// Failing: See https://github.com/elastic/kibana/issues/187383
|
||||
describe.skip('@ess @serverless For each artifact list under management', function () {
|
||||
describe('For each artifact list under management', function () {
|
||||
targetTags(this, ['@ess', '@skipInServerless']);
|
||||
this.timeout(60_000 * 5);
|
||||
|
||||
let indexedData: IndexedHostsAndAlertsResponse;
|
||||
let policyInfo: PolicyTestResourceInfo;
|
||||
|
||||
|
@ -224,99 +227,83 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
await removeAllArtifacts();
|
||||
await browser.refresh();
|
||||
await pageObjects.artifactEntriesList.navigateToList(testData.urlPath);
|
||||
}, timeout);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await removeAllArtifacts();
|
||||
if (policyInfo) {
|
||||
await policyInfo.cleanup();
|
||||
}
|
||||
}, timeout);
|
||||
});
|
||||
|
||||
it(
|
||||
`should not show page title if there is no ${testData.title} entry`,
|
||||
async () => {
|
||||
await testSubjects.missingOrFail('header-page-title');
|
||||
},
|
||||
timeout
|
||||
);
|
||||
it(`should not show page title if there is no ${testData.title} entry`, async () => {
|
||||
await testSubjects.missingOrFail('header-page-title');
|
||||
});
|
||||
|
||||
it(
|
||||
`should be able to add a new ${testData.title} entry`,
|
||||
async () => {
|
||||
await createArtifact(testData, { policyId: policyInfo.packagePolicy.id });
|
||||
// Check new artifact is in the list
|
||||
for (const checkResult of testData.create.checkResults) {
|
||||
expect(await testSubjects.getVisibleText(checkResult.selector)).to.equal(
|
||||
checkResult.value
|
||||
);
|
||||
}
|
||||
await toasts.dismiss();
|
||||
|
||||
// Title is shown after adding an item
|
||||
expect(await testSubjects.getVisibleText('header-page-title')).to.equal(testData.title);
|
||||
|
||||
// Checks if fleet artifact has been updated correctly
|
||||
await checkFleetArtifacts(
|
||||
testData.fleetArtifact.identifier,
|
||||
testData.fleetArtifact.getExpectedUpdatedtArtifactWhenCreate(),
|
||||
testData.fleetArtifact.getExpectedUpdatedArtifactBodyWhenCreate(),
|
||||
policyInfo
|
||||
it(`should be able to add a new ${testData.title} entry`, async () => {
|
||||
await createArtifact(testData, { policyId: policyInfo.packagePolicy.id });
|
||||
// Check new artifact is in the list
|
||||
for (const checkResult of testData.create.checkResults) {
|
||||
expect(await testSubjects.getVisibleText(checkResult.selector)).to.equal(
|
||||
checkResult.value
|
||||
);
|
||||
},
|
||||
timeout
|
||||
);
|
||||
}
|
||||
await toasts.dismiss();
|
||||
|
||||
it(
|
||||
`should be able to update an existing ${testData.title} entry`,
|
||||
async () => {
|
||||
await createArtifact(testData);
|
||||
await updateArtifact(testData, { policyId: policyInfo.packagePolicy.id });
|
||||
// Title is shown after adding an item
|
||||
expect(await testSubjects.getVisibleText('header-page-title')).to.equal(testData.title);
|
||||
|
||||
// Check edited artifact is in the list with new values (wait for list to be updated)
|
||||
await retry.waitForWithTimeout('entry is updated in list', 20000, async () => {
|
||||
const currentValue = await testSubjects.getVisibleText(
|
||||
`${testData.pagePrefix}-card-criteriaConditions${
|
||||
testData.pagePrefix === 'EventFiltersListPage' ? '-condition' : ''
|
||||
}`
|
||||
);
|
||||
return currentValue === testData.update.waitForValue;
|
||||
});
|
||||
// Checks if fleet artifact has been updated correctly
|
||||
await checkFleetArtifacts(
|
||||
testData.fleetArtifact.identifier,
|
||||
testData.fleetArtifact.getExpectedUpdatedtArtifactWhenCreate(),
|
||||
testData.fleetArtifact.getExpectedUpdatedArtifactBodyWhenCreate(),
|
||||
policyInfo
|
||||
);
|
||||
});
|
||||
|
||||
for (const checkResult of testData.update.checkResults) {
|
||||
expect(await testSubjects.getVisibleText(checkResult.selector)).to.equal(
|
||||
checkResult.value
|
||||
);
|
||||
}
|
||||
it(`should be able to update an existing ${testData.title} entry`, async () => {
|
||||
await createArtifact(testData);
|
||||
await updateArtifact(testData, { policyId: policyInfo.packagePolicy.id });
|
||||
|
||||
await toasts.dismiss();
|
||||
|
||||
// Title still shown after editing an item
|
||||
expect(await testSubjects.getVisibleText('header-page-title')).to.equal(testData.title);
|
||||
|
||||
// Checks if fleet artifact has been updated correctly
|
||||
await checkFleetArtifacts(
|
||||
testData.fleetArtifact.identifier,
|
||||
testData.fleetArtifact.getExpectedUpdatedArtifactWhenUpdate(),
|
||||
testData.fleetArtifact.getExpectedUpdatedArtifactBodyWhenUpdate(),
|
||||
policyInfo
|
||||
// Check edited artifact is in the list with new values (wait for list to be updated)
|
||||
await retry.waitForWithTimeout('entry is updated in list', 20000, async () => {
|
||||
const currentValue = await testSubjects.getVisibleText(
|
||||
`${testData.pagePrefix}-card-criteriaConditions${
|
||||
testData.pagePrefix === 'EventFiltersListPage' ? '-condition' : ''
|
||||
}`
|
||||
);
|
||||
},
|
||||
timeout
|
||||
);
|
||||
return currentValue === testData.update.waitForValue;
|
||||
});
|
||||
|
||||
it(
|
||||
`should be able to delete the existing ${testData.title} entry`,
|
||||
async () => {
|
||||
await createArtifact(testData);
|
||||
await deleteArtifact(testData);
|
||||
// We only expect one artifact to have been visible
|
||||
await testSubjects.missingOrFail(testData.delete.card);
|
||||
// Header has gone because there is no artifact
|
||||
await testSubjects.missingOrFail('header-page-title');
|
||||
},
|
||||
timeout
|
||||
);
|
||||
for (const checkResult of testData.update.checkResults) {
|
||||
expect(await testSubjects.getVisibleText(checkResult.selector)).to.equal(
|
||||
checkResult.value
|
||||
);
|
||||
}
|
||||
|
||||
await toasts.dismiss();
|
||||
|
||||
// Title still shown after editing an item
|
||||
expect(await testSubjects.getVisibleText('header-page-title')).to.equal(testData.title);
|
||||
|
||||
// Checks if fleet artifact has been updated correctly
|
||||
await checkFleetArtifacts(
|
||||
testData.fleetArtifact.identifier,
|
||||
testData.fleetArtifact.getExpectedUpdatedArtifactWhenUpdate(),
|
||||
testData.fleetArtifact.getExpectedUpdatedArtifactBodyWhenUpdate(),
|
||||
policyInfo
|
||||
);
|
||||
});
|
||||
|
||||
it(`should be able to delete the existing ${testData.title} entry`, async () => {
|
||||
await createArtifact(testData);
|
||||
await deleteArtifact(testData);
|
||||
// We only expect one artifact to have been visible
|
||||
await testSubjects.missingOrFail(testData.delete.card);
|
||||
// Header has gone because there is no artifact
|
||||
await testSubjects.missingOrFail('header-page-title');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -334,7 +321,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
await removeAllArtifacts();
|
||||
await browser.refresh();
|
||||
await pageObjects.artifactEntriesList.navigateToList(testData.urlPath);
|
||||
}, timeout);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await removeAllArtifacts();
|
||||
|
@ -344,55 +331,51 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
if (secondPolicy) {
|
||||
await secondPolicy.cleanup();
|
||||
}
|
||||
}, timeout);
|
||||
});
|
||||
|
||||
const testData = getCreateMultipleData();
|
||||
it(
|
||||
`should get correct atifact when multiple entries are created`,
|
||||
async () => {
|
||||
// Create first trusted app
|
||||
await createArtifact(testData, {
|
||||
policyId: firstPolicy.packagePolicy.id,
|
||||
suffix: firstSuffix,
|
||||
});
|
||||
await toasts.dismiss();
|
||||
it(`should get correct atifact when multiple entries are created`, async () => {
|
||||
// Create first trusted app
|
||||
await createArtifact(testData, {
|
||||
policyId: firstPolicy.packagePolicy.id,
|
||||
suffix: firstSuffix,
|
||||
});
|
||||
await toasts.dismiss();
|
||||
|
||||
// Create second trusted app
|
||||
await createArtifact(testData, {
|
||||
policyId: secondPolicy.packagePolicy.id,
|
||||
suffix: secondSuffix,
|
||||
createButton: 'pageAddButton',
|
||||
});
|
||||
await toasts.dismiss();
|
||||
// Create second trusted app
|
||||
await createArtifact(testData, {
|
||||
policyId: secondPolicy.packagePolicy.id,
|
||||
suffix: secondSuffix,
|
||||
createButton: 'pageAddButton',
|
||||
});
|
||||
await toasts.dismiss();
|
||||
|
||||
// Create third trusted app
|
||||
await createArtifact(testData, { suffix: thirdSuffix, createButton: 'pageAddButton' });
|
||||
await toasts.dismiss();
|
||||
// Create third trusted app
|
||||
await createArtifact(testData, { suffix: thirdSuffix, createButton: 'pageAddButton' });
|
||||
await toasts.dismiss();
|
||||
|
||||
// Checks if fleet artifact has been updated correctly
|
||||
await checkFleetArtifacts(
|
||||
testData.fleetArtifact.identifier,
|
||||
testData.fleetArtifact.getExpectedUpdatedArtifactWhenCreateMultipleFirst(),
|
||||
testData.fleetArtifact.getExpectedUpdatedArtifactBodyWhenCreateMultipleFirst(
|
||||
thirdSuffix,
|
||||
firstSuffix
|
||||
),
|
||||
firstPolicy
|
||||
);
|
||||
// Checks if fleet artifact has been updated correctly
|
||||
await checkFleetArtifacts(
|
||||
testData.fleetArtifact.identifier,
|
||||
testData.fleetArtifact.getExpectedUpdatedArtifactWhenCreateMultipleFirst(),
|
||||
testData.fleetArtifact.getExpectedUpdatedArtifactBodyWhenCreateMultipleFirst(
|
||||
thirdSuffix,
|
||||
firstSuffix
|
||||
),
|
||||
firstPolicy
|
||||
);
|
||||
|
||||
// Checks if fleet artifact has been updated correctly
|
||||
await checkFleetArtifacts(
|
||||
testData.fleetArtifact.identifier,
|
||||
testData.fleetArtifact.getExpectedUpdatedArtifactWhenCreateMultipleSecond(),
|
||||
testData.fleetArtifact.getExpectedUpdatedArtifactBodyWhenCreateMultipleSecond(
|
||||
thirdSuffix,
|
||||
secondSuffix
|
||||
),
|
||||
secondPolicy
|
||||
);
|
||||
},
|
||||
timeout
|
||||
);
|
||||
// Checks if fleet artifact has been updated correctly
|
||||
await checkFleetArtifacts(
|
||||
testData.fleetArtifact.identifier,
|
||||
testData.fleetArtifact.getExpectedUpdatedArtifactWhenCreateMultipleSecond(),
|
||||
testData.fleetArtifact.getExpectedUpdatedArtifactBodyWhenCreateMultipleSecond(
|
||||
thirdSuffix,
|
||||
secondSuffix
|
||||
),
|
||||
secondPolicy
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
|
@ -13,6 +13,7 @@ import { ArtifactElasticsearchProperties } from '@kbn/fleet-plugin/server/servic
|
|||
import { FoundExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
|
||||
import { WebElementWrapper } from '@kbn/ftr-common-functional-ui-services';
|
||||
import { FtrProviderContext } from '../../configs/ftr_provider_context';
|
||||
import { targetTags } from '../../target_tags';
|
||||
|
||||
export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
||||
const pageObjects = getPageObjects(['common', 'header', 'timePicker']);
|
||||
|
@ -29,7 +30,11 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
const toasts = getService('toasts');
|
||||
const MINUTES = 60 * 1000 * 10;
|
||||
|
||||
describe('@ess @serverless Endpoint Exceptions', function () {
|
||||
describe('Endpoint Exceptions', function () {
|
||||
targetTags(this, ['@ess', '@serverless']);
|
||||
|
||||
this.timeout(10 * MINUTES);
|
||||
|
||||
const clearPrefilledEntries = async () => {
|
||||
const entriesContainer = await testSubjects.find('exceptionEntriesContainer');
|
||||
|
||||
|
@ -144,6 +149,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
this.timeout(MINUTES);
|
||||
|
||||
const deleteEndpointExceptions = async () => {
|
||||
const { body } = await supertest
|
||||
.get(`${EXCEPTION_LIST_ITEM_URL}/_find?list_id=endpoint_list&namespace_type=agnostic`)
|
||||
|
@ -157,97 +164,89 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
};
|
||||
|
||||
await deleteEndpointExceptions();
|
||||
}, MINUTES);
|
||||
});
|
||||
|
||||
it(
|
||||
'should add `event.module=endpoint` to entry if only wildcard operator is present',
|
||||
async () => {
|
||||
await pageObjects.common.navigateToUrlWithBrowserHistory('security', `/alerts`);
|
||||
await pageObjects.timePicker.setCommonlyUsedTime('Last_24 hours');
|
||||
it('should add `event.module=endpoint` to entry if only wildcard operator is present', async () => {
|
||||
await pageObjects.common.navigateToUrlWithBrowserHistory('security', `/alerts`);
|
||||
await pageObjects.timePicker.setCommonlyUsedTime('Last_24 hours');
|
||||
|
||||
await openNewEndpointExceptionFlyout();
|
||||
await clearPrefilledEntries();
|
||||
await openNewEndpointExceptionFlyout();
|
||||
await clearPrefilledEntries();
|
||||
|
||||
await testSubjects.setValue('exceptionFlyoutNameInput', 'test exception');
|
||||
await setLastEntry({ field: 'file.path', operator: 'matches', value: '*/cheese/*' });
|
||||
await testSubjects.click('exceptionsAndButton');
|
||||
await setLastEntry({ field: 'process.executable', operator: 'matches', value: 'ex*' });
|
||||
await testSubjects.setValue('exceptionFlyoutNameInput', 'test exception');
|
||||
await setLastEntry({ field: 'file.path', operator: 'matches', value: '*/cheese/*' });
|
||||
await testSubjects.click('exceptionsAndButton');
|
||||
await setLastEntry({ field: 'process.executable', operator: 'matches', value: 'ex*' });
|
||||
|
||||
await testSubjects.click('addExceptionConfirmButton');
|
||||
await toasts.dismiss();
|
||||
await testSubjects.click('addExceptionConfirmButton');
|
||||
await toasts.dismiss();
|
||||
|
||||
await checkArtifact({
|
||||
entries: [
|
||||
{
|
||||
type: 'simple',
|
||||
entries: [
|
||||
{
|
||||
field: 'file.path',
|
||||
operator: 'included',
|
||||
type: 'wildcard_cased',
|
||||
value: '*/cheese/*',
|
||||
},
|
||||
{
|
||||
field: 'process.executable',
|
||||
operator: 'included',
|
||||
type: 'wildcard_cased',
|
||||
value: 'ex*',
|
||||
},
|
||||
{
|
||||
// this additional entry should be added
|
||||
field: 'event.module',
|
||||
operator: 'included',
|
||||
type: 'exact_cased',
|
||||
value: 'endpoint',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
MINUTES
|
||||
);
|
||||
await checkArtifact({
|
||||
entries: [
|
||||
{
|
||||
type: 'simple',
|
||||
entries: [
|
||||
{
|
||||
field: 'file.path',
|
||||
operator: 'included',
|
||||
type: 'wildcard_cased',
|
||||
value: '*/cheese/*',
|
||||
},
|
||||
{
|
||||
field: 'process.executable',
|
||||
operator: 'included',
|
||||
type: 'wildcard_cased',
|
||||
value: 'ex*',
|
||||
},
|
||||
{
|
||||
// this additional entry should be added
|
||||
field: 'event.module',
|
||||
operator: 'included',
|
||||
type: 'exact_cased',
|
||||
value: 'endpoint',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
it(
|
||||
'should NOT add `event.module=endpoint` to entry if there is another operator',
|
||||
async () => {
|
||||
await pageObjects.common.navigateToUrlWithBrowserHistory('security', `/alerts`);
|
||||
await pageObjects.timePicker.setCommonlyUsedTime('Last_24 hours');
|
||||
it('should NOT add `event.module=endpoint` to entry if there is another operator', async () => {
|
||||
await pageObjects.common.navigateToUrlWithBrowserHistory('security', `/alerts`);
|
||||
await pageObjects.timePicker.setCommonlyUsedTime('Last_24 hours');
|
||||
|
||||
await openNewEndpointExceptionFlyout();
|
||||
await clearPrefilledEntries();
|
||||
await openNewEndpointExceptionFlyout();
|
||||
await clearPrefilledEntries();
|
||||
|
||||
await testSubjects.setValue('exceptionFlyoutNameInput', 'test exception');
|
||||
await setLastEntry({ field: 'file.path', operator: 'matches', value: '*/cheese/*' });
|
||||
await testSubjects.click('exceptionsAndButton');
|
||||
await setLastEntry({ field: 'process.executable', operator: 'is', value: 'something' });
|
||||
await testSubjects.setValue('exceptionFlyoutNameInput', 'test exception');
|
||||
await setLastEntry({ field: 'file.path', operator: 'matches', value: '*/cheese/*' });
|
||||
await testSubjects.click('exceptionsAndButton');
|
||||
await setLastEntry({ field: 'process.executable', operator: 'is', value: 'something' });
|
||||
|
||||
await testSubjects.click('addExceptionConfirmButton');
|
||||
await toasts.dismiss();
|
||||
await testSubjects.click('addExceptionConfirmButton');
|
||||
await toasts.dismiss();
|
||||
|
||||
await checkArtifact({
|
||||
entries: [
|
||||
{
|
||||
type: 'simple',
|
||||
entries: [
|
||||
{
|
||||
field: 'file.path',
|
||||
operator: 'included',
|
||||
type: 'wildcard_cased',
|
||||
value: '*/cheese/*',
|
||||
},
|
||||
{
|
||||
field: 'process.executable',
|
||||
operator: 'included',
|
||||
type: 'exact_cased',
|
||||
value: 'something',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
},
|
||||
MINUTES
|
||||
);
|
||||
await checkArtifact({
|
||||
entries: [
|
||||
{
|
||||
type: 'simple',
|
||||
entries: [
|
||||
{
|
||||
field: 'file.path',
|
||||
operator: 'included',
|
||||
type: 'wildcard_cased',
|
||||
value: '*/cheese/*',
|
||||
},
|
||||
{
|
||||
field: 'process.executable',
|
||||
operator: 'included',
|
||||
type: 'exact_cased',
|
||||
value: 'something',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
|
@ -5,10 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import { FtrProviderContext } from '../../configs/ftr_provider_context';
|
||||
import {
|
||||
deleteMetadataStream,
|
||||
deleteAllDocsFromMetadataCurrentIndex,
|
||||
} from '../../../security_solution_endpoint_api_int/apis/data_stream_helper';
|
||||
import { targetTags } from '../../target_tags';
|
||||
|
||||
export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const { fleetIntegrations, trustedApps } = getPageObjects(['trustedApps', 'fleetIntegrations']);
|
||||
|
@ -16,8 +13,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
const testSubjects = getService('testSubjects');
|
||||
const esArchiver = getService('esArchiver');
|
||||
const browser = getService('browser');
|
||||
const endpointDataStreamHelpers = getService('endpointDataStreamHelpers');
|
||||
|
||||
describe('When in the Fleet application', function () {
|
||||
targetTags(this, ['@ess', '@serverless']);
|
||||
|
||||
describe('@ess @serverless When in the Fleet application', function () {
|
||||
before(async () => {
|
||||
await esArchiver.load('x-pack/test/functional/es_archives/endpoint/metadata/api_feature', {
|
||||
useCreate: true,
|
||||
|
@ -25,8 +25,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
await browser.refresh();
|
||||
});
|
||||
after(async () => {
|
||||
await deleteMetadataStream(getService);
|
||||
await deleteAllDocsFromMetadataCurrentIndex(getService);
|
||||
await endpointDataStreamHelpers.deleteMetadataStream(getService);
|
||||
await endpointDataStreamHelpers.deleteAllDocsFromMetadataCurrentIndex(getService);
|
||||
});
|
||||
describe('and on the Endpoint Integration details page', () => {
|
||||
beforeEach(async () => {
|
|
@ -8,29 +8,26 @@
|
|||
import { getRegistryUrl as getRegistryUrlFromIngest } from '@kbn/fleet-plugin/server';
|
||||
import { isServerlessKibanaFlavor } from '@kbn/security-solution-plugin/scripts/endpoint/common/stack_services';
|
||||
import { FtrProviderContext } from '../../configs/ftr_provider_context';
|
||||
import {
|
||||
getRegistryUrlFromTestEnv,
|
||||
isRegistryEnabled,
|
||||
} from '../../../security_solution_endpoint_api_int/registry';
|
||||
|
||||
export default function (providerContext: FtrProviderContext) {
|
||||
const { loadTestFile, getService, getPageObjects } = providerContext;
|
||||
|
||||
// Flaky: https://github.com/elastic/kibana/issues/186086
|
||||
describe('@skipInServerless endpoint', function () {
|
||||
describe('endpoint', function () {
|
||||
const ingestManager = getService('ingestManager');
|
||||
const log = getService('log');
|
||||
const endpointTestResources = getService('endpointTestResources');
|
||||
const kbnClient = getService('kibanaServer');
|
||||
|
||||
if (!isRegistryEnabled()) {
|
||||
log.warning('These tests are being run with an external package registry');
|
||||
}
|
||||
|
||||
const registryUrl = getRegistryUrlFromTestEnv() ?? getRegistryUrlFromIngest();
|
||||
log.info(`Package registry URL for tests: ${registryUrl}`);
|
||||
const endpointRegistryHelpers = getService('endpointRegistryHelpers');
|
||||
|
||||
before(async () => {
|
||||
if (!endpointRegistryHelpers.isRegistryEnabled()) {
|
||||
log.warning('These tests are being run with an external package registry');
|
||||
}
|
||||
|
||||
const registryUrl =
|
||||
endpointRegistryHelpers.getRegistryUrlFromTestEnv() ?? getRegistryUrlFromIngest();
|
||||
log.info(`Package registry URL for tests: ${registryUrl}`);
|
||||
log.info('calling Fleet setup');
|
||||
await ingestManager.setup();
|
||||
|
|
@ -0,0 +1,397 @@
|
|||
/*
|
||||
* 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 expect from '@kbn/expect';
|
||||
import { IndexedHostsAndAlertsResponse } from '@kbn/security-solution-plugin/common/endpoint/index_data';
|
||||
import { PROTECTION_NOTICE_SUPPORTED_ENDPOINT_VERSION } from '@kbn/security-solution-plugin/public/management/pages/policy/view/policy_settings_form/protection_notice_supported_endpoint_version';
|
||||
import { getPolicySettingsFormTestSubjects } from '@kbn/security-solution-plugin/public/management/pages/policy/view/policy_settings_form/mocks';
|
||||
import { FtrProviderContext } from '../../configs/ftr_provider_context';
|
||||
import { PolicyTestResourceInfo } from '../../services/endpoint_policy';
|
||||
import { targetTags } from '../../target_tags';
|
||||
|
||||
export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const browser = getService('browser');
|
||||
const pageObjects = getPageObjects([
|
||||
'common',
|
||||
'endpoint',
|
||||
'policy',
|
||||
'endpointPageUtils',
|
||||
'ingestManagerCreatePackagePolicy',
|
||||
'trustedApps',
|
||||
]);
|
||||
const testSubjects = getService('testSubjects');
|
||||
const policyTestResources = getService('policyTestResources');
|
||||
const endpointTestResources = getService('endpointTestResources');
|
||||
const retry = getService('retry');
|
||||
const timeout = 150_000;
|
||||
describe('When on the Endpoint Policy Details Page', function () {
|
||||
targetTags(this, ['@ess', '@serverless']);
|
||||
|
||||
let indexedData: IndexedHostsAndAlertsResponse;
|
||||
const formTestSubjects = getPolicySettingsFormTestSubjects();
|
||||
|
||||
before(async () => {
|
||||
indexedData = await endpointTestResources.loadEndpointData();
|
||||
await browser.refresh();
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
await endpointTestResources.unloadEndpointData(indexedData);
|
||||
});
|
||||
|
||||
describe('with an invalid policy id', () => {
|
||||
it('should display an error', async () => {
|
||||
await pageObjects.policy.navigateToPolicyDetails('invalid-id');
|
||||
await testSubjects.existOrFail('policyDetailsIdNotFoundMessage');
|
||||
expect(await testSubjects.getVisibleText('policyDetailsIdNotFoundMessage')).to.equal(
|
||||
'Package policy invalid-id not found'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('with a valid policy id', () => {
|
||||
let policyInfo: PolicyTestResourceInfo;
|
||||
|
||||
before(async () => {
|
||||
policyInfo = await policyTestResources.createPolicy();
|
||||
await pageObjects.policy.navigateToPolicyDetails(policyInfo.packagePolicy.id);
|
||||
});
|
||||
|
||||
after(async () => {
|
||||
if (policyInfo) {
|
||||
await policyInfo.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
it('should display policy view', async () => {
|
||||
this.timeout(timeout);
|
||||
|
||||
await retry.waitForWithTimeout('policy title is not empty', 120_000, async () => {
|
||||
return (await testSubjects.getVisibleText('header-page-title')) !== '';
|
||||
});
|
||||
expect(await testSubjects.getVisibleText('header-page-title')).to.equal(
|
||||
policyInfo.packagePolicy.name
|
||||
);
|
||||
});
|
||||
|
||||
describe('side navigation', function () {
|
||||
targetTags(this, ['@skipInServerless']);
|
||||
|
||||
it('should not hide the side navigation', async function () {
|
||||
await testSubjects.scrollIntoView('solutionSideNavItemLink-get_started');
|
||||
// ensure center of button is visible and not hidden by sticky bottom bar
|
||||
await testSubjects.click('solutionSideNavItemLink-administration', 1000, 15);
|
||||
// test cleanup: go back to policy details page
|
||||
await pageObjects.policy.navigateToPolicyDetails(policyInfo.packagePolicy.id);
|
||||
});
|
||||
});
|
||||
|
||||
it('Should show/hide advanced section when button is clicked', async () => {
|
||||
await testSubjects.missingOrFail(formTestSubjects.advancedSection.settingsContainer);
|
||||
|
||||
// Expand
|
||||
await pageObjects.policy.showAdvancedSettingsSection();
|
||||
await testSubjects.existOrFail(formTestSubjects.advancedSection.settingsContainer);
|
||||
|
||||
// Collapse
|
||||
await pageObjects.policy.hideAdvancedSettingsSection();
|
||||
await testSubjects.missingOrFail(formTestSubjects.advancedSection.settingsContainer);
|
||||
});
|
||||
});
|
||||
|
||||
['malware', 'ransomware'].forEach((protection) => {
|
||||
describe(`on the ${protection} protections card`, () => {
|
||||
let policyInfo: PolicyTestResourceInfo;
|
||||
const cardTestSubj:
|
||||
| typeof formTestSubjects['ransomware']
|
||||
| typeof formTestSubjects['malware'] =
|
||||
formTestSubjects[
|
||||
protection as keyof Pick<typeof formTestSubjects, 'malware' | 'ransomware'>
|
||||
];
|
||||
|
||||
beforeEach(async () => {
|
||||
policyInfo = await policyTestResources.createPolicy();
|
||||
await pageObjects.policy.navigateToPolicyDetails(policyInfo.packagePolicy.id);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
if (policyInfo) {
|
||||
await policyInfo.cleanup();
|
||||
|
||||
// @ts-expect-error forcing to undefined
|
||||
policyInfo = undefined;
|
||||
}
|
||||
});
|
||||
|
||||
it('should show the supported Endpoint version for user notification', async () => {
|
||||
expect(await testSubjects.getVisibleText(cardTestSubj.notifySupportedVersion)).to.equal(
|
||||
'Agent version ' +
|
||||
PROTECTION_NOTICE_SUPPORTED_ENDPOINT_VERSION[
|
||||
protection as keyof typeof PROTECTION_NOTICE_SUPPORTED_ENDPOINT_VERSION
|
||||
]
|
||||
);
|
||||
});
|
||||
|
||||
it('should show the custom message text area when the Notify User checkbox is checked', async () => {
|
||||
expect(await testSubjects.isChecked(cardTestSubj.notifyUserCheckbox)).to.be(true);
|
||||
await testSubjects.existOrFail(cardTestSubj.notifyCustomMessage);
|
||||
});
|
||||
|
||||
it('should not show the custom message text area when the Notify User checkbox is unchecked', async () => {
|
||||
await pageObjects.endpointPageUtils.clickOnEuiCheckbox(cardTestSubj.notifyUserCheckbox);
|
||||
expect(await testSubjects.isChecked(cardTestSubj.notifyUserCheckbox)).to.be(false);
|
||||
await testSubjects.missingOrFail(cardTestSubj.notifyCustomMessage);
|
||||
});
|
||||
|
||||
it('should show a sample custom message', async () => {
|
||||
expect(await testSubjects.getVisibleText(cardTestSubj.notifyCustomMessage)).equal(
|
||||
'Elastic Security {action} {filename}'
|
||||
);
|
||||
});
|
||||
|
||||
it('should show a tooltip on hover', async () => {
|
||||
await testSubjects.moveMouseTo(cardTestSubj.notifyCustomMessageTooltipIcon);
|
||||
|
||||
await retry.waitFor(
|
||||
'should show a tooltip on hover',
|
||||
async () =>
|
||||
(await testSubjects.getVisibleText(cardTestSubj.notifyCustomMessageTooltipInfo)) ===
|
||||
`Selecting the user notification option will display a notification to the host user when ${protection} is prevented or detected.\nThe user notification can be customized in the text box below. Bracketed tags can be used to dynamically populate the applicable action (such as prevented or detected) and the filename.`
|
||||
);
|
||||
});
|
||||
|
||||
it('should preserve a custom notification message upon saving', async () => {
|
||||
await testSubjects.setValue(cardTestSubj.notifyCustomMessage, '', {
|
||||
clearWithKeyboard: true,
|
||||
});
|
||||
await testSubjects.setValue(
|
||||
cardTestSubj.notifyCustomMessage,
|
||||
'a custom notification message @$% 123',
|
||||
{ typeCharByChar: true }
|
||||
);
|
||||
|
||||
await pageObjects.policy.confirmAndSave();
|
||||
await testSubjects.existOrFail('policyDetailsSuccessMessage');
|
||||
expect(await testSubjects.getVisibleText(cardTestSubj.notifyCustomMessage)).to.equal(
|
||||
'a custom notification message @$% 123'
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('and the save button is clicked', () => {
|
||||
let policyInfo: PolicyTestResourceInfo;
|
||||
|
||||
beforeEach(async () => {
|
||||
policyInfo = await policyTestResources.createPolicy();
|
||||
await pageObjects.policy.navigateToPolicyDetails(policyInfo.packagePolicy.id);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
if (policyInfo) {
|
||||
await policyInfo.cleanup();
|
||||
|
||||
// @ts-expect-error forcing to undefined
|
||||
policyInfo = undefined;
|
||||
}
|
||||
});
|
||||
|
||||
it('should display success toast on successful save', async () => {
|
||||
await pageObjects.endpointPageUtils.clickOnEuiCheckbox(
|
||||
formTestSubjects.windowsEvents.dnsCheckbox
|
||||
);
|
||||
await pageObjects.policy.confirmAndSave();
|
||||
|
||||
await testSubjects.existOrFail('policyDetailsSuccessMessage');
|
||||
expect(await testSubjects.getVisibleText('policyDetailsSuccessMessage')).to.equal(
|
||||
`Success!\nIntegration ${policyInfo.packagePolicy.name} has been updated.`
|
||||
);
|
||||
});
|
||||
|
||||
it('should persist update on the screen', async () => {
|
||||
await pageObjects.endpointPageUtils.clickOnEuiCheckbox(
|
||||
formTestSubjects.windowsEvents.processCheckbox
|
||||
);
|
||||
await pageObjects.policy.confirmAndSave();
|
||||
|
||||
await testSubjects.existOrFail('policyDetailsSuccessMessage');
|
||||
await testSubjects.existOrFail('toastCloseButton');
|
||||
await pageObjects.endpoint.navigateToEndpointList();
|
||||
await pageObjects.policy.navigateToPolicyDetails(policyInfo.packagePolicy.id);
|
||||
|
||||
expect(
|
||||
await (
|
||||
await testSubjects.find(formTestSubjects.windowsEvents.processCheckbox)
|
||||
).isSelected()
|
||||
).to.equal(false);
|
||||
});
|
||||
|
||||
it('should have updated policy data in overall Agent Policy', async () => {
|
||||
// This test ensures that updates made to the Endpoint Policy are carried all the way through
|
||||
// to the generated Agent Policy that is dispatch down to the Elastic Agent.
|
||||
|
||||
await Promise.all([
|
||||
pageObjects.endpointPageUtils.clickOnEuiCheckbox(
|
||||
formTestSubjects.windowsEvents.fileCheckbox
|
||||
),
|
||||
pageObjects.endpointPageUtils.clickOnEuiCheckbox(
|
||||
formTestSubjects.linuxEvents.fileCheckbox
|
||||
),
|
||||
pageObjects.endpointPageUtils.clickOnEuiCheckbox(formTestSubjects.macEvents.fileCheckbox),
|
||||
]);
|
||||
|
||||
await pageObjects.policy.showAdvancedSettingsSection();
|
||||
|
||||
const advancedPolicyField = await pageObjects.policy.findAdvancedPolicyField();
|
||||
await advancedPolicyField.clearValue();
|
||||
await advancedPolicyField.click();
|
||||
await advancedPolicyField.type('true');
|
||||
await pageObjects.policy.confirmAndSave();
|
||||
|
||||
await testSubjects.existOrFail('policyDetailsSuccessMessage');
|
||||
await testSubjects.waitForDeleted('toastCloseButton');
|
||||
|
||||
const agentFullPolicy = await policyTestResources.getFullAgentPolicy(
|
||||
policyInfo.agentPolicy.id
|
||||
);
|
||||
|
||||
expect(agentFullPolicy.inputs[0].id).to.eql(policyInfo.packagePolicy.id);
|
||||
expect(agentFullPolicy.inputs[0].policy.linux.advanced.agent.connection_delay).to.eql(
|
||||
'true'
|
||||
);
|
||||
expect(agentFullPolicy.inputs[0].policy.linux.events.file).to.eql(false);
|
||||
expect(agentFullPolicy.inputs[0].policy.mac.events.file).to.eql(false);
|
||||
expect(agentFullPolicy.inputs[0].policy.windows.events.file).to.eql(false);
|
||||
});
|
||||
|
||||
it('should have cleared the advanced section when the user deletes the value', async () => {
|
||||
await pageObjects.policy.showAdvancedSettingsSection();
|
||||
|
||||
const advancedPolicyField = await pageObjects.policy.findAdvancedPolicyField();
|
||||
await advancedPolicyField.clearValue();
|
||||
await advancedPolicyField.click();
|
||||
await advancedPolicyField.type('true');
|
||||
await pageObjects.policy.confirmAndSave();
|
||||
|
||||
await testSubjects.existOrFail('policyDetailsSuccessMessage');
|
||||
|
||||
const agentFullPolicy = await policyTestResources.getFullAgentPolicy(
|
||||
policyInfo.agentPolicy.id
|
||||
);
|
||||
|
||||
expect(agentFullPolicy.inputs[0].policy.linux.advanced.agent.connection_delay).to.eql(
|
||||
'true'
|
||||
);
|
||||
|
||||
// Clear the value
|
||||
await advancedPolicyField.click();
|
||||
await advancedPolicyField.clearValueWithKeyboard();
|
||||
|
||||
// Make sure the toast button closes so the save button on the sticky footer is visible
|
||||
await testSubjects.waitForDeleted('toastCloseButton');
|
||||
await pageObjects.policy.confirmAndSave();
|
||||
|
||||
await testSubjects.existOrFail('policyDetailsSuccessMessage');
|
||||
|
||||
const agentFullPolicyUpdated = await policyTestResources.getFullAgentPolicy(
|
||||
policyInfo.agentPolicy.id
|
||||
);
|
||||
|
||||
expect(agentFullPolicyUpdated.inputs[0].policy.linux.advanced).to.eql({
|
||||
capture_env_vars: 'LD_PRELOAD,LD_LIBRARY_PATH',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('when on Ingest Policy Edit Package Policy page', async () => {
|
||||
let policyInfo: PolicyTestResourceInfo;
|
||||
|
||||
beforeEach(async () => {
|
||||
// Create a policy and navigate to Ingest app
|
||||
policyInfo = await policyTestResources.createPolicy();
|
||||
await pageObjects.ingestManagerCreatePackagePolicy.navigateToAgentPolicyEditPackagePolicy(
|
||||
policyInfo.agentPolicy.id,
|
||||
policyInfo.packagePolicy.id
|
||||
);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
if (policyInfo) {
|
||||
await policyInfo.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
it('should show the endpoint policy form', async () => {
|
||||
await testSubjects.existOrFail(formTestSubjects.form);
|
||||
});
|
||||
|
||||
it('should allow updates to policy items', async () => {
|
||||
const winDnsEventingCheckbox = await testSubjects.find(
|
||||
formTestSubjects.windowsEvents.dnsCheckbox
|
||||
);
|
||||
await pageObjects.ingestManagerCreatePackagePolicy.scrollToCenterOfWindow(
|
||||
winDnsEventingCheckbox
|
||||
);
|
||||
expect(await winDnsEventingCheckbox.isSelected()).to.be(true);
|
||||
await pageObjects.endpointPageUtils.clickOnEuiCheckbox(
|
||||
formTestSubjects.windowsEvents.dnsCheckbox
|
||||
);
|
||||
await pageObjects.policy.waitForCheckboxSelectionChange(
|
||||
formTestSubjects.windowsEvents.dnsCheckbox,
|
||||
false
|
||||
);
|
||||
});
|
||||
|
||||
it('should include updated endpoint data when saved', async () => {
|
||||
await pageObjects.ingestManagerCreatePackagePolicy.scrollToCenterOfWindow(
|
||||
await testSubjects.find(formTestSubjects.windowsEvents.dnsCheckbox)
|
||||
);
|
||||
await pageObjects.endpointPageUtils.clickOnEuiCheckbox(
|
||||
formTestSubjects.windowsEvents.dnsCheckbox
|
||||
);
|
||||
const updatedCheckboxValue = await testSubjects.isSelected(
|
||||
formTestSubjects.windowsEvents.dnsCheckbox
|
||||
);
|
||||
|
||||
await pageObjects.policy.waitForCheckboxSelectionChange(
|
||||
formTestSubjects.windowsEvents.dnsCheckbox,
|
||||
false
|
||||
);
|
||||
|
||||
await (await pageObjects.ingestManagerCreatePackagePolicy.findSaveButton(true)).click();
|
||||
await pageObjects.ingestManagerCreatePackagePolicy.waitForSaveSuccessNotification(true);
|
||||
|
||||
await pageObjects.ingestManagerCreatePackagePolicy.navigateToAgentPolicyEditPackagePolicy(
|
||||
policyInfo.agentPolicy.id,
|
||||
policyInfo.packagePolicy.id
|
||||
);
|
||||
|
||||
await pageObjects.policy.waitForCheckboxSelectionChange(
|
||||
formTestSubjects.windowsEvents.dnsCheckbox,
|
||||
updatedCheckboxValue
|
||||
);
|
||||
});
|
||||
|
||||
['trustedApps', 'eventFilters', 'blocklists', 'hostIsolationExceptions'].forEach(
|
||||
(cardName) => {
|
||||
it(`should show ${cardName} card and link should go back to policy`, async () => {
|
||||
await testSubjects.existOrFail(`${cardName}-fleet-integration-card`);
|
||||
|
||||
const card = await testSubjects.find(`${cardName}-fleet-integration-card`);
|
||||
await pageObjects.ingestManagerCreatePackagePolicy.scrollToCenterOfWindow(card);
|
||||
await (await testSubjects.find(`${cardName}-link-to-exceptions`)).click();
|
||||
|
||||
await testSubjects.existOrFail('policyDetailsPage');
|
||||
|
||||
await (await testSubjects.find('policyDetailsBackLink')).click();
|
||||
await testSubjects.existOrFail('endpointIntegrationPolicyForm');
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
|
@ -9,6 +9,7 @@ import expect from '@kbn/expect';
|
|||
import { IndexedHostsAndAlertsResponse } from '@kbn/security-solution-plugin/common/endpoint/index_data';
|
||||
import { FtrProviderContext } from '../../configs/ftr_provider_context';
|
||||
import { PolicyTestResourceInfo } from '../../services/endpoint_policy';
|
||||
import { targetTags } from '../../target_tags';
|
||||
|
||||
export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
||||
const browser = getService('browser');
|
||||
|
@ -24,7 +25,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
const policyTestResources = getService('policyTestResources');
|
||||
const endpointTestResources = getService('endpointTestResources');
|
||||
|
||||
describe('@ess @serverless When on the Endpoint Policy List Page', function () {
|
||||
describe('When on the Endpoint Policy List Page', function () {
|
||||
targetTags(this, ['@ess', '@serverless']);
|
||||
|
||||
before(async () => {
|
||||
await browser.refresh();
|
||||
});
|
|
@ -8,6 +8,7 @@
|
|||
import expect from '@kbn/expect';
|
||||
import { IndexedHostsAndAlertsResponse } from '@kbn/security-solution-plugin/common/endpoint/index_data';
|
||||
import { FtrProviderContext } from '../../configs/ftr_provider_context';
|
||||
import { targetTags } from '../../target_tags';
|
||||
|
||||
export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
||||
const pageObjects = getPageObjects(['common', 'trustedApps']);
|
||||
|
@ -16,7 +17,9 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
|||
const endpointTestResources = getService('endpointTestResources');
|
||||
const toasts = getService('toasts');
|
||||
|
||||
describe('@ess @serverless When on the Trusted Apps list', function () {
|
||||
describe('When on the Trusted Apps list', function () {
|
||||
targetTags(this, ['@ess', '@serverless']);
|
||||
|
||||
let indexedData: IndexedHostsAndAlertsResponse;
|
||||
before(async () => {
|
||||
indexedData = await endpointTestResources.loadEndpointData();
|
|
@ -7,11 +7,8 @@
|
|||
|
||||
import { Config } from '@kbn/test';
|
||||
import { FtrConfigProviderContext } from '@kbn/test';
|
||||
import { SecuritySolutionEndpointRegistryHelpers } from '../../common/services/security_solution';
|
||||
import { pageObjects } from '../page_objects';
|
||||
import {
|
||||
getRegistryUrlAsArray,
|
||||
createEndpointDockerConfig,
|
||||
} from '../../security_solution_endpoint_api_int/registry';
|
||||
import type { TargetTags } from '../target_tags';
|
||||
|
||||
export const SUITE_TAGS: Record<
|
||||
|
@ -46,9 +43,11 @@ export const generateConfig = async ({
|
|||
services: any;
|
||||
}): Promise<Config> => {
|
||||
const { readConfigFile } = ftrConfigProviderContext;
|
||||
|
||||
// services are not ready yet, so we need to import them here
|
||||
const { createEndpointDockerConfig, getRegistryUrlAsArray } =
|
||||
SecuritySolutionEndpointRegistryHelpers();
|
||||
const xpackFunctionalConfig = await readConfigFile(
|
||||
require.resolve('../../../../functional/config.base.js')
|
||||
require.resolve('../../functional/config.base.js')
|
||||
);
|
||||
|
||||
return {
|
||||
|
@ -91,12 +90,10 @@ export const generateConfig = async ({
|
|||
layout: {
|
||||
fixedHeaderHeight: 200,
|
||||
},
|
||||
mochaOpts: {
|
||||
...baseConfig.get('mochaOpts'),
|
||||
grep:
|
||||
target === 'serverless'
|
||||
? '/^(?!.*@(skipInServerless|brokenInServerless)).*@serverless/'
|
||||
: '/^(?!.*@skipInEss).*@ess.*/',
|
||||
suiteTags: {
|
||||
...baseConfig.get('suiteTags'),
|
||||
include: [...baseConfig.get('suiteTags.include'), ...SUITE_TAGS[target].include],
|
||||
exclude: [...baseConfig.get('suiteTags.exclude'), ...SUITE_TAGS[target].exclude],
|
||||
},
|
||||
};
|
||||
};
|
|
@ -10,11 +10,12 @@ import { resolve } from 'path';
|
|||
import { generateConfig } from './config.base';
|
||||
import { services } from '../services';
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default async function (ftrConfigProviderContext: FtrConfigProviderContext) {
|
||||
const { readConfigFile } = ftrConfigProviderContext;
|
||||
|
||||
const xpackFunctionalConfig = await readConfigFile(
|
||||
require.resolve('../../../../functional/config.base.js')
|
||||
require.resolve('../../functional/config.base.js')
|
||||
);
|
||||
|
||||
return generateConfig({
|
|
@ -10,11 +10,12 @@ import { FtrConfigProviderContext } from '@kbn/test';
|
|||
import { generateConfig } from './config.base';
|
||||
import { services } from '../services';
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default async function (ftrConfigProviderContext: FtrConfigProviderContext) {
|
||||
const { readConfigFile } = ftrConfigProviderContext;
|
||||
|
||||
const xpackFunctionalConfig = await readConfigFile(
|
||||
require.resolve('../../../../functional/config.base.js')
|
||||
require.resolve('../../functional/config.base.js')
|
||||
);
|
||||
|
||||
return generateConfig({
|
|
@ -10,11 +10,12 @@ import { resolve } from 'path';
|
|||
import { generateConfig } from './config.base';
|
||||
import { svlServices } from '../services';
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default async function (ftrConfigProviderContext: FtrConfigProviderContext) {
|
||||
const { readConfigFile } = ftrConfigProviderContext;
|
||||
|
||||
const svlBaseConfig = await readConfigFile(
|
||||
require.resolve('../../../../../test_serverless/shared/config.base.ts')
|
||||
require.resolve('../../../test_serverless/shared/config.base.ts')
|
||||
);
|
||||
|
||||
return generateConfig({
|
|
@ -10,11 +10,12 @@ import { FtrConfigProviderContext } from '@kbn/test';
|
|||
import { generateConfig } from './config.base';
|
||||
import { svlServices } from '../services';
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default async function (ftrConfigProviderContext: FtrConfigProviderContext) {
|
||||
const { readConfigFile } = ftrConfigProviderContext;
|
||||
|
||||
const svlBaseConfig = await readConfigFile(
|
||||
require.resolve('../../../../../test_serverless/shared/config.base.ts')
|
||||
require.resolve('../../../test_serverless/shared/config.base.ts')
|
||||
);
|
||||
|
||||
return generateConfig({
|
|
@ -5,14 +5,14 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { pageObjects as xpackFunctionalPageObjects } from '../../../../functional/page_objects';
|
||||
import { pageObjects as xpackFunctionalPageObjects } from '../../functional/page_objects';
|
||||
import { EndpointPageProvider } from './endpoint_page';
|
||||
import { EndpointPageUtils } from './page_utils';
|
||||
import { IngestManagerCreatePackagePolicy } from './ingest_manager_create_package_policy_page';
|
||||
import { DetectionsPageObject } from '../../../../security_solution_ftr/page_objects/detections';
|
||||
import { HostsPageObject } from '../../../../security_solution_ftr/page_objects/hosts';
|
||||
import { DetectionsPageObject } from '../../security_solution_ftr/page_objects/detections';
|
||||
import { HostsPageObject } from '../../security_solution_ftr/page_objects/hosts';
|
||||
import { EndpointResponderPageObjects } from './endpoint_responder';
|
||||
import { TimelinePageObject } from '../../../../security_solution_ftr/page_objects/timeline';
|
||||
import { TimelinePageObject } from '../../security_solution_ftr/page_objects/timeline';
|
||||
import { EndpointPolicyPageProvider } from './policy_page';
|
||||
import { TrustedAppsPageProvider } from './trusted_apps_page';
|
||||
import { FleetIntegrations } from './fleet_integrations_page';
|
|
@ -35,10 +35,10 @@ import { HostInfo, HostMetadata } from '@kbn/security-solution-plugin/common/end
|
|||
import { EndpointDocGenerator } from '@kbn/security-solution-plugin/common/endpoint/generate_data';
|
||||
import { EndpointMetadataGenerator } from '@kbn/security-solution-plugin/common/endpoint/data_generators/endpoint_metadata_generator';
|
||||
import { merge } from 'lodash';
|
||||
|
||||
// @ts-expect-error we have to check types with "allowJs: false" for now, causing this import to fail
|
||||
import { kibanaPackageJson } from '@kbn/repo-info';
|
||||
import seedrandom from 'seedrandom';
|
||||
import { FtrService } from '../../../../functional/ftr_provider_context';
|
||||
import { FtrService } from '../../functional/ftr_provider_context';
|
||||
|
||||
// Document Generator override that uses a custom Endpoint Metadata generator and sets the
|
||||
// `agent.version` to the current version
|
|
@ -19,7 +19,7 @@ import { EVENT_FILTER_LIST_DEFINITION } from '@kbn/security-solution-plugin/publ
|
|||
import { HOST_ISOLATION_EXCEPTIONS_LIST_DEFINITION } from '@kbn/security-solution-plugin/public/management/pages/host_isolation_exceptions/constants';
|
||||
import { BLOCKLISTS_LIST_DEFINITION } from '@kbn/security-solution-plugin/public/management/pages/blocklist/constants';
|
||||
import { ManifestConstants } from '@kbn/security-solution-plugin/server/endpoint/lib/artifacts';
|
||||
import { FtrService } from '../../../../functional/ftr_provider_context';
|
||||
import { FtrService } from '../../functional/ftr_provider_context';
|
||||
import { InternalUnifiedManifestSchemaResponseType } from '../apps/integrations/mocks';
|
||||
|
||||
export interface ArtifactTestData {
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import fs from 'fs';
|
||||
import Path from 'path';
|
||||
|
||||
// @ts-expect-error we have to check types with "allowJs: false" for now, causing this import to fail
|
||||
import { REPO_ROOT as KIBANA_ROOT } from '@kbn/repo-info';
|
||||
import { FtrProviderContext } from '../configs/ftr_provider_context';
|
||||
|
|
@ -5,18 +5,20 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { services as xPackFunctionalServices } from '../../../../functional/services';
|
||||
import { IngestManagerProvider } from '../../../../common/services/ingest_manager';
|
||||
import { services as xPackFunctionalServices } from '../../functional/services';
|
||||
import { IngestManagerProvider } from '../../common/services/ingest_manager';
|
||||
import { EndpointTelemetryTestResourcesProvider } from './endpoint_telemetry';
|
||||
import { EndpointTestResources } from './endpoint';
|
||||
import { TimelineTestService } from '../../../../security_solution_ftr/services/timeline';
|
||||
import { DetectionsTestService } from '../../../../security_solution_ftr/services/detections';
|
||||
import { TimelineTestService } from '../../security_solution_ftr/services/timeline';
|
||||
import { DetectionsTestService } from '../../security_solution_ftr/services/detections';
|
||||
import { EndpointPolicyTestResourcesProvider } from './endpoint_policy';
|
||||
import { EndpointArtifactsTestResources } from './endpoint_artifacts';
|
||||
import {
|
||||
KibanaSupertestWithCertProvider,
|
||||
KibanaSupertestWithCertWithoutAuthProvider,
|
||||
} from './supertest_with_cert';
|
||||
import { SecuritySolutionEndpointDataStreamHelpers } from '../../common/services/security_solution/endpoint_data_stream_helpers';
|
||||
import { SecuritySolutionEndpointRegistryHelpers } from '../../common/services/security_solution/endpoint_registry_helpers';
|
||||
|
||||
export const services = {
|
||||
...xPackFunctionalServices,
|
||||
|
@ -28,6 +30,8 @@ export const services = {
|
|||
detections: DetectionsTestService,
|
||||
endpointArtifactTestResources: EndpointArtifactsTestResources,
|
||||
policyTestResources: EndpointPolicyTestResourcesProvider,
|
||||
endpointDataStreamHelpers: SecuritySolutionEndpointDataStreamHelpers,
|
||||
endpointRegistryHelpers: SecuritySolutionEndpointRegistryHelpers,
|
||||
};
|
||||
|
||||
export const svlServices = {
|
|
@ -172,6 +172,7 @@
|
|||
"@kbn/alerting-state-types",
|
||||
"@kbn/reporting-server",
|
||||
"@kbn/data-quality-plugin",
|
||||
"@kbn/securitysolution-io-ts-list-types",
|
||||
"@kbn/ml-trained-models-utils"
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue