-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Security Solution][Endpoint] Add API checks to Endpoint Policy create/update for checking endpointPolicyProtections
is enabled
#163429
Merged
paul-tavares
merged 27 commits into
elastic:main
from
paul-tavares:task/olm-7232-api-policy-watcher-for-serverless-policy-protections
Aug 11, 2023
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
eb66569
changes for default policy
paul-tavares 6b199d2
add `appFeatures` to endpoint server side services and pass it down t…
paul-tavares cb8b985
add `disableAllPolicyProtections()` and use it in policy create
paul-tavares de9151c
refactor: use existing helpers to turn off protections
paul-tavares b397446
add test for `setPolicyToEventCollectionOnly()`
paul-tavares ae96184
fix test
paul-tavares b6f6e62
add call to `setPolicyToEventCollectionOnly()` to the policy update a…
paul-tavares d1e50cb
implementation of `isPolicySetToEventCollectionOnly()` + tests (not p…
paul-tavares 96996b6
Fix logic for `isPolicySetToEventCollectionOnly()` + add tests
paul-tavares aeeaa16
use `AppFeatureSecurityKey` enum
paul-tavares 3eabe35
utility to create internal SO client
paul-tavares f0cbc1c
Add migration step to the Plugin that will check if protections shoul…
paul-tavares 5867b74
Logic to update policies that have protections enabled
paul-tavares 26700a1
Fix endpoint context mock + tests for fleet integrations
paul-tavares e11b7ef
Centralized mock for AppFeatures
paul-tavares 117bc6b
Tests for `createDefaultPolicy()` and use of appFeatures to adjust po…
paul-tavares 784764d
Tests for Update integration policy fleet api extension
paul-tavares 213d13e
Added utility type: `PromiseResolvedValue<>`
paul-tavares 9c7b859
initial test for `turnOffPolicyProtections()`
paul-tavares d263339
tests for `turnOffPolicyProtections()`
paul-tavares ba7a4c8
fix AppFeatures mock
paul-tavares 717054b
Merge branch 'main' into task/olm-7232-api-policy-watcher-for-serverl…
paul-tavares eff88cf
Merge branch 'main' into task/olm-7232-api-policy-watcher-for-serverl…
paul-tavares 8fa8ec4
code review updates
paul-tavares 8658745
Merge remote-tracking branch 'origin/task/olm-7232-api-policy-watcher…
paul-tavares f08dbb6
Adjust looping logic for adjust policies
paul-tavares abc633e
Merge remote-tracking branch 'upstream/main' into task/olm-7232-api-p…
paul-tavares File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
x-pack/plugins/security_solution/common/endpoint/types/utility_types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
|
||
export type PromiseResolvedValue<T extends Promise<any>> = T extends Promise<infer Value> | ||
? Value | ||
: never; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
q: do we want to maybe return all protections that are enabled, instead of the first one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, but I was trying to just exit the function as soon as possible rather than to loop through all of them.