-
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] Allow wildcard in trusted app paths #97623
Merged
ashokaditya
merged 39 commits into
elastic:master
from
ashokaditya:sec-team-543/allow-wildcard-for-paths
Apr 29, 2021
Merged
Changes from 23 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
57bf657
show operator dropdown for path field
ashokaditya dd84507
update translation to use consistent values
ashokaditya 9f72250
update schema to validate path values
ashokaditya fa9e3ce
add tests for field and operator values
ashokaditya 8c19290
review changes
ashokaditya 1deab39
update schema to enforce dropdown validation for PATH field
ashokaditya baac452
add tests for schema updates
ashokaditya 5d9e848
optimise dropdown list for re-renders
ashokaditya 9badfcc
Merge branch 'master' into sec-team-543/allow-wildcard-for-paths
kibanamachine f657b80
align input fields and keep alignments when resized
ashokaditya 2ac56ee
correctly enter operator data on trusted app CRUD
ashokaditya c047025
update tests
ashokaditya 74d5193
remove redundant code
ashokaditya dbd0933
better type assertion
ashokaditya f6cd3a8
move operator options out of component
ashokaditya a6725b9
derive keys from operator entry field
ashokaditya 4def289
update type
ashokaditya 0a60598
use custom styles for aligning input fields
ashokaditya c3643f0
add a custom type for trusted_apps operator
ashokaditya f9cb7ed
add wildcard entry type
ashokaditya b3f5dc4
use the new entry type
ashokaditya 617aa7e
update tests
ashokaditya cc001e7
update name for wildcard type so that it can be used also for cased i…
ashokaditya f744808
Merge branch 'master' into sec-team-543/allow-wildcard-for-paths
kibanamachine 6a874c0
update artifacts to support wildcard entries
ashokaditya b2cf223
add tests for list schemas
ashokaditya 6f2d0d7
add placeholders for path values
ashokaditya 284352e
ignore type check for now
ashokaditya bcf615a
add type assertion
ashokaditya 835812f
remove unnecessary test
ashokaditya dbd3532
fix types
ashokaditya ddc3d72
add a note to entries
ashokaditya 0bf8199
remove redundant type assertions
ashokaditya 2dc4fd3
move placeholder text logic to utils
ashokaditya eb8c572
pass the style as prop
ashokaditya d7cb47b
update api doc
ashokaditya e8e9ce5
Merge branch 'master' into sec-team-543/allow-wildcard-for-paths
kibanamachine 330731e
make placeholderText a function expression
ashokaditya 4e7dce9
use semantic names for functions
ashokaditya 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
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
21 changes: 21 additions & 0 deletions
21
x-pack/plugins/lists/common/schemas/types/entry_match_wildcard.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,21 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import * as t from 'io-ts'; | ||
|
||
import { NonEmptyString } from '../../shared_imports'; | ||
import { operator } from '../common/schemas'; | ||
|
||
export const entriesMatchWildcard = t.exact( | ||
t.type({ | ||
field: NonEmptyString, | ||
operator, | ||
type: t.keyof({ wildcard: null }), | ||
value: NonEmptyString, | ||
}) | ||
); | ||
export type EntryMatchWildcard = t.TypeOf<typeof entriesMatchWildcard>; |
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
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
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
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
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.
I've not added tests like this one in some of the files (
handler
andmapping
) in this commit cause I think it makes more sense to add tests for validation of path values when we get to it. Else it'll be just copying a lot of tests with a changed operator value.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.
Why did we need to change the List plugin's tests and schema? We don't use their APIs to validate trusted apps. (maybe this schema is used by the ExceptionsListClient to validate payloads?)
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.
So this was needed cause the conditions that depend on the operator values use an
EntriesArray
type from the/lists/../../../schemas.ts
. So without this change routes/trusted_apps/mapping.ts#L76 TS complains that the new operator valuewildcard_caseless
never overlaps with'excluded' | 'included'
.I could trace this back to pull/83661
But yes the tests here are not entirely necessary.