Skip to content

[Security Solution][Endpoint] Update background tasks for automated response actions and completing 3rd party EDR actions to support spaces#219978

Merged
paul-tavares merged 16 commits intoelastic:mainfrom
paul-tavares:task/olm-12313-update-3rd-party-edr-action-complete-task-to-support-spaces
May 8, 2025
Merged

[Security Solution][Endpoint] Update background tasks for automated response actions and completing 3rd party EDR actions to support spaces#219978
paul-tavares merged 16 commits intoelastic:mainfrom
paul-tavares:task/olm-12313-update-3rd-party-edr-action-complete-task-to-support-spaces

Conversation

@paul-tavares
Copy link
Contributor

@paul-tavares paul-tavares commented May 2, 2025

Summary

The following changes were done in support of Endpoint space awareness:

  • The background task that checks and completes pending 3rd party response actions was updated to ensure that action are completed using a response actions client scoped to the space that the response action was created from.
  • The automated response actions process was updated to use the alert's space ID when retrieving a response action client

Important

When the space awareness feature flag is enabled, the completion of 3rd party response action created from a space other than default will fail and response actions for those agents will remain in Pending state until this bug in the Stack Connectors is addressed: #219975

Testing space awareness setup

Enable feature flags

xpack.securitySolution.enableExperimental:
  - endpointManagementSpaceAwarenessEnabled

xpack.fleet.enableExperimental:
  - useSpaceAwareness

Switch Fleet to Space aware

POST /internal/fleet/enable_space_awareness
Elastic-Api-Version: 1,

Ensure that a 9.1.0x endpoint package is installed

Space awareness needs to have the latest 9.1 package installed in fleet. Ensure that is the case prior to creating policies by going to the integrations page, enabling Display beta integrations and then clicking on Elastic Defend and installing the latest 9.1 pre-release package version.

Add data

You should now be all setup to load data for testing. Remember that space data visibility is mostly driven by Fleet and how Policies are setup and shared between spaces - Agent Policies now have a Space ID field to manage this.

Our scripts that run live VMs for each type o9f EDR have been updated to support a --spaceId CLI argument and thus can be used to target specific spaces.

Checklist

@paul-tavares paul-tavares added release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v9.1.0 labels May 2, 2025
@paul-tavares paul-tavares self-assigned this May 2, 2025
@paul-tavares paul-tavares changed the title [Security Solution][Endpoint] Update background task for completing 3rd party EDR response actions to support spaces [Security Solution][Endpoint] Update background tasks for automated response actions and completing 3rd party EDR actions to support spaces May 2, 2025
@paul-tavares
Copy link
Contributor Author

/ci

@paul-tavares
Copy link
Contributor Author

/ci

@paul-tavares
Copy link
Contributor Author

/ci

@paul-tavares paul-tavares marked this pull request as ready for review May 6, 2025 14:41
@paul-tavares paul-tavares requested a review from a team as a code owner May 6, 2025 14:41
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-defend-workflows (Team:Defend Workflows)

@paul-tavares paul-tavares removed the request for review from joeypoon May 6, 2025 14:41
@paul-tavares paul-tavares requested a review from ashokaditya May 6, 2025 14:41
@paul-tavares paul-tavares added the backport:skip This PR does not require backporting label May 6, 2025
Copy link
Contributor

@szwarckonrad szwarckonrad left a comment

Choose a reason for hiding this comment

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

Code LGTM - I didn't spot anything concerning. The changes make sense, but I'll defer to Ash's opinion since he has more exposure to response actions than I do.

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

cc @paul-tavares

Copy link
Member

@ashokaditya ashokaditya left a comment

Choose a reason for hiding this comment

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

Thanks for the updates and detailed comments everywhere!

});

it('should error is action id is not accessible in active space', async () => {
it('should error if action id is not accessible in active space', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for updating this. I think there are a couple more instances of should error is... in similar tests that you can also update.

@paul-tavares paul-tavares merged commit c511d2e into elastic:main May 8, 2025
9 checks passed
@paul-tavares paul-tavares deleted the task/olm-12313-update-3rd-party-edr-action-complete-task-to-support-spaces branch May 8, 2025 14:53
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
…esponse actions and completing 3rd party EDR actions to support spaces (elastic#219978)

## Summary

The following changes were done in support of Endpoint space awareness:

- The background task that checks and completes pending 3rd party
response actions was updated to ensure that action are completed using a
response actions client scoped to the space that the response action was
created from.
- The automated response actions process was updated to use the alert's
space ID when retrieving a response action client
qn895 pushed a commit to qn895/kibana that referenced this pull request Jun 3, 2025
…esponse actions and completing 3rd party EDR actions to support spaces (elastic#219978)

## Summary

The following changes were done in support of Endpoint space awareness:

- The background task that checks and completes pending 3rd party
response actions was updated to ensure that action are completed using a
response actions client scoped to the space that the response action was
created from.
- The automated response actions process was updated to use the alert's
space ID when retrieving a response action client
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:Defend Workflows “EDR Workflows” sub-team of Security Solution v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants