Skip to content

[Attack Discovery][Scheduling] UI: Implement "Attack Discovery Scheduling" rule creation flow (#12006)#216087

Merged
e40pud merged 6 commits intoelastic:mainfrom
e40pud:security/genai/ad-schedule/12006-schedule-edit-form
Mar 27, 2025
Merged

[Attack Discovery][Scheduling] UI: Implement "Attack Discovery Scheduling" rule creation flow (#12006)#216087
e40pud merged 6 commits intoelastic:mainfrom
e40pud:security/genai/ad-schedule/12006-schedule-edit-form

Conversation

@e40pud
Copy link
Contributor

@e40pud e40pud commented Mar 26, 2025

Summary

Main ticket (internal link)
Filgma link: (internal link)

With these changes we add create attack discovery schedule flyout.

Recording

Screen.Recording.2025-03-26.at.17.29.55.mov

NOTES

The feature is hidden behind the feature flag:

xpack.securitySolution.enableExperimental: ['assistantAttackDiscoverySchedulingEnabled']

There is no logic to create actual schedule yet. This will be connected once https://github.com/elastic/security-team/issues/12003 is done.

For now to see the data returned from the flyout which we gonna use to create schedule later, you can add console log in x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/settings_flyout/schedule/hooks/use_edit_form.tsx file within the handleFormSubmit function to print the formData. The form data from the recording above looks like this:

{
  "name": "Schedule 1",
  "connectorId": "gemini-1-5-pro",
  "alertsSelectionSettings": {
    "query": {
      "language": "kuery",
      "query": ""
    },
    "filters": [],
    "size": 350,
    "start": "now-7d",
    "end": "now"
  },
  "interval": "24h",
  "actions": [
    {
      "id": "bb9a46e0-46c1-42c7-b186-ddf3ea6fdf84",
      "actionTypeId": ".email",
      "group": "default",
      "params": {
        "message": "Rule {{context.rule.name}} generated {{state.signals_count}} alerts",
        "to": [
          "test@elastic.co"
        ],
        "subject": "Test email 1"
      },
      "frequency": {
        "notifyWhen": "onActiveAlert",
        "throttle": null,
        "summary": true
      },
      "uuid": "78f888f2-aff1-4d34-9ba5-683a6c0d2b5e"
    }
  ]
}

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

@e40pud e40pud added release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Security Generative AI Security Generative AI backport:version Backport to applied version labels v9.1.0 v8.19.0 labels Mar 26, 2025
@e40pud e40pud requested a review from andrew-goldstein March 26, 2025 16:45
@e40pud e40pud self-assigned this Mar 26, 2025
@e40pud e40pud requested review from a team as code owners March 26, 2025 16:45
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

Copy link
Contributor

@andrew-goldstein andrew-goldstein left a comment

Choose a reason for hiding this comment

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

Thank you @e40pud for the new scheduling rule creation flow! 🙏
✅ Desk tested locally
LGTM 🚀

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 7094 7104 +10

Async chunks

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

id before after diff
securitySolution 8.9MB 8.9MB +7.6KB

History

cc @e40pud

@e40pud e40pud merged commit ff5d682 into elastic:main Mar 27, 2025
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/14105001861

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 216087

Questions ?

Please refer to the Backport tool documentation

e40pud added a commit to e40pud/kibana that referenced this pull request Mar 27, 2025
…ling" rule creation flow (elastic#12006) (elastic#216087)

## Summary

Main ticket ([internal
link](elastic/security-team#12006))
Filgma link: ([internal
link](https://www.figma.com/design/1AEgYCsQjCsWxAKoErYfL3/9.1-%5BAttack-Discovery%5D-Scheduling-%26-notifications?node-id=3421-195207&t=Y9ejBkDCojHD95qw-4))

With these changes we add create attack discovery schedule flyout.

## Recording

https://github.com/user-attachments/assets/6a1226f2-c45d-4b79-a67d-0e10fac71060

## NOTES

The feature is hidden behind the feature flag:

> xpack.securitySolution.enableExperimental:
['assistantAttackDiscoverySchedulingEnabled']

There is no logic to create actual schedule yet. This will be connected
once elastic/security-team#12003 is done.

For now to see the data returned from the flyout which we gonna use to
create schedule later, you can add console log in
`x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/settings_flyout/schedule/hooks/use_edit_form.tsx`
file within the `handleFormSubmit` function to print the `formData`. The
form data from the recording above looks like this:

```json
{
  "name": "Schedule 1",
  "connectorId": "gemini-1-5-pro",
  "alertsSelectionSettings": {
    "query": {
      "language": "kuery",
      "query": ""
    },
    "filters": [],
    "size": 350,
    "start": "now-7d",
    "end": "now"
  },
  "interval": "24h",
  "actions": [
    {
      "id": "bb9a46e0-46c1-42c7-b186-ddf3ea6fdf84",
      "actionTypeId": ".email",
      "group": "default",
      "params": {
        "message": "Rule {{context.rule.name}} generated {{state.signals_count}} alerts",
        "to": [
          "test@elastic.co"
        ],
        "subject": "Test email 1"
      },
      "frequency": {
        "notifyWhen": "onActiveAlert",
        "throttle": null,
        "summary": true
      },
      "uuid": "78f888f2-aff1-4d34-9ba5-683a6c0d2b5e"
    }
  ]
}
```

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [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

(cherry picked from commit ff5d682)

# Conflicts:
#	x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/settings_flyout/alert_selection/alert_selection_query/index.tsx
@e40pud
Copy link
Contributor Author

e40pud commented Mar 27, 2025

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

e40pud added a commit that referenced this pull request Mar 27, 2025
…Scheduling" rule creation flow (#12006) (#216087) (#216146)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Attack Discovery][Scheduling] UI: Implement "Attack Discovery
Scheduling" rule creation flow (#12006)
(#216087)](#216087)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Ievgen
Sorokopud","email":"ievgen.sorokopud@elastic.co"},"sourceCommit":{"committedDate":"2025-03-27T11:03:34Z","message":"[Attack
Discovery][Scheduling] UI: Implement \"Attack Discovery Scheduling\"
rule creation flow (#12006) (#216087)\n\n## Summary\n\nMain ticket
([internal\nlink](https://github.com/elastic/security-team/issues/12006))\nFilgma
link:
([internal\nlink](https://www.figma.com/design/1AEgYCsQjCsWxAKoErYfL3/9.1-%5BAttack-Discovery%5D-Scheduling-%26-notifications?node-id=3421-195207&t=Y9ejBkDCojHD95qw-4))\n\nWith
these changes we add create attack discovery schedule flyout.\n\n##
Recording\n\n\nhttps://github.com/user-attachments/assets/6a1226f2-c45d-4b79-a67d-0e10fac71060\n\n##
NOTES\n\nThe feature is hidden behind the feature flag:\n\n>
xpack.securitySolution.enableExperimental:\n['assistantAttackDiscoverySchedulingEnabled']\n\nThere
is no logic to create actual schedule yet. This will be connected\nonce
elastic/security-team#12003 is done.\n\nFor
now to see the data returned from the flyout which we gonna use
to\ncreate schedule later, you can add console log
in\n`x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/settings_flyout/schedule/hooks/use_edit_form.tsx`\nfile
within the `handleFormSubmit` function to print the `formData`.
The\nform data from the recording above looks like this:\n\n```json\n{\n
\"name\": \"Schedule 1\",\n \"connectorId\": \"gemini-1-5-pro\",\n
\"alertsSelectionSettings\": {\n \"query\": {\n \"language\":
\"kuery\",\n \"query\": \"\"\n },\n \"filters\": [],\n \"size\": 350,\n
\"start\": \"now-7d\",\n \"end\": \"now\"\n },\n \"interval\":
\"24h\",\n \"actions\": [\n {\n \"id\":
\"bb9a46e0-46c1-42c7-b186-ddf3ea6fdf84\",\n \"actionTypeId\":
\".email\",\n \"group\": \"default\",\n \"params\": {\n \"message\":
\"Rule {{context.rule.name}} generated {{state.signals_count}}
alerts\",\n \"to\": [\n \"test@elastic.co\"\n ],\n \"subject\": \"Test
email 1\"\n },\n \"frequency\": {\n \"notifyWhen\": \"onActiveAlert\",\n
\"throttle\": null,\n \"summary\": true\n },\n \"uuid\":
\"78f888f2-aff1-4d34-9ba5-683a6c0d2b5e\"\n }\n ]\n}\n```\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"ff5d68224488da40015a9eb9f76e2c5e4a5beea0","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:
SecuritySolution","Team:Security Generative
AI","backport:version","v9.1.0","v8.19.0"],"title":"[Attack
Discovery][Scheduling] UI: Implement \"Attack Discovery Scheduling\"
rule creation flow
(#12006)","number":216087,"url":"https://github.com/elastic/kibana/pull/216087","mergeCommit":{"message":"[Attack
Discovery][Scheduling] UI: Implement \"Attack Discovery Scheduling\"
rule creation flow (#12006) (#216087)\n\n## Summary\n\nMain ticket
([internal\nlink](https://github.com/elastic/security-team/issues/12006))\nFilgma
link:
([internal\nlink](https://www.figma.com/design/1AEgYCsQjCsWxAKoErYfL3/9.1-%5BAttack-Discovery%5D-Scheduling-%26-notifications?node-id=3421-195207&t=Y9ejBkDCojHD95qw-4))\n\nWith
these changes we add create attack discovery schedule flyout.\n\n##
Recording\n\n\nhttps://github.com/user-attachments/assets/6a1226f2-c45d-4b79-a67d-0e10fac71060\n\n##
NOTES\n\nThe feature is hidden behind the feature flag:\n\n>
xpack.securitySolution.enableExperimental:\n['assistantAttackDiscoverySchedulingEnabled']\n\nThere
is no logic to create actual schedule yet. This will be connected\nonce
elastic/security-team#12003 is done.\n\nFor
now to see the data returned from the flyout which we gonna use
to\ncreate schedule later, you can add console log
in\n`x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/settings_flyout/schedule/hooks/use_edit_form.tsx`\nfile
within the `handleFormSubmit` function to print the `formData`.
The\nform data from the recording above looks like this:\n\n```json\n{\n
\"name\": \"Schedule 1\",\n \"connectorId\": \"gemini-1-5-pro\",\n
\"alertsSelectionSettings\": {\n \"query\": {\n \"language\":
\"kuery\",\n \"query\": \"\"\n },\n \"filters\": [],\n \"size\": 350,\n
\"start\": \"now-7d\",\n \"end\": \"now\"\n },\n \"interval\":
\"24h\",\n \"actions\": [\n {\n \"id\":
\"bb9a46e0-46c1-42c7-b186-ddf3ea6fdf84\",\n \"actionTypeId\":
\".email\",\n \"group\": \"default\",\n \"params\": {\n \"message\":
\"Rule {{context.rule.name}} generated {{state.signals_count}}
alerts\",\n \"to\": [\n \"test@elastic.co\"\n ],\n \"subject\": \"Test
email 1\"\n },\n \"frequency\": {\n \"notifyWhen\": \"onActiveAlert\",\n
\"throttle\": null,\n \"summary\": true\n },\n \"uuid\":
\"78f888f2-aff1-4d34-9ba5-683a6c0d2b5e\"\n }\n ]\n}\n```\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"ff5d68224488da40015a9eb9f76e2c5e4a5beea0"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/216087","number":216087,"mergeCommit":{"message":"[Attack
Discovery][Scheduling] UI: Implement \"Attack Discovery Scheduling\"
rule creation flow (#12006) (#216087)\n\n## Summary\n\nMain ticket
([internal\nlink](https://github.com/elastic/security-team/issues/12006))\nFilgma
link:
([internal\nlink](https://www.figma.com/design/1AEgYCsQjCsWxAKoErYfL3/9.1-%5BAttack-Discovery%5D-Scheduling-%26-notifications?node-id=3421-195207&t=Y9ejBkDCojHD95qw-4))\n\nWith
these changes we add create attack discovery schedule flyout.\n\n##
Recording\n\n\nhttps://github.com/user-attachments/assets/6a1226f2-c45d-4b79-a67d-0e10fac71060\n\n##
NOTES\n\nThe feature is hidden behind the feature flag:\n\n>
xpack.securitySolution.enableExperimental:\n['assistantAttackDiscoverySchedulingEnabled']\n\nThere
is no logic to create actual schedule yet. This will be connected\nonce
elastic/security-team#12003 is done.\n\nFor
now to see the data returned from the flyout which we gonna use
to\ncreate schedule later, you can add console log
in\n`x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/settings_flyout/schedule/hooks/use_edit_form.tsx`\nfile
within the `handleFormSubmit` function to print the `formData`.
The\nform data from the recording above looks like this:\n\n```json\n{\n
\"name\": \"Schedule 1\",\n \"connectorId\": \"gemini-1-5-pro\",\n
\"alertsSelectionSettings\": {\n \"query\": {\n \"language\":
\"kuery\",\n \"query\": \"\"\n },\n \"filters\": [],\n \"size\": 350,\n
\"start\": \"now-7d\",\n \"end\": \"now\"\n },\n \"interval\":
\"24h\",\n \"actions\": [\n {\n \"id\":
\"bb9a46e0-46c1-42c7-b186-ddf3ea6fdf84\",\n \"actionTypeId\":
\".email\",\n \"group\": \"default\",\n \"params\": {\n \"message\":
\"Rule {{context.rule.name}} generated {{state.signals_count}}
alerts\",\n \"to\": [\n \"test@elastic.co\"\n ],\n \"subject\": \"Test
email 1\"\n },\n \"frequency\": {\n \"notifyWhen\": \"onActiveAlert\",\n
\"throttle\": null,\n \"summary\": true\n },\n \"uuid\":
\"78f888f2-aff1-4d34-9ba5-683a6c0d2b5e\"\n }\n ]\n}\n```\n\n###
Checklist\n\nCheck the PR satisfies following conditions. \n\nReviewers
should verify this PR satisfies this list as well.\n\n- [x] Any text
added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common
scenarios","sha":"ff5d68224488da40015a9eb9f76e2c5e4a5beea0"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
cqliu1 pushed a commit to cqliu1/kibana that referenced this pull request Mar 31, 2025
…ling" rule creation flow (elastic#12006) (elastic#216087)

## Summary

Main ticket ([internal
link](elastic/security-team#12006))
Filgma link: ([internal
link](https://www.figma.com/design/1AEgYCsQjCsWxAKoErYfL3/9.1-%5BAttack-Discovery%5D-Scheduling-%26-notifications?node-id=3421-195207&t=Y9ejBkDCojHD95qw-4))

With these changes we add create attack discovery schedule flyout.

## Recording


https://github.com/user-attachments/assets/6a1226f2-c45d-4b79-a67d-0e10fac71060

## NOTES

The feature is hidden behind the feature flag:

> xpack.securitySolution.enableExperimental:
['assistantAttackDiscoverySchedulingEnabled']

There is no logic to create actual schedule yet. This will be connected
once elastic/security-team#12003 is done.

For now to see the data returned from the flyout which we gonna use to
create schedule later, you can add console log in
`x-pack/solutions/security/plugins/security_solution/public/attack_discovery/pages/settings_flyout/schedule/hooks/use_edit_form.tsx`
file within the `handleFormSubmit` function to print the `formData`. The
form data from the recording above looks like this:

```json
{
  "name": "Schedule 1",
  "connectorId": "gemini-1-5-pro",
  "alertsSelectionSettings": {
    "query": {
      "language": "kuery",
      "query": ""
    },
    "filters": [],
    "size": 350,
    "start": "now-7d",
    "end": "now"
  },
  "interval": "24h",
  "actions": [
    {
      "id": "bb9a46e0-46c1-42c7-b186-ddf3ea6fdf84",
      "actionTypeId": ".email",
      "group": "default",
      "params": {
        "message": "Rule {{context.rule.name}} generated {{state.signals_count}} alerts",
        "to": [
          "test@elastic.co"
        ],
        "subject": "Test email 1"
      },
      "frequency": {
        "notifyWhen": "onActiveAlert",
        "throttle": null,
        "summary": true
      },
      "uuid": "78f888f2-aff1-4d34-9ba5-683a6c0d2b5e"
    }
  ]
}
```

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:Security Generative AI Security Generative AI Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants