Skip to content

[Contextual Security] SIEM Readiness Coverage All Rules Bug Fix#249923

Merged
animehart merged 12 commits intoelastic:mainfrom
animehart:small-bug-fix-all-rules-panel-1
Feb 4, 2026
Merged

[Contextual Security] SIEM Readiness Coverage All Rules Bug Fix#249923
animehart merged 12 commits intoelastic:mainfrom
animehart:small-bug-fix-all-rules-panel-1

Conversation

@animehart
Copy link
Copy Markdown
Contributor

@animehart animehart commented Jan 21, 2026

Summary

This PR is to address the Fix for the recently merged SIEM Readiness All Rules panel where Installed integration shows up when there are 0 Enabled Rules

This Issue was caused because the Installed integration was purely from packages API. We instead should be comparing those result with the list of related_integrations we get from the rules

** Before **
image (7)

** After **
Screenshot 2026-01-21 at 9 22 57 AM

@animehart
Copy link
Copy Markdown
Contributor Author

/ci

1 similar comment
@animehart
Copy link
Copy Markdown
Contributor Author

/ci

@animehart animehart added v9.4.0 release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:Cloud Security Cloud Security team related labels Jan 21, 2026
@animehart animehart marked this pull request as ready for review January 21, 2026 23:49
@animehart animehart requested a review from a team as a code owner January 21, 2026 23:49
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/contextual-security-apps (Team:Cloud Security)

@animehart animehart linked an issue Jan 22, 2026 that may be closed by this pull request
@animehart
Copy link
Copy Markdown
Contributor Author

/ci

@animehart animehart requested a review from Copilot January 26, 2026 21:01
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in the SIEM Readiness Coverage All Rules panel where installed integrations were incorrectly displayed even when there were zero enabled rules. The fix ensures that only integrations related to enabled rules are shown in the installed/missing integrations lists.

Changes:

  • Modified integration filtering logic to derive installed/missing integrations from enabled rules rather than purely from the packages API
  • Added memoized computation to extract integrations from enabled rules and compare with installed packages
  • Updated type definition to include enabled field in RelatedIntegrationRuleResponse

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
x-pack/solutions/security/plugins/security_solution/public/siem_readiness/pages/tabs/coverage_tab/rule_coverage_panels/all_rules.tsx Refactored integration filtering to only include integrations from enabled rules, replacing direct usage of installedIntegrationRules coverage data
x-pack/solutions/security/packages/siem-readiness/src/types.ts Added enabled field to RelatedIntegrationRuleResponse type definition

}

export interface RelatedIntegrationRuleResponse {
enabled: { package: string; version?: string; integration?: string }[] | undefined;
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The enabled field appears to be misplaced in the type definition. Based on the usage in all_rules.tsx where rule.enabled is accessed as a boolean and rule.related_integrations is accessed as an array, the enabled field should be a boolean property at the same level as related_integrations, not an array of integration objects. The current definition suggests enabled contains integration data rather than representing the rule's enabled state.

Suggested change
enabled: { package: string; version?: string; integration?: string }[] | undefined;
enabled: boolean;

Copilot uses AI. Check for mistakes.
Comment on lines +63 to +87
const integrationsFromEnabledRules = useMemo(() => {
if (!getDetectionRules.data?.data || getDetectionRules.data.data.length === 0) {
return {
relatedIntegrationNames: [],
installedIntegrationNames: [],
};
}

const integrationsSet = new Set<string>();

getDetectionRules.data.data.forEach((rule) => {
if (rule.enabled && rule.related_integrations) {
rule.related_integrations.forEach((integration) => {
if (integration.package) {
integrationsSet.add(integration.package);
}
});
}
});

return {
relatedIntegrationNames: Array.from(integrationsSet),
installedIntegrationNames: getInstalledIntegrations.map((item) => item.name),
};
}, [getDetectionRules.data?.data, getInstalledIntegrations]);
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

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

The new logic for filtering integrations from enabled rules lacks test coverage. This is critical functionality that determines which integrations are displayed as installed or missing. Tests should verify: (1) integrations are correctly extracted from enabled rules only, (2) disabled rules are properly excluded, (3) the intersection logic between related and installed integrations works correctly, and (4) edge cases like rules without related_integrations are handled.

Copilot uses AI. Check for mistakes.
@animehart animehart requested a review from JordanSh February 3, 2026 21:56
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #44 / Endpoint plugin @ess @serverless @skipInServerlessMKI When attempting to call an endpoint api "before all" hook in "@ess @serverless @skipInServerlessMKI When attempting to call an endpoint api"

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/siem-readiness 64 65 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 10.8MB 10.8MB +176.0B
Unknown metric groups

API count

id before after diff
@kbn/siem-readiness 64 65 +1

History

@animehart animehart merged commit 3da3938 into elastic:main Feb 4, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Cloud Security Cloud Security team related v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Coverage Tab All rules section

4 participants