-
Notifications
You must be signed in to change notification settings - Fork 206
[DOCS] Osquery features in 8.5 #2561
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
Merged
Merged
Changes from all commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
171adfc
First draft
nastasha-solomon 2bd1c96
Added parts of 2512
nastasha-solomon c13d486
Added missing syntax
nastasha-solomon e278c0f
More content
nastasha-solomon 0c50fe4
Adding license reqs
nastasha-solomon ada8a79
Merge branch 'main' into osquery-8.5-features
nastasha-solomon 0374511
More restruc and content
nastasha-solomon dadcbdd
Heading changes
nastasha-solomon d015693
Moar steps
nastasha-solomon 88b626d
Adjusted intro
nastasha-solomon 74c1c58
Fixed anchor
nastasha-solomon d7f269a
New topic
nastasha-solomon 4b1c535
New section
nastasha-solomon a422e19
Title change
nastasha-solomon 7148518
Update docs/detections/view-osquery-results.asciidoc
nastasha-solomon eeebf5b
Update docs/detections/view-osquery-results.asciidoc
nastasha-solomon a8c904e
Update docs/detections/osquery-response-action.asciidoc
nastasha-solomon bdd31cb
Update docs/detections/osquery-response-action.asciidoc
nastasha-solomon f9aaec5
Update docs/detections/rules-ui-create.asciidoc
nastasha-solomon 1d5f5d5
Update docs/detections/osquery-response-action.asciidoc
nastasha-solomon 9e21cef
Update docs/detections/invest-guide-run-osquery.asciidoc
nastasha-solomon ce81877
Update docs/detections/invest-guide-run-osquery.asciidoc
nastasha-solomon c40f5f4
Update docs/detections/invest-guide-run-osquery.asciidoc
nastasha-solomon af1d574
Update docs/detections/invest-guide-run-osquery.asciidoc
nastasha-solomon edd27aa
Update docs/detections/view-osquery-results.asciidoc
nastasha-solomon d0207be
Update docs/detections/osquery-response-action.asciidoc
nastasha-solomon 1795ad3
Update docs/detections/rules-ui-create.asciidoc
nastasha-solomon 03ed9c7
Update docs/detections/osquery-response-action.asciidoc
nastasha-solomon 746f90b
Update docs/detections/use-osquery.asciidoc
nastasha-solomon 15f68f1
Moved req block
nastasha-solomon 7b21d0f
Update docs/detections/alerts-run-osquery.asciidoc
nastasha-solomon 4b0d0a1
Update docs/detections/alerts-view-details.asciidoc
nastasha-solomon 45fbc88
Update docs/detections/invest-guide-run-osquery.asciidoc
nastasha-solomon 5d8c9fc
Update docs/detections/invest-guide-run-osquery.asciidoc
nastasha-solomon e7d0ae1
Update docs/detections/invest-guide-run-osquery.asciidoc
nastasha-solomon a102c7a
Update docs/detections/osquery-response-action.asciidoc
nastasha-solomon c31ce5a
Update docs/detections/osquery-response-action.asciidoc
nastasha-solomon 9fd6295
Update docs/detections/osquery-response-action.asciidoc
nastasha-solomon f4aee22
Update docs/detections/use-osquery.asciidoc
nastasha-solomon 2bd1be7
Merge branch 'main' into osquery-8.5-features
nastasha-solomon c98037a
Update docs/detections/alerts-run-osquery.asciidoc
nastasha-solomon 308c269
Update docs/detections/view-osquery-results.asciidoc
nastasha-solomon dd3f648
Joe's review suggestions
nastasha-solomon a25ebf9
Tomasz's input
nastasha-solomon eff5b24
Merge branch 'main' into osquery-8.5-features
nastasha-solomon e0194a4
Merge branch 'main' into osquery-8.5-features
nastasha-solomon 15eca97
Update docs/detections/view-osquery-results.asciidoc
nastasha-solomon 125692e
Merge branch 'main' into osquery-8.5-features
nastasha-solomon 945e37f
Merge branch 'main' into osquery-8.5-features
nastasha-solomon aa40f7e
Updated TOC
nastasha-solomon f71d55b
Merge branch 'main' into osquery-8.5-features
nastasha-solomon 0129f7d
Merge branch 'main' into osquery-8.5-features
nastasha-solomon 937bbb9
Update docs/detections/osquery-response-action.asciidoc
nastasha-solomon ab6cc2d
Update docs/detections/use-osquery.asciidoc
nastasha-solomon a0caedf
Merge branch 'main' into osquery-8.5-features
nastasha-solomon 8371920
Merge branch 'main' into osquery-8.5-features
nastasha-solomon 65135d3
Fixes for 2612
nastasha-solomon 298cf4f
Merge branch 'main' into osquery-8.5-features
nastasha-solomon 43b549f
Merge branch 'main' into osquery-8.5-features
nastasha-solomon b27a731
Addressed 2611.
nastasha-solomon 46727da
Word change
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 hidden or 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 hidden or 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 hidden or 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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,48 @@ | ||
| [[invest-guide-run-osquery]] | ||
| == Run Osquery from investigation guides | ||
| Detection rule investigation guides suggest steps for triaging, analyzing, and responding to potential security issues. When you build a custom rule, you can also set up an investigation guide that incorporates Osquery. This allows you to run live queries from a rule's investigation guide as you analyze alerts produced by the rule. | ||
|
|
||
| .Requirements | ||
| [sidebar] | ||
| -- | ||
| * The {kibana-ref}/manage-osquery-integration.html[Osquery manager integration] must be installed. | ||
| * {agent}'s {fleet-guide}/view-elastic-agent-status.html[status] must be `Healthy`. Refer to {fleet-guide}/fleet-troubleshooting.html[{fleet} Troubleshooting] if it isn't. | ||
| * Your role must have {kibana-ref}/osquery.html[Osquery feature privileges]. | ||
| -- | ||
|
|
||
| [role="screenshot"] | ||
| image::images/osquery-investigation-guide.png[Shows a live query in an investigation guide] | ||
|
|
||
| [float] | ||
| [[add-live-queries-ig]] | ||
| === Add live queries to an investigation guide | ||
|
|
||
| NOTE: You can only add Osquery to investigation guides for custom rules because prebuilt rules cannot be edited. | ||
|
|
||
| . Go to *Manage* -> *Rules*, select a rule, then click *Edit rule settings* on the rule details page. | ||
| . Select the *About* tab, then expand the rule's advanced settings. | ||
| . Scroll down to the Investigation guide section. In the toolbar, click the *Osquery* button (image:images/osquery-button.png[Click the Osquery button,20,20]). | ||
| .. Add a descriptive label for the query; for example, `Search for executables`. | ||
| .. Select a saved query or enter a new one. | ||
| .. Expand the **Advanced** section to view or set {kibana-ref}/osquery.html#osquery-map-fields[mapped ECS fields] included in the results from the live query (optional). | ||
| + | ||
| [role="screenshot"] | ||
| image::images/setup-osquery-investigation-guide.png[width=70%][height=70%][Shows results from running a query from an investigation guide] | ||
| . Click *Save changes* to add the query to the rule's investigation guide. | ||
|
|
||
| [float] | ||
| [[run-live-queries-ig]] | ||
| === Run live queries from an investigation guide | ||
|
|
||
| . Go to *Manage* -> *Rules*, then select a rule to open its details. | ||
| . Go to the About section of the rule details page and click *Investigation guide*. | ||
| . Click the query. The Run Osquery pane displays with the *Query* field autofilled. Do the following: | ||
| .. Select one or more {agent}s or groups to query. Start typing in the search field to get suggestions for {agent}s by name, ID, platform, and policy. | ||
| .. Expand the **Advanced** section to view or set the {kibana-ref}/osquery.html#osquery-map-fields[mapped ECS fields] which are included in the live query's results (optional). | ||
| . Click *Submit* to run the query. Query results display in the flyout. | ||
| + | ||
| NOTE: Refer to <<view-osquery-results>> for more information about query results. | ||
| . Click *Save for later* to save the query for future use (optional). | ||
| + | ||
| [role="screenshot"] | ||
| image::images/run-query-investigation-guide.png[width=80%][height=80%][Shows results from running a query from an investigation guide] | ||
This file contains hidden or 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,62 @@ | ||
| [[osquery-response-action]] | ||
| == Add Osquery Response Actions | ||
| preview::[] | ||
|
|
||
| Osquery Response Actions allow you to add live queries to custom query rules so you can automatically collect data on systems the rule is monitoring. Use this data to support your alert triage and investigation efforts. | ||
|
|
||
| .Requirements | ||
nastasha-solomon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| [sidebar] | ||
| -- | ||
| * Osquery Response Actions require a https://www.elastic.co/pricing[Platinum or Enterprise subscription]. | ||
| * The {kibana-ref}/manage-osquery-integration.html[Osquery manager integration] must be installed. | ||
| * {agent}'s {fleet-guide}/view-elastic-agent-status.html[status] must be `Healthy`. Refer to {fleet-guide}/fleet-troubleshooting.html[{fleet} Troubleshooting] if it isn't. | ||
| * Your role must have {kibana-ref}/osquery.html[Osquery feature privileges]. | ||
| -- | ||
|
|
||
| [role="screenshot"] | ||
| image::images/available-response-actions.png[Available response actions] | ||
|
|
||
| [float] | ||
| [[add-osquery-response-action]] | ||
| === Add Osquery Response Actions to rules | ||
|
|
||
| You can add Osquery Response Actions to new or existing custom query rules. Queries run every time the rule executes. | ||
|
|
||
| . Choose one of the following: | ||
| ** *New rule*: When you are on the last step of <<create-custom-rule,custom query rule>> creation, go to the Response Actions section and click the *osquery* icon. | ||
| ** *Existing rule*: Edit the rule's settings, then go to the *Actions* tab. In the tab, click the *osquery* icon under the Response Actions section. | ||
| . Specify whether you want to set up a single live query or a pack: | ||
| ** *Query*: Select a saved query or enter a new one. After you enter the query, you can expand the **Advanced** section to view or set {kibana-ref}/osquery.html#osquery-map-fields[mapped ECS fields] included in the results from the live query. Mapping ECS fields is optional. | ||
| ** *Pack*: Select from available query packs. After you select a pack, all of the queries in the pack are displayed. | ||
| + | ||
| TIP: Refer to {kibana-ref}/osquery.html#osquery-prebuilt-packs-queries[prebuilt packs] to learn about using and managing Elastic prebuilt packs. | ||
| + | ||
| [role="screenshot"] | ||
| image::images/setup-single-query.png[Shows how to set up a single query] | ||
| + | ||
|
|
||
| . Click the *osquery* icon to add more live queries (optional). | ||
| . Click **Create & enable rule** (for a new rule) or **Save changes** (for existing rules) to finish adding the queries. | ||
|
|
||
| [float] | ||
| [[edit-osquery-response-action]] | ||
| === Edit Osquery Response Actions | ||
|
|
||
| If you want to choose a different query or query pack for the Osquery Response Action to use, edit the rule to update the Response Action. | ||
|
|
||
| IMPORTANT: If you edited a saved query or query pack that an Osquery Response Action is using, you must reselect the saved query or query pack on the related Osquery Response Action. Query changes are not automatically applied to Osquery Response Actions. | ||
|
|
||
| . Edit the rule's settings, then go to the *Actions* tab. | ||
| . Modify the settings for Osquery Response Actions you've added. | ||
| . Click *Save changes*. | ||
|
|
||
| [float] | ||
| [[find-osquery-response-action-results]] | ||
| === Find query results | ||
|
|
||
| When an alert is generated, Osquery automatically collects data on the system related to the alert. Query results are displayed within the *Osquery Results* tab in the Alert details flyout. The number next to the *Osquery Results* tab represents the number of queries attached to the rule. | ||
|
|
||
| NOTE: Refer to <<view-osquery-results>> for more information about query results. | ||
|
|
||
| [role="screenshot"] | ||
| image::images/osquery-results-tab.png[width=80%][height=80%][Shows how to set up a single query] | ||
This file contains hidden or 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 hidden or 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,10 @@ | ||
| [[use-osquery]] | ||
| = Osquery | ||
|
|
||
| Osquery is an open source tool that lets you use SQL to query operating systems like a database. When you add the {kibana-ref}/manage-osquery-integration.html[Osquery manager integration] to an {agent} policy, Osquery is deployed to all agents assigned to that policy. After completing this setup, you can {kibana-ref}/osquery.html[run live queries and schedule recurring queries] for agents and begin gathering data from your entire environment. | ||
|
|
||
| Osquery is supported for Linux, macOS, and Windows. You can use it with {elastic-sec} to perform real-time incident response, threat hunting, and monitoring to detect vulnerability or compliance issues. The following Osquery features are available from {elastic-sec}: | ||
|
|
||
| * *<<osquery-response-action,Osquery Response Actions>>* - Use Osquery Response Actions to add live queries to custom query rules. | ||
| * *<<invest-guide-run-osquery,Live queries from investigation guides>>* - Incorporate live queries into investigation guides to enhance your research capabilities while investigating possible security issues. | ||
| * *<<alerts-run-osquery,Live queries from alerts>>* - Run live queries against an alert's host to learn more about your infrastructure and operating systems. |
This file contains hidden or 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,52 @@ | ||
| [[view-osquery-results]] | ||
| == Examine Osquery results | ||
| Osquery provides relevant, timely data that you can use to better understand and monitor your environment. When you run queries, results are indexed and displayed the Results table, which you can filter, sort, and interact with. | ||
|
|
||
| [float] | ||
| [[osquery-result-types]] | ||
| === Results table | ||
| The Results table displays results from single queries and query packs. | ||
|
|
||
| [float] | ||
| [[review-single-osquery-results]] | ||
| ==== Single query results | ||
|
|
||
| Results for single queries appear on the *Results* tab. When you run a query, the number of agents queried and query status temporarily display in a status bar above the results table. Agent responses can be `Sucessful`, `Not yet responded` (pending), and `Failed`. | ||
|
|
||
| [role="screenshot"] | ||
| image::images/single-query-results.png[width=80%][height=80%][Shows query results] | ||
|
|
||
| [float] | ||
| [[review-pack-osquery-results]] | ||
| ==== Query pack results | ||
|
|
||
| Results for each query in the pack appear in the *Results* tab. Click the expand icon (image:images/pack-expand-button-osquery.png[Click markdown icon,20,20]) at the far right of each query row to display query results. The number of agents that were queried and their responses are shown for each query. Agent responses are color-coded. Green is `Sucessful`, `Not yet responded` (pending) is gray, and `Failed` is red. | ||
|
|
||
| [role="screenshot"] | ||
| image::images/pack-query-results.png[width=80%][height=80%][Shows query results] | ||
|
|
||
| [float] | ||
| [[investigate-osquery-results]] | ||
| === Investigate query results | ||
|
|
||
| From the results table, you can: | ||
|
|
||
| * Click *View in Discover* (image:images/discover-button-osquery.png[Click the View in Discover button,20,20]) to explore the results in Discover. | ||
| * Click *View in Lens* (image:images/lens-button-osquery.png[Click the View in Lens button,20,20]) to navigate to Lens, where you can use the drag-and-drop *Lens* editor to create visualizations. | ||
| * Click *Timeline* (image:images/timeline-button-osquery.png[Click Timeline button,20,20]) to investigate a single query result in Timeline or *Add to timeline investigation* to investigate all results. This option is only available for single query results. | ||
|
|
||
| + | ||
| When you open all results in Timeline, the events in Timeline are filtered based on the `action_ID` generated by the Osquery query. | ||
| + | ||
|
|
||
| * Click *Add to Case* (image:images/case-button-osquery.png[Click Add to Case button,20,20]) to add the query results to a new or existing case. | ||
| + | ||
| [NOTE] | ||
| ===== | ||
|
|
||
| If you add the results to a _new_ case, you are prompted to specify the solution that you want the create the case within. Ensure you select the correct solution. From {elastic-sec}, you cannot access cases created in {observability} or Stack Management. | ||
|
|
||
| If you add the results to an _existing case_, you can select from cases that were created in any solution ({elastic-sec}, {observability}, and {stack}). | ||
| ===== | ||
|
|
||
| * View more information about the request, such as failures, by opening the *Status* tab. |
This file contains hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.