diff --git a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/utils.ts b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/utils.ts index 5b592b6b9926c..6fbd4cf07d5c8 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/utils.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/bulk_action/utils.ts @@ -42,8 +42,9 @@ const disableDetectionRules = async ( ): Promise => { const detectionRulesIdsToDisable = await getDetectionRuleIdsToDisable(detectionRules); if (!detectionRulesIdsToDisable.length) return []; - await detectionRulesClient.bulkDisableRules({ ids: detectionRulesIdsToDisable }); - return detectionRulesIdsToDisable; + const uniqueDetectionRulesIdsToDisable = [...new Set(detectionRulesIdsToDisable)]; // Prevent muting the same rule twice. + await detectionRulesClient.bulkDisableRules({ ids: uniqueDetectionRulesIdsToDisable }); + return uniqueDetectionRulesIdsToDisable; }; export const getDetectionRules = async ( diff --git a/x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts b/x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts index de77b33a66df7..17ce5675e1319 100644 --- a/x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts +++ b/x-pack/test/cloud_security_posture_api/routes/csp_benchmark_rules_bulk_update.ts @@ -93,8 +93,7 @@ export default function ({ getService }: FtrProviderContext) { log.debug('CSP plugin is initialized'); }); - // Failing: See https://github.com/elastic/kibana/issues/174204 - describe.skip('Verify update csp rules states API', async () => { + describe('Verify update csp rules states API', async () => { before(async () => { await waitForPluginInitialized(); });