-
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
[Osquery] 7.14 bug squash #105387
Merged
Merged
[Osquery] 7.14 bug squash #105387
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
4e79846
fixed up agents table
lykkin 66d296c
fixed missing saved object in telemetry code. now display an error in…
lykkin 2a74e1a
uniquify ids on saved queries and query groups
lykkin d542ccb
linting
lykkin 50886f1
nixxed vestigial console logs
lykkin 53c0231
linting, i18n, updated tests
lykkin 8765e6f
scope id validation to group id
lykkin ce2cf48
fixed validation for duplicate ids in saved and scheduled queries
lykkin 6ec4c75
doing the hokie pokie with backend validation logic
lykkin 7dfaa57
fixed up validation logic
lykkin fffbaa3
Merge branch 'master' into 7.14-bug-squash
kibanamachine a24268a
linting
lykkin 8851e1f
Merge branch '7.14-bug-squash' of github.com:lykkin/kibana into 7.14-…
lykkin 68875d7
Merge branch 'master' into 7.14-bug-squash
kibanamachine 057b079
cleanup
patrykkopycinski 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
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
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.
can we move it to the backend?
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 like the idea of having it fail validation eagerly, but i also like the idea of having redundant protections. i'll add a check in the backend for both this and the scheduled query endpoint
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 added additional logic to the saved query endpoints, but skipped on the scheduled query endpoints since it seems like they are commented out currently. it seems like all the saved object write logic is done on the frontend anyway, from what i can tell; the saved query ui elements don't actually call into the backend, unless i'm missing something.
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.
you're right 🤦
maybe let's move the validation fix to 7.15 and in this PR only merge telemetry, expired message, and agents count?
as we're going to introduce new logic for packs in 7.15 maybe we will be able to solve the validation differently
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'll rip out the backend logic, but i think it's worthwhile to keep the frontend validation in place to avoid the duplicate id problem. we can always rip it out when we implement something more general purpose.
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.
maybe we could move it to
https://github.com/patrykkopycinski/kibana/blob/feat/cases-lens-markdown-plugin/x-pack/plugins/osquery/public/saved_queries/use_create_saved_query.ts#L40
and
https://github.com/patrykkopycinski/kibana/blob/feat/cases-lens-markdown-plugin/x-pack/plugins/osquery/public/saved_queries/use_update_saved_query.ts#L39
and then we just try to
savedObjectsClient.find({'id': yyyy})
and if results are empty then it means that theid
is unique, what do you think?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.
it makes a lot of sense to me to put defensive logic around the points where the data is created/modified, so that sounds great. i'll add that.