Skip to content

Comments

[8.18] [Security Solution] Fix context.results_link passed from detection rules to rule actions (#236067)#236530

Merged
kibanamachine merged 1 commit intoelastic:8.18from
kibanamachine:backport/8.18/pr-236067
Sep 26, 2025
Merged

[8.18] [Security Solution] Fix context.results_link passed from detection rules to rule actions (#236067)#236530
kibanamachine merged 1 commit intoelastic:8.18from
kibanamachine:backport/8.18/pr-236067

Conversation

@kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.18:

Questions ?

Please refer to the Backport tool documentation

…rules to rule actions (elastic#236067)

**Partially addresses:** elastic#232557

## Summary

This PR fixes the value of the `results_link` variable we pass at the
end of a detection rule execution to its rule actions via the `context`
object. This variable then can be used from actions via
`{{context.results_link}}` template placeholder.

We used to construct the `results_link` like this:
`<base-url>/app/security/detections/rules/id/<rule-id>?timerange=<...>`.
Which used to be the correct URL to the Rule Details page.

However, the URL structure of detections pages had been changed a long
time ago, and now we have this:
`<base-url>/app/security/detections/rules/id/<rule-id>`. We had URL
redirects from `/app/security/detections/rules/id/<rule-id>` to
`/app/security/detections/rules/id/<rule-id>`, but they were broken by
elastic#217890. Some of them have been
fixed since then, so now the redirects work as expected in some versions
of Kibana, and in some of them they are still broken. See
elastic#232557 (comment)
for details.

This PR adjusts the `results_link` according to the up to date URL
structure.

## Release Notes

Fixes the URL passed to detection rule actions via the
`{{context.results_link}}` placeholder.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
    - No need for that as the only affected tests are unit tests
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

(cherry picked from commit bb6c8c1)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Sep 26, 2025
@kibanamachine kibanamachine enabled auto-merge (squash) September 26, 2025 03:32
@kibanamachine kibanamachine merged commit 84ae24a into elastic:8.18 Sep 26, 2025
11 checks passed
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

cc @banderror

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants