-
Notifications
You must be signed in to change notification settings - Fork 183
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
[Detection Engine][Exceptions] - Update docs for single and shared exceptions #4021
Open
nastasha-solomon
wants to merge
45
commits into
main
Choose a base branch
from
issue-3491-exception-item-list
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 36 commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
206f23d
First draft
nastasha-solomon 55fbab7
Fixed include
nastasha-solomon df3e171
Merge branch 'main' into issue-3491-exception-item-list
nastasha-solomon cf640b2
Merge branch 'main' into issue-3491-exception-item-list
nastasha-solomon cc62c0c
Update/create exception changes
nastasha-solomon 692568f
Update docs/detections/api/exceptions/api-create-rule-default-excepti…
nastasha-solomon c51783a
Merge branch 'main' into issue-3491-exception-item-list
nastasha-solomon 9c31311
Merge branch 'main' into issue-3491-exception-item-list
nastasha-solomon a41f72e
Merge branch 'main' into issue-3491-exception-item-list
nastasha-solomon 7ec89a2
Merge branch 'main' into issue-3491-exception-item-list
nastasha-solomon a8cd5c5
Merge branch 'main' into issue-3491-exception-item-list
nastasha-solomon d5a7b9a
Revising intro
nastasha-solomon 0503015
Merge branch 'main' into issue-3491-exception-item-list
nastasha-solomon db76cae
Adding new topic
nastasha-solomon d17654c
Merge branch 'main' into issue-3491-exception-item-list
nastasha-solomon ee215e5
Fixing refs
nastasha-solomon f1a983c
Removed duplicate entry
nastasha-solomon e6788ed
Merge branch 'main' into issue-3491-exception-item-list
nastasha-solomon eebdef6
Merge branch 'main' into issue-3491-exception-item-list
nastasha-solomon 5353b60
Yara's input
nastasha-solomon 76d7af1
Minor wording changes
nastasha-solomon 1c8efcb
Title update
nastasha-solomon 3e3bea2
Modifies title for shared exceptions
nastasha-solomon 516e652
Fixing conflicts
nastasha-solomon dfba7d2
attempt number 2
nastasha-solomon 7a4ac5f
Added file ext to index file
nastasha-solomon 4a6e620
Update docs/detections/api/rules/rules-api-overview.asciidoc
nastasha-solomon 8f586d5
Closing table
nastasha-solomon d6f4967
Update docs/detections/api/rules/rules-api-create-rule-default-except…
nastasha-solomon 7086704
Merge branch 'issue-3491-exception-item-list' of github.com:elastic/s…
nastasha-solomon 7cbe9c8
Minor changes and notes
nastasha-solomon fb59901
Update docs/detections/api/rules/rules-api-create-rule-default-except…
nastasha-solomon 31e2127
Update docs/detections/api/rules/rules-api-create-single-rule-excepti…
nastasha-solomon ec9997b
Update docs/detections/api/rules/rules-api-create-single-rule-excepti…
nastasha-solomon b9589c5
Fixed route in example
nastasha-solomon 845b50d
Merge branch 'issue-3491-exception-item-list' of github.com:elastic/s…
nastasha-solomon 2b47c51
Remove comment chars
nastasha-solomon 94af96d
Merge branch 'main' into issue-3491-exception-item-list
nastasha-solomon 585ed2c
Input from Yara
nastasha-solomon 4ca0d5b
Refreshed params
nastasha-solomon 92543bd
minor style fixes
nastasha-solomon 3cca05f
Merge branch 'main' into issue-3491-exception-item-list
nastasha-solomon cc59ab9
Merge branch 'main' into issue-3491-exception-item-list
nastasha-solomon 547bcd0
Merge branch 'main' into issue-3491-exception-item-list
nastasha-solomon 20bd1da
Update docs/detections/api/rules/rules-api-create-rule-default-except…
nastasha-solomon 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
28 changes: 15 additions & 13 deletions
28
docs/detections/api/exceptions/api-create-exception-item.asciidoc
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
1 change: 1 addition & 0 deletions
1
docs/detections/api/exceptions/api-update-exception-item.asciidoc
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
105 changes: 105 additions & 0 deletions
105
docs/detections/api/rules/rules-api-create-rule-default-exception-list.asciidoc
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,105 @@ | ||
[[exceptions-api-create-rule-default-exception-list]] | ||
=== Create default exception list for a rule | ||
|
||
Creates a default exception list for the rule you specify. Default exception lists can only be associated with a single rule. | ||
|
||
To add exception items to a default exception list, pass in exceptions items that you want applied to the rule. Refer to <<exceptions-api-create-rule-default-exception-item>> for more information. | ||
|
||
When an exception item’s query evaluates to `true`, the associated rule does not issue alerts even when its other criteria are met. | ||
|
||
NOTE: Default exception lists do not display on the <<shared-exception-lists, Shared Exception Lists>> page in the {security-app} UI. | ||
nastasha-solomon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
==== Request URL | ||
|
||
`POST <kibana host>:<port>/api/detection_engine/<rule_id>/exceptions` | ||
|
||
==== Request body | ||
|
||
A JSON object with these fields: | ||
|
||
[width="100%",options="header"] | ||
|============================================== | ||
|Name |Type |Description |Required | ||
|
||
|`description` |String |Describes the exception container. |Yes | ||
|`list_id` |String |Unique identifier. |No, automatically created when it is not | ||
provided. | ||
|`meta` |Object |Placeholder for metadata about the list container. |No | ||
|`name` |String |The exception container's name. |Yes | ||
|`namespace_type` |String a|Determines whether the exception container is available in all {kib} spaces or just the space in which it is created, where: | ||
|
||
* `single`: Only available in the {kib} space in which it is created. | ||
* `agnostic`: Available in all {kib} spaces. | ||
|
||
|No, defaults to `single`. | ||
|`tags` |String[] |String array containing words and phrases to help categorize | ||
exception containers. |No | ||
|`type` |String a|The type of exception, which must be: | ||
|
||
* `rule_default`: Exception list that belongs to a single rule | ||
|
||
|Yes | ||
|
||
|============================================== | ||
|
||
===== Example requests | ||
|
||
Creates an exception container for holding trusted Linux process exception | ||
items: | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
POST api/exception_lists | ||
nastasha-solomon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
"description": "Excludes Linux trusted processes", | ||
"name": "Linux process exceptions", | ||
"list_id": "trusted-linux-processes", | ||
"type": "detection", | ||
"namespace_type": "single", | ||
"tags": [ | ||
"linux", | ||
"processes" | ||
] | ||
} | ||
-------------------------------------------------- | ||
// KIBANA | ||
|
||
==== Response code | ||
|
||
`200`:: | ||
Indicates a successful call. | ||
|
||
|
||
==== Response payload | ||
|
||
The exception container object with a unique ID. | ||
|
||
[source,json] | ||
-------------------------------------------------- | ||
{ | ||
"_tags": [], | ||
"created_at": "2020-07-13T09:33:46.187Z", | ||
"created_by": "elastic", | ||
"description": "Excludes Linux trusted processes", | ||
"id": "f320c070-c4eb-11ea-80bb-11861bae2798", <1> | ||
"list_id": "trusted-linux-processes", <2> | ||
"name": "Linux process exceptions", | ||
"namespace_type": "single", <3> | ||
"tags": [ | ||
"linux", | ||
"processes" | ||
], | ||
"tie_breaker_id": "2c08d5a5-2ecc-4d5a-acfb-0a367f25b3f3", | ||
"type": "detection", <4> | ||
"updated_at": "2020-07-13T09:33:46.359Z", | ||
"updated_by": "elastic" | ||
} | ||
-------------------------------------------------- | ||
|
||
These values are required to associate the exception container with detection | ||
rules: | ||
|
||
<1> `id` | ||
<2> `list_id` | ||
<3> `namespace_type` | ||
<4> `type` |
86 changes: 86 additions & 0 deletions
86
docs/detections/api/rules/rules-api-create-single-rule-exception-item.asciidoc
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,86 @@ | ||
[[exceptions-api-create-rule-default-exception-item]] | ||
=== Create exceptions for a rule | ||
|
||
Allows you to create exception items that are associated with a specified rule `id`. | ||
nastasha-solomon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
==== Request URL | ||
|
||
`POST <kibana host>:<port>/api/detection_engine/rules/<id>/exceptions` | ||
|
||
//include a tip on how to find a rule's ID | ||
nastasha-solomon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
==== Request body | ||
|
||
A JSON object with an array of exception items, where each exception item has the <<exceptions-api-create-exception-item,required fields>>. | ||
|
||
[width="100%",options="header"] | ||
|============================================== | ||
nastasha-solomon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|Name |Type |Description |Required | ||
|
||
|`items` |String | Specify an array of exception list items to create. |Yes | ||
|
||
|============================================== | ||
|
||
===== Example requests | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
POST api/detection_engine/rules/<id>/exceptions | ||
nastasha-solomon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
"items": [ | ||
{ | ||
"field": "process.name", | ||
"operator": "included", | ||
"type": "match", | ||
"value": "maintenance-job" | ||
} | ||
], | ||
"list_id": "trusted-linux-processes", | ||
"name": "Linux maintenance job", | ||
"namespace_type": "single", | ||
"tags": [ | ||
"in-house processes", | ||
"linux" | ||
], | ||
"type": "simple" | ||
} | ||
-------------------------------------------------- | ||
|
||
==== Response code | ||
|
||
`200`:: | ||
Indicates a successful call. | ||
|
||
==== Response payload | ||
|
||
The returned exception item. | ||
|
||
Example response: | ||
|
||
[source,json] | ||
-------------------------------------------------- | ||
{ | ||
"body": [ | ||
{ | ||
"comments": [], | ||
"created_by": "elastic", | ||
"description": "Exception item for rule default exception list", | ||
"entries": [ | ||
{ | ||
"field": "host.name", | ||
"operator": "included", | ||
"type": "match", | ||
"value": "foo", | ||
}, | ||
], | ||
"name": "Sample exception item", | ||
"list_id": "e6c44050-c661-11ea-bab5-9d6ae015701b", | ||
"namespace_type": "single", | ||
"os_types": [], | ||
"tags": [], | ||
"type": "simple", | ||
"updated_by": "elastic" | ||
} | ||
] | ||
} | ||
-------------------------------------------------- |
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.
@caitlinbetz is this still accurate? I know we opened endpoint exceptions up to have less field restrictions, not sure if these still hold.