-
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
[SIEM][Detection Engine] - Update UI to read rule exceptions_list #69939
Conversation
Pinging @elastic/siem (Team:SIEM) |
@@ -59,7 +59,7 @@ export interface UseExceptionListProps { | |||
|
|||
export interface ExceptionIdentifiers { | |||
id: string; | |||
namespaceType: NamespaceType; | |||
namespace_type: NamespaceType; |
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.
Was this changed to snake case to match the request body? I would expect it to be namespaceType
everywhere except the API call, which sends namespace_type: namespaceType
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.
Yea it was. Would I specify that change from namespace_type
to namespaceType
in the graphql types?
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.
Working to update this and a found bug.
@@ -253,6 +254,18 @@ export const RuleDetailsPageComponent: FC<PropsFromRedux> = ({ | |||
|
|||
const { indicesExist, indexPattern } = useWithSource('default', indexToAdd); | |||
|
|||
const exceptionLists = useMemo((): ExceptionIdentifiers[] => { |
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.
Ideally, we'd be transforming all of the rule params to camel case when we fetch them in use_rule
/ use_rules
. This is a temporary workaround.
Pinging @elastic/apm-ui (Team:apm) |
💔 Build Failed
Failed CI StepsBuild metrics@kbn/optimizer bundle module count
History
To update your PR or re-run it, just comment with: |
Pinging @elastic/security-solution (Team: SecuritySolution) |
Summary
This PR tries to start to tie together the recent server and client changes for exceptions lists.
exceptions_list
propertyexceptions_list
, up until now we just had an empty array in it's placeid
as opposed to it'slist_id
, this now aligns with the UI using the same params on its endWith this PR, you should now be able to use the API to create rules with exception lists and see the alerts filtered in the UI as well as seeing the exceptions show now in the exceptions viewer. See #69715
TO DO
section for an explanation on the remaining updates needed to the filtering logic.Testing
To turn on lists plugin - in kibana.dev.yml
Add
export ELASTIC_XPACK_SIEM_LISTS_FEATURE=true
to your bash file.Use the scripts in
x-pack/plugins/lists/server/scripts
to create some sample exception lists and items. You can use the following:If you've previously played around with lists, run
./hard_reset.sh
(this will delete any lists you've created).Create large value list:
./post_list.sh
./post_list_item.sh
(I modified the value to be"value": "10.4.2.140"
)Create exception list:
./post_exception_list.sh
./post_exception_list_item.sh ./exception_lists/new/exception_list_item_with_list.json
Use the scripts in
x-pack/plugins/security_solution/server/lib/detection_engine/scripts
to create rule:Before running script, you'll need to update the referenced exceptions_list id to the one you created
./post_rule.sh ./rules/queries/query_with_list.json
(Makes reference to the exception list created in step above)In the
Alerts
table, you should see something like the following where you only see events where theevent.module
iszeek
andsource.ip
is10.4.2.140
(or whatever ip you specified).Go to your newly created rule details and on the
Exceptions
tab you should see something like this:Checklist