Skip to content

Commit 00ecf12

Browse files
benironsidemergify[bot]
authored andcommitted
Adds web crawler example to Knowledge Base doc (#6176)
* Adds web crawler example to Knowledge Base doc * various minor edits * fixes note bug * incorporates James feedback * incorporates Charles' review * incorporates review (cherry picked from commit c5b5f65)
1 parent c018d73 commit 00ecf12

File tree

1 file changed

+53
-5
lines changed

1 file changed

+53
-5
lines changed

docs/AI-for-security/knowledge-base.asciidoc

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ image::images/knowledge-base-assistant-menu-dropdown.png[AI Assistant's dropdown
4444
[discrete]
4545
=== Option 2: Enable Knowledge Base from the Security AI settings
4646

47-
. To open Security AI settings, use the {kibana-ref}/introduction.html#kibana-navigation-search[global search field] to find "AI Assistant for Security."
47+
. To open **Security AI settings**, use the {kibana-ref}/introduction.html#kibana-navigation-search[global search field] to find "AI Assistant for Security."
4848
. On the **Knowledge Base** tab, click **Setup Knowledge Base**. If the button doesn't appear, Knowledge Base is already enabled.
4949

5050
image::images/knowledge-base-assistant-settings-kb-tab.png[AI Assistant's settings menu open to the Knowledge Base tab]
@@ -57,15 +57,15 @@ When Knowledge Base is enabled, AI Assistant receives `open` or `acknowledged` a
5757
To enable Knowledge Base for alerts:
5858

5959
. Ensure that knowledge base is <<enable-knowledge-base, enabled>>.
60-
. Use the slider on the Security AI settings' Knowledge Base tab to select the number of alerts to send to AI Assistant. Click **Save**.
60+
. On the **Security AI settings** page, go to the **Knowledge Base** tab and use the slider to select the number of alerts to send to AI Assistant. Click **Save**.
6161

6262
NOTE: Including a large number of alerts may cause your request to exceed the maximum token length of your third-party generative AI provider. If this happens, try selecting a lower number of alerts to send.
6363

6464
[discrete]
6565
[[knowledge-base-add-knowledge]]
6666
== Add knowledge
6767

68-
To view all knowledge base entries, go to the Security AI settings and select the **Knowledge Base** tab. You can add individual documents or entire indices containing multiple documents. Each entry in the Knowledge Base (a document or index) has a **Sharing** setting of `private` or `global`. Private entries apply to the current user only and do not affect other users in the {kib} space, whereas global entries affect all users. Each entry can also have a `Required knowledge` setting, which means it will be included as context for every message sent to AI Assistant.
68+
To view all knowledge base entries, go to **Security AI settings** and select the **Knowledge Base** tab. You can add individual documents or entire indices containing multiple documents. Each entry in the Knowledge Base (a document or index) has a **Sharing** setting of `private` or `global`. Private entries apply to the current user only and do not affect other users in the {kib} space, whereas global entries affect all users. Each entry can also have a `Required knowledge` setting, which means it will be included as context for every message sent to AI Assistant.
6969

7070
NOTE: When you enable Knowledge Base, it comes pre-populated with articles from https://www.elastic.co/security-labs[Elastic Security Labs], current through September 30, 2024, which allows AI Assistant to leverage Elastic's security research during your conversations. This enables it to answer questions such as, “Are there any new tactics used against Windows hosts that I should be aware of when investigating my alerts?”
7171

@@ -75,7 +75,7 @@ NOTE: When you enable Knowledge Base, it comes pre-populated with articles from
7575

7676
Add an individual document to Knowledge Base when you want AI Assistant to remember a specific piece of information.
7777

78-
. To open Security AI settings, use the {kibana-ref}/introduction.html#kibana-navigation-search[global search field] to find "AI Assistant for Security." Select the **Knowledge Base** tab.
78+
. To open **Security AI settings**, use the {kibana-ref}/introduction.html#kibana-navigation-search[global search field] to find "AI Assistant for Security." Select the **Knowledge Base** tab.
7979
. Click **New → Document** and give it a name.
8080
. Under **Sharing**, select whether this knowledge should be **Global** or **Private**.
8181
. Write the knowledge AI Assistant should remember in the **Markdown text** field.
@@ -108,7 +108,7 @@ Add an index as a knowledge source when you want new information added to that i
108108

109109
IMPORTANT: Indices added to Knowledge Base must have at least one field mapped as {ref}/semantic-text.html[semantic text].
110110

111-
. To open Security AI settings, use the {kibana-ref}/introduction.html#kibana-navigation-search[global search field] to find "AI Assistant for Security." Select the **Knowledge Base** tab.
111+
. To open **Security AI settings**, use the {kibana-ref}/introduction.html#kibana-navigation-search[global search field] to find "AI Assistant for Security." Select the **Knowledge Base** tab.
112112
. Click **New → Index**.
113113
. Name the knowledge source.
114114
. Under **Sharing**, select whether this knowledge should be **Global** or **Private**.
@@ -136,3 +136,51 @@ Refer to the following video for an example of adding an index to Knowledge Base
136136
</br>
137137
++++
138138
=======
139+
140+
[discrete]
141+
[[knowledge-base-crawler-or-connector]]
142+
=== Add knowledge with a connector or web crawler
143+
144+
You can use an {es} connector or web crawler to create an index that contains data you want to add to Knowledge Base.
145+
146+
This section provides an example of adding a threat intelligence feed to Knowledge Base using a web crawler. For more information on adding data to {es} using a connector, refer to {ref}/es-connectors.html[Ingest data with Elastic connectors]. For more information on web crawlers, refer to {enterprise-search-ref}/crawler.html[Elastic web crawler].
147+
148+
[discrete]
149+
==== Use a web crawler to add threat intelligence to Knowledge Base
150+
151+
First, you'll need to set up a web crawler to add the desired data to an index, then you'll need to add that index to Knowledge Base.
152+
153+
. From the **Search** section of {kib}, find **Web crawlers** in the navigation menu or use the {kibana-ref}/introduction.html#kibana-navigation-search[global search field].
154+
. Click **New web crawler**.
155+
.. Under **Index name**, name the index where the data from your new web crawler will be stored, for example `threat_intelligence_feed_1`. Click **Create index**.
156+
.. Under **Domain URL**, enter the URL where the web crawler should collect data. Click **Validate Domain** to test it, then **Add domain**.
157+
. The previous step opens a page with the details of your new index. Go to its **Mappings** tab, then click **Add field**.
158+
+
159+
NOTE: Remember, each index added to Knowledge Base must have at least one semantic text field.
160+
+
161+
.. Under **Field type**, select `Semantic text`. Under **Select an inference endpoint**, select `elastic-security-ai-assistant-elser2`. Click **Add field**, then **Save mapping**.
162+
. Go to the **Scheduling** tab. Enable the **Enable recurring crawls with the following schedule** setting, and define your desired schedule.
163+
. Go to the **Manage Domains** tab. Select the domain associated with your new web crawler, then go the its **Crawl rules** tab and click **Add crawl rule**. For more information, refer to {enterprise-search-ref}/crawler-extraction-rules.html[Web crawler content extraction rules].
164+
.. Click **Add crawl rule** again. Under **Policy**, select `Disallow`. Under **Rule**, select `Regex`. Under **Path pattern**, enter `.*`. Click **Save**.
165+
.. Under **Policy**, select `Allow`. Under **Rule**, select `Contains`. Under **Path pattern**, enter your path pattern, for example `threat-intelligence`. Click **Save**. Make sure this rule appears below the rule created in the previous step on the list.
166+
.. Click **Crawl**, then **Crawl all domains on this index**. A success message appears. The crawl process will take longer for larger data sources. Once it finishes, your new web crawler's index will contain documents provided by the crawler.
167+
. Finally, follow the instructions to <<knowledge-base-add-knowledge-index, add an index to Knowledge Base>>. Add the index that contains the data from your new web crawler (`threat_intelligence_feed_1` in this example).
168+
169+
Your new threat intelligence data is now included in Knowledge Base and can inform AI Assistant's responses.
170+
171+
Refer to the following video for an example of creating a web crawler to ingest threat intelligence data and adding it to Knowledge Base.
172+
173+
=======
174+
++++
175+
<script type="text/javascript" async src="https://play.vidyard.com/embed/v4.js"></script>
176+
<img
177+
style="width: 100%; margin: auto; display: block;"
178+
class="vidyard-player-embed"
179+
src="https://play.vidyard.com/eYo1e1ZRwT2mjfM7Yr9MuZ.jpg"
180+
data-uuid="eYo1e1ZRwT2mjfM7Yr9MuZ"
181+
data-v="4"
182+
data-type="inline"
183+
/>
184+
</br>
185+
++++
186+
=======

0 commit comments

Comments
 (0)