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][Endpoint] Hide endpoint event filters list in detections tab #102644

Conversation

dasansol92
Copy link
Contributor

Summary

Hides endpoint event filters from the exception lists in detections tab:

hide event filters list

Checklist

For maintainers

@dasansol92 dasansol92 added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution auto-backport Deprecated - use backport:version if exact versions are needed labels Jun 18, 2021
@dasansol92 dasansol92 self-assigned this Jun 18, 2021
@dasansol92 dasansol92 marked this pull request as ready for review June 22, 2021 07:54
@dasansol92 dasansol92 requested review from a team as code owners June 22, 2021 07:54
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-onboarding-and-lifecycle-mgt (Team:Onboarding and Lifecycle Mgt)

@dasansol92
Copy link
Contributor Author

@elasticmachine merge upstream

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.

🚀

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.

Approving, but left a question that may result in some refactoring (in either this or a subsequent PR)

@@ -43,6 +44,7 @@ export const useExceptionLists = ({
namespaceTypes,
notifications,
showTrustedApps = false,
showEventFilters = false,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure what use case outside of the Event Filters/Trusted Apps pages need this hook to pull in Trusted apps and/or event filters. I searched for showTrustedApps and its not being used today.

Proposal/suggestion:
Is there a way to remove these props and instead have this hook only pull in what it need to show (exceptions)? Feels like that would be the better long term solution. else, we'll likely have to continue to revisit this area of the system every time we add new types of exceptions.

(this might be more of a question for the @elastic/security-detections-response team)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah! I'm agree that would be better to filter by what we want instead that filter what we want to skip (event filters list and trusted apps list in this case).
I'm not sure why this was done in this way. Is it supposed to have more cain of exceptions lists than the current ones? Is this something user can create and then, yes, we should just filter trusted apps and event filter lists in order to avoid loosing data?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, I'm not sure either, but we can take that on to another (potential refactor) issue.

});

test('it properly formats when no filters passed and "showTrustedApps" is true', () => {
const filter = getFilters({}, ['single'], true);
const filter = getFilters({}, ['single'], true, false);
Copy link
Contributor

@FrankHassanabad FrankHassanabad Jun 22, 2021

Choose a reason for hiding this comment

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

This API is getting difficult to read, once we have something such as true, false on the end mixed with an object and an array. Maintainers and others will have a hard time knowing which true and false belongs to what without reading the source function.

Could we maybe just use an object so that we have named input variables?

Then this API would look something like this and be easier to read in the code base that the second false indicates that it is a showEventFilters vs showTrustedApps:

Usually when people get to 2-3 parameters it is easier to read named parameters than guessing what each true, false, etc... means.

 getFilters({
  filters: {},
  namespaceTypes: ['single'],
  showTrustedApps: true,
  showEventFilters: false,
})

Copy link
Contributor

@FrankHassanabad FrankHassanabad left a comment

Choose a reason for hiding this comment

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

Left one comment, but don't want to hold this up. Feel free to do what you need to on this one. I will leave a LGTM for ya' since Paul is looking at this closely.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
lists 221 222 +1
securitySolution 2188 2189 +1
total +2

Async chunks

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

id before after diff
lists 271.7KB 272.7KB +962.0B
securitySolution 6.9MB 6.9MB +989.0B
total +1.9KB

History

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

cc @dasansol92

@dasansol92 dasansol92 merged commit eb97269 into elastic:master Jun 23, 2021
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jun 23, 2021
…ections tab (elastic#102644)

* Add event filters filter on exception list to hide it in UI

* Fixes unit test and added more tests for showEventFilters

* fixes test adding showEventFilters test cases

* Pass params as js object instead of individual variables

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

@dasansol92 dasansol92 added OLM Sprint QA:Ready for Testing Code is merged and ready for QA to validate labels Jun 23, 2021
kibanamachine added a commit that referenced this pull request Jun 23, 2021
…ections tab (#102644) (#103097)

* Add event filters filter on exception list to hide it in UI

* Fixes unit test and added more tests for showEventFilters

* fixes test adding showEventFilters test cases

* Pass params as js object instead of individual variables

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: David Sánchez <davidsansol92@gmail.com>
@muskangulati-qasource
Copy link

Hi @kevinlog,

We tested this ticket on the latest 7.14.0-BC3 build and found that the issue is now fixed. There is no entry for event filters under the exception list.

Please find below the testing details.

Build details:

VERSION: 7.14.0-BC3
BUILD: 42545
COMMIT: c314921a9893e0b46d9a3958f5520e3d6b1ce7d5
ARTIFACT: https://staging.elastic.co/7.14.0-682a8012/summary-7.14.0.html

Screenshot:
ExeceptionList

Hence, marking it as "Validated".

Thanks!

@muskangulati-qasource muskangulati-qasource added QA:Validated Issue has been validated by QA and removed QA:Ready for Testing Code is merged and ready for QA to validate labels Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed OLM Sprint QA:Validated Issue has been validated by QA release_note:skip Skip the PR/issue when compiling release notes Team:Defend Workflows “EDR Workflows” sub-team of Security Solution v7.14.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants