Skip to content
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][Artifacts][Trusted Apps] Wildcard warning with IS operator for trusted apps creation/editing #175356

Merged
merged 35 commits into from
Feb 14, 2024

Conversation

parkiino
Copy link
Contributor

@parkiino parkiino commented Jan 23, 2024

Summary

  • Adds updated warning messaging for trusted apps entries that use wildcards *? with the "IS" operator
  • Three different warnings: callout, individual entry item warnings and a final confirmation modal when the user tries to add a trusted app with ineffective IS / wildcard combination entry.
  • Unit tests

Screenshots

image image

@parkiino parkiino changed the title Task/is and wildcard warning [Security Solution][Artifacts][Trusted Apps] Wildcard warning with IS operator for trusted apps creation/editing Feb 12, 2024
@parkiino parkiino marked this pull request as ready for review February 12, 2024 22:04
@parkiino parkiino requested review from a team as code owners February 12, 2024 22:04
@parkiino parkiino added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v8.13.0 labels Feb 13, 2024
@caitlinbetz
Copy link

hey @parkiino this looks good to me, but wondering if we should keep the same blue color for the "Add" button (vs changing it red per screen shots). Let me know if you feel differently.

cc @dasansol92

@dasansol92
Copy link
Contributor

but wondering if we should keep the same blue color for the "Add" button (vs changing it red per screen shots). Let me know if you feel differently.

cc @dasansol92

I also think it should be blue for a save action confirmation.
Is the spacing between the callout and the form (AND button) and other warnings (soft warnings below) correct? It seems to me there should be more space around the warning callout.

let me know what do you think.

cc: @parkiino @caitlinbetz

@parkiino
Copy link
Contributor Author

but wondering if we should keep the same blue color for the "Add" button (vs changing it red per screen shots). Let me know if you feel differently.
cc @dasansol92

I also think it should be blue for a save action confirmation. Is the spacing between the callout and the form (AND button) and other warnings (soft warnings below) correct? It seems to me there should be more space around the warning callout.

let me know what do you think.

cc: @parkiino @caitlinbetz

i can adjust this to have more space

Copy link
Contributor

@paul-tavares paul-tavares left a comment

Choose a reason for hiding this comment

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

The changes to the ArtifactListPage and Trusted apps looks good.

Are the changes done to kbn-securitysolution-* packages need for this PR which is only changing the TrustedApps form (which I don't think uses the forms from the packages you changed)

anyway, approving and deferring the review of those packages to the code owners of them

Comment on lines 31 to 32
operator: <strong>Change the operator</strong>,
matches: <strong>matches</strong>,
Copy link
Contributor

Choose a reason for hiding this comment

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

these strings values need to be i18n as well

Copy link
Contributor

@rylnd rylnd left a comment

Choose a reason for hiding this comment

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

I had one test fix that should be incorporated, and I agree with the i18n comments.

I had a nit about some react control flow stuff, but that isn't pressing.

Just fix that test and i18n and this should be good on DE's side!

@@ -120,6 +125,13 @@ export const AutocompleteFieldMatchComponent: React.FC<AutocompleteFieldMatchPro
[setError, onError]
);

const handleWarning = useCallback(
(warn: Warning | undefined): void => {
onWarning(warn !== undefined);
Copy link
Contributor

Choose a reason for hiding this comment

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

So if one were to pass onWarning to this component, but not warning, the parent setWarningsExist is always going to be false and nothing will happen, right? Is that the intended behavior?

The control flow here is a little odd; if the component is accepting onWarning I would expect the rendering of the warning to be the parent's responsibility, but it seems like it's not (or is helpText={warning} something else?).

I guess this all works for now, so nothing's needed to be done, but I wonder if this architecture might be causing some extra renders 🤔

@parkiino parkiino enabled auto-merge (squash) February 14, 2024 01:16
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Defend Workflows Cypress Tests on Serverless #5 / Form User with access can create and save an endpoint response action create and save endpoint response action inside of a rule create and save endpoint response action inside of a rule
  • [job] [logs] FTR Configs #73 / security APIs - Audit Log Audit Log logs audit events when reading and writing saved objects

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 4983 4985 +2

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/securitysolution-exception-list-components 93 94 +1
@kbn/securitysolution-utils 39 43 +4
total +5

Async chunks

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

id before after diff
securitySolution 11.5MB 11.5MB +3.7KB
Unknown metric groups

API count

id before after diff
@kbn/securitysolution-exception-list-components 104 105 +1
@kbn/securitysolution-utils 44 48 +4
total +5

ESLint disabled line counts

id before after diff
securitySolution 476 477 +1

Total ESLint disabled count

id before after diff
securitySolution 550 551 +1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@parkiino parkiino merged commit 9a73eb4 into elastic:main Feb 14, 2024
38 checks passed
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
… operator for trusted apps creation/editing (elastic#175356)

## Summary

- [x] Adds updated warning messaging for trusted apps entries that use
wildcards `*?` with the "IS" operator
- [x] Three different warnings: callout, individual entry item warnings
and a final confirmation modal when the user tries to add a trusted app
with ineffective IS / wildcard combination etnry.
- [x] Unit tests

# Screenshots
<img width="829" alt="image"
src="https://github.com/elastic/kibana/assets/56409205/c7beec62-a249-4535-ac0b-34f9be57f542">
<img width="1649" alt="image"
src="https://github.com/elastic/kibana/assets/56409205/22f38f1b-7e6b-4b69-8d03-4d74d8674fa6">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
… operator for trusted apps creation/editing (elastic#175356)

## Summary

- [x] Adds updated warning messaging for trusted apps entries that use
wildcards `*?` with the "IS" operator
- [x] Three different warnings: callout, individual entry item warnings
and a final confirmation modal when the user tries to add a trusted app
with ineffective IS / wildcard combination etnry.
- [x] Unit tests

# Screenshots
<img width="829" alt="image"
src="https://github.com/elastic/kibana/assets/56409205/c7beec62-a249-4535-ac0b-34f9be57f542">
<img width="1649" alt="image"
src="https://github.com/elastic/kibana/assets/56409205/22f38f1b-7e6b-4b69-8d03-4d74d8674fa6">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
fkanout pushed a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
… operator for trusted apps creation/editing (elastic#175356)

## Summary

- [x] Adds updated warning messaging for trusted apps entries that use
wildcards `*?` with the "IS" operator
- [x] Three different warnings: callout, individual entry item warnings
and a final confirmation modal when the user tries to add a trusted app
with ineffective IS / wildcard combination etnry.
- [x] Unit tests

# Screenshots
<img width="829" alt="image"
src="https://github.com/elastic/kibana/assets/56409205/c7beec62-a249-4535-ac0b-34f9be57f542">
<img width="1649" alt="image"
src="https://github.com/elastic/kibana/assets/56409205/22f38f1b-7e6b-4b69-8d03-4d74d8674fa6">

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@parkiino parkiino deleted the task/is-and-wildcard-warning branch March 25, 2024 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit 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 v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants