Skip to content

Show prebuilt detection rules as one filterable table - #4922

Open
nastasha-solomon wants to merge 3 commits into
filterable-table-column-controlfrom
prebuilt-rules-filterable-table
Open

nastasha-solomon wants to merge 3 commits into
filterable-table-column-controlfrom
prebuilt-rules-filterable-table

Conversation

@nastasha-solomon

@nastasha-solomon nastasha-solomon commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Closes #4921

Note

This PR is stacked on #4915, which adds :filter-columns:, and its base branch is #4915's branch. After #4915 merges, change the base to main. The table also uses :pin-first-column: from #4918. docs-builder ignores table options it doesn't know yet, so this PR doesn't have to wait for #4918. The column starts pinning once #4918 merges.

Summary

The prebuilt detection rules reference becomes one table that readers can search and filter. Instead of about 2,200 links under 11 domain headings, the page lists every rule with its domain, severity, rule type, operating system, and MITRE ATT&CK® tactics. Readers can search by name and narrow the list with a dropdown for each of those five columns.

The page is still generated from the rule files in elastic/detection-rules, so that repository doesn't change, and new rules appear in the table automatically.

The problem

Today the page is a long list of links grouped only by domain. Readers can't narrow it by severity, rule type, OS, or tactic, and they can't see any of those details without opening each rule:

0-rules-before

The new table

Column Comes from Values on detection-rules main
Rule The rule name, linked to its page 2,361 rules
Domain The Domain: tag. A rule without one shows as "Unspecified", as it does today. 11
Severity severity, capitalized 4
Rule type type, shown with the names readers know: Custom query, EQL, ES|QL, Indicator match, Machine learning, New terms, and Threshold 7
OS The OS: tags 3
Tactic The Tactic: tags 14
1-rules-table

Rows are sorted by rule name. A rule with several OS or tactic tags lists them all in one cell, and the dropdowns match any of them. A sentence above the table tells readers they can search and filter.

Search for "okta" Credential Access + Windows + High
2-rules-search-okta 3-rules-filtered

With #4920, the dropdowns start collapsed behind a Filters button, so readers see the table first. With the panel closed, the button still counts the filters that are on:

3b-rules-filters-collapsed-with-count

This recording searches for "aws", opens Filters, narrows the list to high-severity Credential Access rules, closes the panel, and selects Clear:

4-rules-demo.webm

Wide tables and the pinned Rule column

Six columns are about 270 px wider than the content area at a 1280 px window, so the OS and Tactic columns need sideways scrolling. With :pin-first-column: from #4918, the Rule column stays in view while readers scroll:

Not pinned, scrolled right Pinned, scrolled right
5-pinned-rule-column-scrolled-right rules-not-pinned-scrolled-right

Size and speed

  • Page size: the HTML grows from 2.43 MB to 2.64 MB, about 9%. The link lists it replaces were about 420 KB, and the table is about 640 KB.
  • Filtering: one pass over all 2,361 rows takes under 2 ms in the browser, so typing in the search box stays instant.

What it doesn't do

  • It doesn't change the deprecated rules page, which is generated the same way. It could get the same table in a follow-up.
  • It doesn't change any rule tags. The dropdowns show the tags exactly as the rule files have them.

Try it

The detection rules docs aren't part of docs-builder's own docs, so this PR's docs preview doesn't include the page. To build it locally with this branch:

dotnet run --project src/tooling/docs-builder -- serve --path ../detection-rules/docs

Then open http://localhost:3000.

How the screenshots were made

The screenshots use the live prebuilt rules page, with its real styles. A script built the table from the rule files on detection-rules main the same way the generator does, replaced the page's link lists with it, and loaded the filter code and controls from #4920 and the pinned-column styles from #4918. They show the page as it will look once all three land. On #4915 alone, the dropdowns sit directly above the table instead of behind the Filters button, and the Rule column scrolls with the rest.

Technical details for reviewers

Generator

  • DetectionRuleOverviewTable.ToMarkdown writes the table as Markdown: a {table} directive with :filterable:, :filter-columns: Domain, Severity, Rule type, OS, Tactic, and :pin-first-column:, then one row per rule.
  • DetectionRuleOverviewFile.GetMarkdown keeps the page's title and its machine learning note, adds a sentence about searching and filtering, and replaces the per-domain headings and link lists with the table.
  • Rule names link with the same (!url) form the page uses today.
  • TagValues reads tags shaped like Prefix: Value, in tag order, without duplicates.
  • A pipe in any cell is escaped, so the ES|QL label stays in one cell.

Tests

dotnet test tests/Elastic.Markdown.Tests/ --filter "FullyQualifiedName~DetectionRuleOverviewTable"

DetectionRuleOverviewTableTests builds rules from TOML and checks the directive options, the header row, the sort order, the labels, the escaped ES|QL, the joined OS and tactic tags, and the "Unspecified" domain.

Verified with a real build

I built the detection-rules docset (its main at c678d34ed: docs/, rules/, rules_building_block/, and version.lock.json) with this branch and with main, both with --strict --path-prefix reference/security/prebuilt-rules --exporters html:

  • Both builds: 2,534 pages, 0 errors, 0 warnings, 0 hints. This branch took 4.6 s, main 4.2 s.
  • The overview page has 2,361 rows, every row has 6 cells, and all 2,361 links are unique and resolve to pages the build wrote. The set of linked rules is identical to main's list.
  • ES\|QL renders as one cell in all 381 ES|QL rows. The four rules without a domain tag show "Unspecified", as they do today.
  • The directive renders <filterable-table data-facet-columns="1,2,3,4,5">. :pin-first-column: is ignored until Add a :pin-first-column: option to the table directive #4918 merges, with no diagnostic.
  • The other 2,533 pages, including the deprecated rules page, are identical to main's apart from the stylesheet and script hashes.

--exporters html is there because an isolated build of this docset with all exporters fails on main too, before this PR: the "view as Markdown" exporter writes each rule's .md copy to ../rules/… relative to the output folder, and the scoped file system refuses that path. That's an existing issue with the per-rule pages, which this PR doesn't touch; see #4923.

🤖 Generated with Claude Code

nastasha-solomon and others added 2 commits November 17, 2026 20:31
The overview listed about 2,000 rule links under per-domain headings, with
no way to narrow them. It now renders one filterable table with Rule,
Domain, Severity, Rule type, OS, and Tactic columns, and uses
:filter-columns: to offer dropdowns for every column except Rule.

Domain and Tactic each have more than 12 values, so they need
:filter-columns: rather than the automatic choice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nastasha-solomon

Copy link
Copy Markdown
Member Author

This PR is part of a group of related table improvements:

PR Issue What it adds Base
#4915 #4914 :filterable: search, :filter-columns:, the inset dropdown arrow main
#4918 #4917 :pin-first-column: main
#4920 #4919 Easier filter controls #4915
#4922 #4921 Filterable prebuilt rules table #4915

@nastasha-solomon nastasha-solomon self-assigned this Nov 18, 2026
@nastasha-solomon
nastasha-solomon marked this pull request as ready for review November 18, 2026 02:07
@nastasha-solomon
nastasha-solomon requested a review from a team as a code owner November 18, 2026 02:07
@nastasha-solomon

Copy link
Copy Markdown
Member Author

How I checked that this doesn't break the rules page generation

The prebuilt rules reference isn't written by hand. docs-builder generates it from the rule files in elastic/detection-rules every time the site is built, so I checked that the process still works end to end with this change.

What this PR touches, and what it doesn't

The generation has four steps: the site build checks out detection-rules main, docs-builder reads every rule's .toml file and writes a page for each rule, it builds the navigation from those files, and it writes the overview page's content. This PR changes only the last step. It doesn't touch how rule files are read, how rule pages are written, the navigation, the deprecated rules page, or the version information that each rule page shows.

Tests and CI

  • The PR's CI is green, including the C# tests on macOS, Ubuntu, and Windows.
  • The new unit tests build rules from TOML and check the table's options, columns, sort order, labels, and escaping.

A real build, compared with main

CI doesn't build the detection-rules docset, so I built it myself: detection-rules main as of today (2,494 rule files, including 133 deprecated ones), built with docs-builder from this branch and again from main, both in strict mode and with the site's path prefix.

This branch main
Pages written 2,534 2,534
Errors, warnings, and hints 0 0
Build time 4.6 s 4.2 s
Rules linked from the overview page 2,361 2,361, the same set

On the overview page itself:

  • Every one of the 2,361 rows has all six cells, every link is unique, and every link points to a page the build wrote.
  • ES|QL shows as one cell in all 381 rows that use it. The four rules without a domain tag show "Unspecified", as they do today.
  • The table carries the five chosen filter columns. :pin-first-column: is ignored until Add a :pin-first-column: option to the table directive #4918 merges, with no warning.

The other 2,533 pages, including the deprecated rules page, are identical between the two builds apart from the stylesheet and script hashes.

Links from other docs

I searched docs-content, Kibana, Elasticsearch, integration-docs, and detection-rules for links to this page. Every link points to the page itself, and none points to one of the domain headings that the table replaces, so no link breaks.

What changes for readers

  • The "On this page" list in the right rail goes away, because the page no longer has headings. The Domain dropdown replaces it.
  • A bookmarked link to a domain heading, such as prebuilt-rules#endpoint, lands at the top of the page.
  • The page's HTML grows from 474 KB to 722 KB.

One thing the build turned up, unrelated to this PR

A standalone docs-builder build of this docset with all exporters fails on main too, before this PR. The "view as Markdown" exporter writes each rule's .md copy to ../rules/… relative to the output folder, and when that path falls outside the build's allowed folders, the write is refused. The live site is unaffected: the assembler build takes a different path and serves the .md copies correctly. The builds above used --exporters html to get past it. It's filed as #4923.

@nastasha-solomon

Copy link
Copy Markdown
Member Author

Hey, @reakaleek and @Mpdreamz - I locally tested a few combinations of the filterable table elements and the listing component. I wanted to see how they'd visually fit together and if this combo broke/affected the process for auto-generating the prebuilt rule docs (including the list that appears on this page). Here are my findings (as summarized by claude ofc):

Prebuilt rules page: Filter design findings

The prebuilt rules reference lists 2,361 rules as plain links, grouped by domain. Readers can't narrow the list by severity, rule type, OS, or tactic. Claude compared three ways to fix that, each built locally from the real detection-rules content with a strict docs-builder build, and then looked at how readers set and track filters.

Page layouts compared

Filterable table (#4922) {listing} directive Cards with filters (prototype)
What readers see One row per rule, with the rule name pinned while the table scrolls sideways One card per page, with the title only One card per rule, with its name, the first sentence of its description, and its attributes
What's listed The 2,361 active rules 2,530 items, including 133 deprecated rules and non-rule pages The 2,361 active rules
Search covers Every column Titles only Names, descriptions, and attributes
Narrowing Domain, Severity, Rule type, OS, and Tactic dropdowns 4 chips, one per docset section The same 5 dropdowns as the table
Page size (today: 474 KB) 722 KB 2.26 MB 1.04 MB, with 50 cards shown at a time
docs-builder work needed None beyond the open PRs Three changes, and readers could still narrow by only one attribute A card option for the filter component, design-system styles, and tests

The prebuilt rules page today, as a filterable table, as a listing, and as cards

compare-layouts

The table and the cards with the same two filters on

compare-filtered

The listing: table of contents entry doesn't work for this page at all. Using it would mean changing elastic/detection-rules, and even then the build couldn't read the rule files, the .toml files have nothing to group by, and the deprecated rules page would go away.

The cards prototype keeps the table in the page as its data, and the filter component draws a card for each row. One filter engine drives both layouts. Without JavaScript, readers get the full table.

Recommendations

  1. Ship the filterable table: Merge #4915, #4918, #4920, and #4922.
  2. Add active filter tags to Make filterable table controls easier to use #4920: Show each active filter as a removable tag under the search box, such as "Severity: High ✕", followed by Clear. Today the Filters button shows only how many filters are on. The tags show which ones, and let readers remove one without resetting the rest. They'd replace the count on the button, and every filterable table would get them.
compare-tracking
  1. Keep one way to filter: Claude tried Domain as a row of chips above the cards and dropped them, because they duplicate the Domain dropdown and give readers two controls for one filter. Filters in column titles have the same problem, and more. They don't work for cards, which have no column titles. On a wide table they scroll out of view with their column. Each one needs a small menu button, which is hard to use on phones and with a keyboard or screen reader. Readers also expect a click on a column title to sort the table. If the goal is to tie each filter to its column, a lighter option is a small filter icon on the title of any column that's currently filtered.
  2. Treat cards as a follow-up: Consider cards if readers need rule descriptions on the overview page. The prototype shows they can reuse the same filter engine.

The cards prototype and the tags exist only in a local build. Neither has been tested with readers.

@nastasha-solomon

nastasha-solomon commented Nov 18, 2026 •

Copy link
Copy Markdown
Member Author

Prebuilt rules page: filter design findings

The prebuilt rules reference lists 2,361 rules as plain links, grouped by domain. Readers can't narrow the list by severity, rule type, OS, or tactic. Claude compared four ways to fix that, each built locally from the real detection-rules content with a strict docs-builder build, and then looked at how readers set, track, and sort filters.

Page layouts compared

Filterable table (#4922) {listing} directive Cards with filters (prototype) Column menus with sorting/filtering (prototype)
What readers see One row per rule, with the rule name pinned while the table scrolls sideways One card per page, with the title only One card per rule, with its name, the first sentence of its description, and its attributes The same table, where a button beside each column title opens a menu to sort and filter that column
What's listed The 2,361 active rules 2,530 items, including 133 deprecated rules and non-rule pages The 2,361 active rules The 2,361 active rules
Search covers Every column Titles only Names, descriptions, and attributes Every column, with suggested filter values and rule names as readers type
Narrowing Domain, Severity, Rule type, OS, and Tactic dropdowns, one value each 4 chips, one per docset section The same 5 dropdowns as the table A checklist of values in each column's menu, with several values allowed per column
Sorting None None None A to Z, Z to A, and highest or lowest severity first
Page size (today: 474 KB) 722 KB 2.26 MB 1.04 MB, with 50 cards shown at a time 722 KB
docs-builder work needed None beyond the open PRs Three changes, and readers could still narrow by only one attribute A card option for the filter component, design-system styles, and tests A column-menu option, sorting, and suggestions for the filter component, plus design-system styles and tests

The prebuilt rules page today, as a filterable table, as a listing, as cards, and with column menus

compare-layouts

The table and the cards with the same two filters on

compare-filtered

The listing: table of contents entry doesn't work for this page at all. Using it would mean changing elastic/detection-rules, and even then the build couldn't read the rule files, the .toml files have nothing to group by, and the deprecated rules page would go away.

The cards prototype keeps the table in the page as its data, and the filter component draws a card for each row. One filter engine drives both layouts. Without JavaScript, readers get the full table.

Column menus

@reakaleek suggested filtering from the column titles, similar to Google Sheets. The prototype gives each column title one button, which opens a menu with two parts.

  • Sort options at the top: Sort A to Z and Sort Z to A. Severity sorts by importance instead, with Sort highest first and Sort lowest first. The sorted column shows an arrow beside its title.
  • Filter by values below them: A checklist of the column's values, each with its rule count. Readers can check several values, such as Critical and High, and see rules that match any of them. The Tactic menu also has a search box, because its list is long.

Sheets' filter-by-condition and filter-by-color options were left out. The search box already covers finding text, and docs tables don't use color to carry meaning.

Putting sorting in the menu means a click on a column title doesn't have to choose between sorting and filtering. Above the table, the search box and the active filter tags stay, so readers can see every filter at once, including ones set in columns that are off-screen.

The Severity menu with Critical and High checked, and search suggestions for "windows"

compare-column-menus

The rules table doesn't fit its page, which limits column menus there. The page's content column stops growing at 728 px, and the table is 868 px wide. The following table shows which columns fit at each screen width.

Screen width Columns fully in view
375 (phone) Rule and Domain
768 (tablet) Rule and Domain
1280 (laptop) Rule through Rule type, with OS half visible
1440 and wider Rule through OS
  • The Tactic button is off-screen at every width: Readers have to scroll the table sideways to reach it.
  • The table needs its own scroll area: A title row can only stay in view inside a table that scrolls sideways if the table also scrolls up and down inside its own box. The page then has two scrolling areas.
  • The pinned Rule column covers filter buttons on phones: It takes up most of the screen's width.

Search suggestions

As readers type in the search box, a list under it offers two kinds of suggestions.

  • Filter values: Typing "cred" offers "Tactic: Credential Access" with its rule count. Choosing it applies that filter, the same as the column menu would. This lets readers filter without knowing which column holds a value. It's also more precise than text search, which matches "windows" anywhere in a row, including rule names.
  • Rule names: Choosing a name opens that rule's page.

Suggestions only come from rules that the active filters leave, so every count matches what readers get. The list follows the standard combobox pattern for keyboard and screen reader users. The suggestions don't depend on where the filters live, so every filterable table could have them.

Recommendations

  1. Ship the filterable table: Merge #4915, #4918, #4920, and #4922.
  2. Add active filter tags to Make filterable table controls easier to use #4920: Show each active filter as a removable tag under the search box, such as "Severity: High ✕", followed by Clear. Today the Filters button shows only how many filters are on. The tags show which ones, and let readers remove one without resetting the rest. They'd replace the count on the button, and every filterable table would get them.

The same table with two filters on, showing a count on the Filters button, then a tag for each filter

compare-tracking
  1. Add search suggestions for every filterable table: They work whether the filters sit above the table or in its column titles.

  2. Keep one way to filter on each table: Claude tried Domain as a row of chips above the cards and dropped them, because they duplicate the Domain dropdown and give readers two controls for one filter. For the same reason, a table shouldn't have filters both above it and in its column titles.

  3. Let writers choose where the filters go: Add a {table} option for column menus, and have the build reject a table that asks for both placements. Each placement suits different tables:

    • Above the table: Wide tables, where columns that scroll off-screen would hide their filters, and pages that might later switch to cards, which have no column titles.
    • In column menus: Tables where readers also need to sort, and narrow tables where every column fits on screen.

    Both placements use the same filter engine, so search, suggestions, the count, Clear, and the active filter tags work the same way. Column menus would be new to the docs, so pages that use them need a sentence telling readers they're there. For the rules page, docs eng can try both placements in the local previews before choosing. The layout limits above are the main trade-off.

  4. Add sorting through column menus: The prototype answers the open sorting questions. Severity sorts by importance, a cell that lists several values sorts by its first one, and tables grouped under section headings don't offer sorting. Tables that keep their filters above the table would need a separate Sort by control.

  5. Treat cards as a follow-up: Consider cards if readers need rule descriptions on the overview page. The prototype shows they can reuse the same filter engine.

The cards, column menu, tag, and suggestion prototypes exist only in local builds. None of them has been tested with readers. docs-builder has no sorting, column menus, or search suggestions today.

This branch was successfully deployed

1 active deployment
assembler-preview — 8adf5784 Deployed Nov 29, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant