Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Detection Engine][FTR] Audit DE exceptions tests #179706

Merged
merged 8 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -474,18 +474,18 @@ enabled:
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/long/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/long/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/basic_license_essentials_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/date_numeric_types/basic_license_essentials_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/basic_license_essentials_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/ips/basic_license_essentials_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/basic_license_essentials_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/keyword/basic_license_essentials_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/long/basic_license_essentials_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/long/basic_license_essentials_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/basic_license_essentials_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/operators_data_types/text/basic_license_essentials_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/basic_license_essentials_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/exceptions/workflows/basic_license_essentials_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/rule_execution_logic/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/rule_creation/basic_license_essentials_tier/configs/ess.config.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ FORMATTED_KB_URL="${KB_URL/https:\/\//}"
# This is used in order to wait for the environment to be ready.
sleep 150

TEST_CLOUD=1 TEST_ES_URL="https://elastic:$PASSWORD@$FORMATTED_ES_URL:443" TEST_KIBANA_URL="https://elastic:$PASSWORD@$FORMATTED_KB_URL:443" yarn run $1
echo "uername: $USERNAME"
Copy link
Member

Choose a reason for hiding this comment

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

Was this intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey, I'm sorry, I meant to open as draft and then I got pulled into something else. I'll clean up right now.


TEST_CLOUD=1 TEST_ES_URL="https://$USERNAME:$PASSWORD@$FORMATTED_ES_URL:443" TEST_KIBANA_URL="https://$USERNAME:$PASSWORD@$FORMATTED_KB_URL:443" yarn run $1
cmd_status=$?
echo "Exit code with status: $cmd_status"

Expand Down
10 changes: 8 additions & 2 deletions packages/kbn-es/src/serverless_resources/security_roles.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"logs-*",
"packetbeat-*",
"winlogbeat-*",
"logstash-*",
".asset-criticality.asset-criticality-*"
],
"privileges": ["read", "write"]
Expand All @@ -117,7 +118,7 @@
"privileges": ["read", "write"]
},
{
"names": ["metrics-endpoint.metadata_current_*", ".fleet-agents*", ".fleet-actions*"],
"names": ["metrics-endpoint.metadata_current_*", ".fleet-agents*", ".fleet-actions*", "risk-score.risk-score-*"],
"privileges": ["read"]
}
],
Expand All @@ -143,9 +144,14 @@
"file_operations_all"
],
"securitySolutionCases": ["all"],
"securitySolutionAssistant": ["all"],
"actions": ["read"],
"builtInAlerts": ["all"],
"osquery": ["all"]
"osquery": ["all"],
"discover": ["all"],
"dashboard": ["all"],
"maps": ["all"],
"visualize": ["all"]
},
"spaces": ["*"],
"base": []
Expand Down
70 changes: 35 additions & 35 deletions x-pack/test/security_solution_api_integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,41 +74,41 @@
"telemetry:server:ess": "npm run initialize-server:dr telemetry ess",
"telemetry:runner:ess": "npm run run-tests:dr telemetry ess essEnv",

"exception_workflows:server:serverless": "npm run initialize-server:de exceptions/workflows serverless",
"exception_workflows:runner:serverless": "npm run run-tests:de exceptions/workflows serverless serverlessEnv",
"exception_workflows:qa:serverless": "npm run run-tests:de exceptions/workflows serverless qaEnv",
"exception_workflows:server:ess": "npm run initialize-server:de exceptions/workflows ess",
"exception_workflows:runner:ess": "npm run run-tests:de exceptions/workflows ess essEnv",

"exception_operators_date_numeric_types:server:serverless": "npm run initialize-server:de exceptions/operators_data_types/date_numeric_types serverless",
"exception_operators_date_numeric_types:runner:serverless": "npm run run-tests:de exceptions/operators_data_types/date_numeric_types serverless serverlessEnv",
"exception_operators_date_numeric_types:qa:serverless": "npm run run-tests:de exceptions/operators_data_types/date_numeric_types serverless qaEnv",
"exception_operators_date_numeric_types:server:ess": "npm run initialize-server:de exceptions/operators_data_types/date_numeric_types ess",
"exception_operators_date_numeric_types:runner:ess": "npm run run-tests:de exceptions/operators_data_types/date_numeric_types ess essEnv",

"exception_operators_keyword:server:serverless": "npm run initialize-server:de exceptions/operators_data_types/keyword serverless",
"exception_operators_keyword:runner:serverless": "npm run run-tests:de exceptions/operators_data_types/keyword serverless serverlessEnv",
"exception_operators_keyword:qa:serverless": "npm run run-tests:de exceptions/operators_data_types/keyword serverless qaEnv",
"exception_operators_keyword:server:ess": "npm run initialize-server:de exceptions/operators_data_types/keyword ess",
"exception_operators_keyword:runner:ess": "npm run run-tests:de exceptions/operators_data_types/keyword ess essEnv",

"exception_operators_ips:server:serverless": "npm run initialize-server:de exceptions/operators_data_types/ips serverless",
"exception_operators_ips:runner:serverless": "npm run run-tests:de exceptions/operators_data_types/ips serverless serverlessEnv",
"exception_operators_ips:qa:serverless": "npm run run-tests:de exceptions/operators_data_types/ips serverless qaEnv",
"exception_operators_ips:server:ess": "npm run initialize-server:de exceptions/operators_data_types/ips ess",
"exception_operators_ips:runner:ess": "npm run run-tests:de exceptions/operators_data_types/ips ess essEnv",

"exception_operators_long:server:serverless": "npm run initialize-server:de exceptions/operators_data_types/long serverless",
"exception_operators_long:runner:serverless": "npm run run-tests:de exceptions/operators_data_types/long serverless serverlessEnv",
"exception_operators_long:qa:serverless": "npm run run-tests:de exceptions/operators_data_types/long serverless qaEnv",
"exception_operators_long:server:ess": "npm run initialize-server:de exceptions/operators_data_types/long ess",
"exception_operators_long:runner:ess": "npm run run-tests:de exceptions/operators_data_types/long ess essEnv",

"exception_operators_text:server:serverless": "npm run initialize-server:de exceptions/operators_data_types/text serverless",
"exception_operators_text:runner:serverless": "npm run run-tests:de exceptions/operators_data_types/text serverless serverlessEnv",
"exception_operators_text:qa:serverless": "npm run run-tests:de exceptions/operators_data_types/text serverless qaEnv",
"exception_operators_text:server:ess": "npm run initialize-server:de exceptions/operators_data_types/text ess",
"exception_operators_text:runner:ess": "npm run run-tests:de exceptions/operators_data_types/text ess essEnv",
"exception_workflows:essentials:server:serverless": "npm run initialize-server:de:basic_essentials exceptions/workflows serverless",
"exception_workflows:essentials:runner:serverless": "npm run run-tests:de:basic_essentials exceptions/workflows serverless serverlessEnv",
"exception_workflows:essentials:qa:serverless": "npm run run-tests:de:basic_essentials exceptions/workflows serverless qaEnv",
"exception_workflows:basic:server:ess": "npm run initialize-server:de:basic_essentials exceptions/workflows ess",
"exception_workflows:basic:runner:ess": "npm run run-tests:de:basic_essentials exceptions/workflows ess essEnv",

"exception_operators_date_numeric_types:essentials:server:serverless": "npm run initialize-server:de:basic_essentials exceptions/operators_data_types/date_numeric_types serverless",
"exception_operators_date_numeric_types:essentials:runner:serverless": "npm run run-tests:de:basic_essentials exceptions/operators_data_types/date_numeric_types serverless serverlessEnv",
"exception_operators_date_numeric_types:essentials:qa:serverless": "npm run run-tests:de:basic_essentials exceptions/operators_data_types/date_numeric_types serverless qaEnv",
"exception_operators_date_numeric_types:basic:server:ess": "npm run initialize-server:de:basic_essentials exceptions/operators_data_types/date_numeric_types ess",
"exception_operators_date_numeric_types:basic:runner:ess": "npm run run-tests:de:basic_essentials exceptions/operators_data_types/date_numeric_types ess essEnv",

"exception_operators_keyword:essentials:server:serverless": "npm run initialize-server:de:basic_essentials exceptions/operators_data_types/keyword serverless",
"exception_operators_keyword:essentials:runner:serverless": "npm run run-tests:de:basic_essentials exceptions/operators_data_types/keyword serverless serverlessEnv",
"exception_operators_keyword:essentials:qa:serverless": "npm run run-tests:de:basic_essentials exceptions/operators_data_types/keyword serverless qaEnv",
"exception_operators_keyword:basic:server:ess": "npm run initialize-server:de:basic_essentials exceptions/operators_data_types/keyword ess",
"exception_operators_keyword:basic:runner:ess": "npm run run-tests:de:basic_essentials exceptions/operators_data_types/keyword ess essEnv",

"exception_operators_ips:essentials:server:serverless": "npm run initialize-server:de:basic_essentials exceptions/operators_data_types/ips serverless",
"exception_operators_ips:essentials:runner:serverless": "npm run run-tests:de:basic_essentials exceptions/operators_data_types/ips serverless serverlessEnv",
"exception_operators_ips:essentials:qa:serverless": "npm run run-tests:de:basic_essentials exceptions/operators_data_types/ips serverless qaEnv",
"exception_operators_ips:basic:server:ess": "npm run initialize-server:de:basic_essentials exceptions/operators_data_types/ips ess",
"exception_operators_ips:basic:runner:ess": "npm run run-tests:de:basic_essentials exceptions/operators_data_types/ips ess essEnv",

"exception_operators_long:essentials:server:serverless": "npm run initialize-server:de:basic_essentials exceptions/operators_data_types/long serverless",
"exception_operators_long:essentials:runner:serverless": "npm run run-tests:de:basic_essentials exceptions/operators_data_types/long serverless serverlessEnv",
"exception_operators_long:essentials:qa:serverless": "npm run run-tests:de:basic_essentials exceptions/operators_data_types/long serverless qaEnv",
"exception_operators_long:basic:server:ess": "npm run initialize-server:de:basic_essentials exceptions/operators_data_types/long ess",
"exception_operators_long:basic:runner:ess": "npm run run-tests:de:basic_essentials exceptions/operators_data_types/long ess essEnv",

"exception_operators_text:essentials:server:serverless": "npm run initialize-server:de:basic_essentials exceptions/operators_data_types/text serverless",
"exception_operators_text:essentials:runner:serverless": "npm run run-tests:de:basic_essentials exceptions/operators_data_types/text serverless serverlessEnv",
"exception_operators_text:essentials:qa:serverless": "npm run run-tests:de:basic_essentials exceptions/operators_data_types/text serverless qaEnv",
"exception_operators_text:basic:server:ess": "npm run initialize-server:de:basic_essentials exceptions/operators_data_types/text ess",
"exception_operators_text:basic:runner:ess": "npm run run-tests:de:basic_essentials exceptions/operators_data_types/text ess essEnv",

"actions:server:serverless": "npm run initialize-server:de actions serverless",
"actions:runner:serverless": "npm run run-tests:de actions serverless serverlessEnv",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export default ({ getService }: FtrProviderContext) => {
await createAlertsIndex(supertest, log);
});
after(async () => {
// await esArchiver.unload('x-pack/test/functional/es_archives/endpoint/resolver/signals');
await deleteAllAlerts(supertest, log, es);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import { FtrConfigProviderContext } from '@kbn/test';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
require.resolve('../../../../../../../../config/ess/config.base.trial')
require.resolve('../../../../../../../../config/ess/config.base.basic')
);

return {
...functionalConfig.getAll(),
testFiles: [require.resolve('..')],
junit: {
reportName:
'Detection Engine - Exception Operators Date & Numeric Types Integration Tests - ESS Env - Trial License',
'Detection Engine - Exception Operators Date & Numeric Types Integration Tests - ESS Env - Basic License',
},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
* 2.0.
*/

import { createTestConfig } from '../../../../../../../../config/serverless/config.base';
import { createTestConfig } from '../../../../../../../../config/serverless/config.base.essentials';

export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
reportName:
'Detection Engine - Exception Operators Date & Numeric Types Integration Tests - Serverless Env - Complete Tier',
'Detection Engine - Exception Operators Date & Numeric Types Integration Tests - Serverless Env - Essentials Tier',
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import { FtrConfigProviderContext } from '@kbn/test';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
require.resolve('../../../../../../../../config/ess/config.base.trial')
require.resolve('../../../../../../../../config/ess/config.base.basic')
);

return {
...functionalConfig.getAll(),
testFiles: [require.resolve('..')],
junit: {
reportName:
'Detection Engine - Exception Operators IP Types Integration Tests - ESS Env - Trial License',
'Detection Engine - Exception Operators IP Types Integration Tests - ESS Env - Basic License',
},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
* 2.0.
*/

import { createTestConfig } from '../../../../../../../../config/serverless/config.base';
import { createTestConfig } from '../../../../../../../../config/serverless/config.base.essentials';

export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
reportName:
'Detection Engine - Exception Operators IP Types Integration Tests - Serverless Env - Complete Tier',
'Detection Engine - Exception Operators IP Types Integration Tests - Serverless Env - Essentials Tier',
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import { FtrConfigProviderContext } from '@kbn/test';

export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const functionalConfig = await readConfigFile(
require.resolve('../../../../../../../../config/ess/config.base.trial')
require.resolve('../../../../../../../../config/ess/config.base.basic')
);

return {
...functionalConfig.getAll(),
testFiles: [require.resolve('..')],
junit: {
reportName:
'Detection Engine - Exception Operators Keyword Types Integration Tests - ESS Env - Trial License',
'Detection Engine - Exception Operators Keyword Types Integration Tests - ESS Env - Basic License',
},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
* 2.0.
*/

import { createTestConfig } from '../../../../../../../../config/serverless/config.base';
import { createTestConfig } from '../../../../../../../../config/serverless/config.base.essentials';

export default createTestConfig({
testFiles: [require.resolve('..')],
junit: {
reportName:
'Detection Engine - Exception Operators Keyword Types Integration Tests - Serverless Env - Complete Tier',
'Detection Engine - Exception Operators Keyword Types Integration Tests - Serverless Env - Essentials Tier',
},
});
Loading