Repository navigation
Show prebuilt detection rules as one filterable table - #4922
nastasha-solomon wants to merge 3 commits into
Conversation
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>
How I checked that this doesn't break the rules page generationThe 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'tThe generation has four steps: the site build checks out detection-rules Tests and CI
A real build, compared with
|
| 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|QLshows 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.
|
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 findingsThe 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
The prebuilt rules page today, as a filterable table, as a listing, and as cards
The table and the cards with the same two filters on
The 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
The cards prototype and the tags exist only in a local build. Neither has been tested with readers. |
Prebuilt rules page: filter design findingsThe 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
The prebuilt rules page today, as a filterable table, as a listing, as cards, and with column menus
The table and the cards with the same two filters on
The 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.
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"
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.
Search suggestionsAs readers type in the search box, a list under it offers two kinds of suggestions.
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
The same table with two filters on, showing a count on the Filters button, then a tag for each filter
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. |







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 tomain. 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:
The new table
mainDomain:tag. A rule without one shows as "Unspecified", as it does today.severity, capitalizedtype, shown with the names readers know: Custom query, EQL, ES|QL, Indicator match, Machine learning, New terms, and ThresholdOS:tagsTactic:tagsRows 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.
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:
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:Size and speed
What it doesn't do
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:
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
mainthe 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.ToMarkdownwrites 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.GetMarkdownkeeps 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.(!url)form the page uses today.TagValuesreads tags shaped likePrefix: Value, in tag order, without duplicates.ES|QLlabel stays in one cell.Tests
DetectionRuleOverviewTableTestsbuilds rules from TOML and checks the directive options, the header row, the sort order, the labels, the escapedES|QL, the joined OS and tactic tags, and the "Unspecified" domain.Verified with a real build
I built the detection-rules docset (its
mainat c678d34ed:docs/,rules/,rules_building_block/, andversion.lock.json) with this branch and withmain, both with--strict --path-prefix reference/security/prebuilt-rules --exporters html:main4.2 s.main's list.ES\|QLrenders as one cell in all 381 ES|QL rows. The four rules without a domain tag show "Unspecified", as they do today.<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.main's apart from the stylesheet and script hashes.--exporters htmlis there because an isolated build of this docset with all exporters fails onmaintoo, before this PR: the "view as Markdown" exporter writes each rule's.mdcopy 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