@cccsaurora/howler-ui 2.12.0-dev.38 → 2.12.0-dev.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,157 @@
1
+ # Notebook Integration
2
+
3
+ Howler provides the option to add notebooks to analytics to aid in triaging hits and alerts. It allows users to quickly spin up a notebook within a jupyter environment with either analytic and/or hit information.
4
+
5
+ Howler will look for variables to replace within the first code cell of a notebook, giving the flexibility of providing context within the first cells using markdown.
6
+
7
+ Here an example of how howler will replace the variables within your notebook:
8
+
9
+ ```notebook tab="Template"
10
+ {
11
+ "cells": [
12
+ {
13
+ "cell_type": "code",
14
+ "id": "fe6f810f-2459-4ad7-92ac-1e925ce892d4",
15
+ "outputs": [],
16
+ "source": [
17
+ "howlerHitId = \"{{hit.howler.id}}\"\n",
18
+ "howlerAnalyticId = \"{{analytic.analytic_id}}\""
19
+ ]
20
+ },
21
+ {
22
+ "cell_type": "code",
23
+ "id": "586470ef-c8e6-45b1-bd17-17ccd083eef1",
24
+ "outputs": [],
25
+ "source": [
26
+ "from howler_client import get_client\n\n",
27
+ "howler = get_client(\"$CURRENT_URL\")\n",
28
+ "hit = howler.hit(howlerHitId)"
29
+ ]
30
+ }
31
+ ],
32
+ "nbformat": 4,
33
+ "nbformat_minor": 5
34
+ }
35
+ ```
36
+
37
+ ```notebook tab="Processed"
38
+ {
39
+ "cells": [
40
+ {
41
+ "cell_type": "code",
42
+ "id": "fe6f810f-2459-4ad7-92ac-1e925ce892d4",
43
+ "outputs": [],
44
+ "source": [
45
+ "howlerHitId = \"7dxHCat0Y2Sj48qyU7ZkVV\"\n",
46
+ "howlerAnalyticId = \"2SXKl6Cq4rOxWLps2SFHyB\""
47
+ ]
48
+ },
49
+ {
50
+ "cell_type": "code",
51
+ "id": "586470ef-c8e6-45b1-bd17-17ccd083eef1",
52
+ "outputs": [],
53
+ "source": [
54
+ "from howler_client import get_client\n\n",
55
+ "howler = get_client(\"$CURRENT_URL\")\n",
56
+ "hit = howler.hit(howlerHitId)"
57
+ ]
58
+ }
59
+ ],
60
+ "nbformat": 4,
61
+ "nbformat_minor": 5
62
+ }
63
+ ```
64
+
65
+ or with some markdown in the first cell:
66
+
67
+ ```notebook tab="Template"
68
+ {
69
+ "cells": [
70
+ {
71
+ "cell_type": "markdown",
72
+ "id": "e17cbaa8-9849-462f-9bd2-bf30943f76b3",
73
+ "source": [
74
+ "### Example Notebook"
75
+ ]
76
+ },
77
+ {
78
+ "cell_type": "code",
79
+ "id": "fe6f810f-2459-4ad7-92ac-1e925ce892d4",
80
+ "outputs": [],
81
+ "source": [
82
+ "howlerHitId = \"{{hit.howler.id}}\"\n",
83
+ "howlerAnalyticId = \"{{analytic.analytic_id}}\""
84
+ ]
85
+ },
86
+ {
87
+ "cell_type": "code",
88
+ "id": "586470ef-c8e6-45b1-bd17-17ccd083eef1",
89
+ "outputs": [],
90
+ "source": [
91
+ "from howler_client import get_client\n\n",
92
+ "howler = get_client(\"$CURRENT_URL\")\n",
93
+ "hit = howler.hit(howlerHitId)"
94
+ ]
95
+ }
96
+ ],
97
+ "nbformat": 4,
98
+ "nbformat_minor": 5
99
+ }
100
+ ```
101
+
102
+ ```notebook tab="Processed"
103
+ {
104
+ "cells": [
105
+ {
106
+ "cell_type": "markdown",
107
+ "id": "e17cbaa8-9849-462f-9bd2-bf30943f76b3",
108
+ "source": [
109
+ "### Example Notebook"
110
+ ]
111
+ },
112
+ {
113
+ "cell_type": "code",
114
+ "id": "fe6f810f-2459-4ad7-92ac-1e925ce892d4",
115
+ "outputs": [],
116
+ "source": [
117
+ "howlerHitId = \"7dxHCat0Y2Sj48qyU7ZkVV\"\n",
118
+ "howlerAnalyticId = \"2SXKl6Cq4rOxWLps2SFHyB\""
119
+ ]
120
+ },
121
+ {
122
+ "cell_type": "code",
123
+ "id": "586470ef-c8e6-45b1-bd17-17ccd083eef1",
124
+ "outputs": [],
125
+ "source": [
126
+ "from howler_client import get_client\n\n",
127
+ "howler = get_client(\"$CURRENT_URL\")\n",
128
+ "hit = howler.hit(howlerHitId)"
129
+ ]
130
+ }
131
+ ],
132
+ "nbformat": 4,
133
+ "nbformat_minor": 5
134
+ }
135
+ ```
136
+
137
+ Currently, howler will only try to replace hit and analytic objects.
138
+
139
+ # Requirements for the notebook integration to work
140
+
141
+ - A working NBGallery setup is required.
142
+ - If the user can send a notebook from nbgallery to their jupyter environment, it will also work using the open in jupyhub button on Howler.
143
+ - Just like with NBGallery, the user needs to make sure their Jupyter Environment is currently running, otherwise Howler will fail to open the notebook.
144
+
145
+ Howler will append the id of the Hit/Alert when sending a notebook to Jupyter, making it easy to track for analysis. It is possible to open a notebook from within an analytic page, in this case, no hit id will be appended to the file name of the notebook and Howler won't be able to replace hit informations in the templated notebook since no hit was provided.
146
+
147
+ # Adding a notebook to an analytic
148
+
149
+ To add a notebook to an analytic, it's only necessary to provide the NBGallery link of the notebook. The link shoud look like this. The notebook shouldn't be private, otherwise, only the user that uploaded it will be able to use it on Howler.
150
+
151
+ ```
152
+ $NBGALLERY_URL/notebooks/5-example
153
+ ```
154
+
155
+ ```alert
156
+ It is advised to clear any outputs from a notebook before adding it on NBGallery to avoid leaking sensitive data.
157
+ ```
@@ -0,0 +1,15 @@
1
+ # Retention in Howler
2
+
3
+ In order to comply with organizational policies, Howler is configured to purge stale alerts after a specific amount of time. On this instance, that duration is `duration`.
4
+
5
+ Howler calculates whether it is time for the removal of an alert by the `event.created` date - once this surpasses the confgured deadline, a nightly automated job will remove the alert.
6
+
7
+ In order to communicate this to the user, see the example alert below:
8
+
9
+ `alert`
10
+
11
+ In the top right, hovering over the timestamp will outline how long users have before the alert is removed. In order to ensure compliance with policy, ensure that `event.created` matches the date the underlying data was collected, allowing howler to ensure data is purged in time.
12
+
13
+ ```alert
14
+ This will soon change - there will be a dedicated field to set that will override this approach.
15
+ ```
@@ -0,0 +1,21 @@
1
+ # Hit Schema
2
+
3
+ A howler hit can contain a large number of unique fields, each with a particular definition, in order to make hits across analytics mutually intelligible. Below is a table containing all the given hit fields, as well as their type and a short description of what they are used for. While the vast majority of the fields are based on the Elastic Common Schema (see [this guide on ECS](https://www.elastic.co/guide/en/ecs/8.5/index.html) for documentation), there are also custom fields depending on the plugins enabled in Howler.
4
+
5
+ ## Howler Fields - Best Practices
6
+
7
+ In order to allow for some consistency between various analytics, there are a number of fields with recommended (but not required) styles. These include:
8
+
9
+ - `howler.analytic`: Denotes the overarching analytic that generated the hit. For example, if the name of your analytic is Bad Guy Finder, you can set this field to Bad Guy Finder. Examples of use:
10
+
11
+ - Bad Guy Finder (correct)
12
+ - BadGuyFinder (acceptable, but spaces are preferred)
13
+ - bad.guy.finder (incorrect, don't use periods)
14
+ - bad_guy_finder (incorrect, don't use underscores)
15
+ - in general, you can use [this regex](https://regexr.com/7ikco) to validate your proposed analytic name
16
+
17
+ - `howler.detection`: Denotes the specific algorithm or portion of the analytic that generated the hit. For example, if your analytic has three ways of detecting hits that should be looked at (Impossible Travel, Incorrect Login Information, XSS Attack Detection), then the manner in which the hit you're creating was detected should be set. Examples of use:
18
+ - Impossible Travel (correct)
19
+ - ImpossibleTravel (acceptable, but spaces are preferred)
20
+ - impossible.travel (incorrect, don't use periods)
21
+ - impossible_travel (incorrect, don't use underscores)
@@ -0,0 +1,23 @@
1
+ # Howler Templates
2
+
3
+ Howler is, fundamentally, an application that allows analysts to triage hits and alerts. In order to make sure analysts can do this as efficiently as possible, we want to have the ability to present relevant data for a given alert to analysts in an easy, understandable way.
4
+
5
+ To this end, Howler allows analysts and detection engineers to create **templates**, which allow various analytics and their detections to present fields and data relevant to triaging alerts generated by that analytic/detection. For example, let's consider two different alerts, by two different detections:
6
+
7
+ ```json
8
+ $ALERT_1
9
+ ```
10
+
11
+ ```json
12
+ $ALERT_2
13
+ ```
14
+
15
+ Note that while both share some similar fields, they also differ. We want each of these alert cards to present different data - for that, we can use templates. This allows us to show both hits in the same list, but with differing fields displayed:
16
+
17
+ ===SPLIT===
18
+
19
+ As we can see, by specifying a template for each of the detections, different data will be presented to the analyst. To do so, you can use the template creator [here]($CURRENT_URL/templates/view?type=personal).
20
+
21
+ ```alert
22
+ Note that you must have ingested some hits for the given analytic/detection pair for it to show as an option in the template creation UI!
23
+ ```
@@ -0,0 +1,11 @@
1
+ # Views
2
+
3
+ Views are a feature in Howler that allows users to create custom, default queries through which they can organize and triage hits. In this document, we will outline how to create and interact with views.
4
+
5
+ ## Using a View
6
+
7
+ You can use views by navigating to the view manager under [Manage > Views](/views). Clicking on any view will open it in the search page. Here, you can also use the `search` icon to open the view in the search page. You can also edit views that belong to you, and mark them as favourites. This will show them in the `t(route.views.saved)` dropdown in the sidebar. In the top right, you can also choose your "`t(route.views.manager.default)`", that will be selected by default when opening the alerts page.
8
+
9
+ ## Creating Views
10
+
11
+ In order to create a view, you can use the create view page, located [here](/views/create). This page allows you to modifer your view, specify a `t(hit.search.sort.fields)` and `t(hit.search.span)`, and save the view with a particular name. You can mark a view as global or personal, depending on who you want to be able to see and use the view.
@@ -0,0 +1,33 @@
1
+ # Utilisation des actions dans Howler
2
+
3
+ Les actions sont une fonctionnalité de Howler qui permet aux utilisateurs d'effectuer des tâches particulières sur un grand nombre de hits, en automatisant l'exécution d'une tâche sur chaque hit. Il y a actuellement `action_count` opérations supportées dans Howler :
4
+
5
+ `action_list`
6
+
7
+ Toutes ces opérations peuvent être combinées ensemble dans des actions uniques - c'est-à-dire que les opérations sont essentiellement les blocs de construction des actions dans Howler. Chaque opération ne peut apparaître qu'une seule fois par action, et toutes les opérations sont configurées à travers une interface unifiée. Dans ce document, nous allons parcourir les étapes nécessaires à l'exécution et à la sauvegarde d'une action.
8
+
9
+ ## Configuration d'une action
10
+
11
+ Pour commencer à configurer votre action, décidez s'il s'agit d'une action unique ou d'une action sauvegardée que vous souhaitez exécuter plusieurs fois. Si vous voulez l'exécuter une fois, utilisez l'entrée `t(route.actions.change)` dans la barre latérale, alors qu'une action sauvegardée est mieux configurée sous `t(route.actions.manager)` en appuyant sur "`t(route.actions.create)`".
12
+
13
+ La première étape de toute action sera de concevoir une requête sur laquelle vous voulez que cette action s'exécute. La boîte de recherche en haut de l'écran accepte n'importe quelle requête lucene - le même format que pour la recherche d'occurrences.
14
+
15
+ `tui_phrase`
16
+
17
+ Une fois que vous êtes satisfait des occurrences qui seront incluses dans cette requête, vous pouvez commencer à ajouter des opérations. Vous pouvez le faire en sélectionnant l'opération que vous voulez ajouter dans la liste déroulante:
18
+
19
+ `operation_select`
20
+
21
+ Une fois que vous avez sélectionné l'opération que vous souhaitez ajouter, une liste de paramètres à remplir vous est proposée. Voici un exemple d'ajout d'une étiquette.
22
+
23
+ `operation_configuration`
24
+
25
+ Une fois que l'opération est validée avec succès, vous pouvez répéter ce processus avec l'opération suivante. Une fois que vous avez ajouté toutes les opérations qui vous intéressent, vous pouvez exécuter ou sauvegarder l'action en utilisant le bouton situé sous la barre de recherche. Vous obtiendrez ainsi un rapport sur les étapes franchies.
26
+
27
+ `report`
28
+
29
+ Il peut arriver que des actions génèrent une erreur, soit lors de la validation, soit lors de l'exécution. Dans ce cas, une alerte d'erreur sera affichée, vous aidant à résoudre le problème.
30
+
31
+ ## Automatiser une action
32
+
33
+ Pour automatiser une action, ouvrez une action sauvegardée. Les options disponibles pour l'automatisation (`automation_options`) apparaîtront sous forme de cases à cocher. En cochant la case, vous vous assurez que l'action s'exécutera ensuite - aucune autre opération n'est nécessaire.
@@ -0,0 +1,259 @@
1
+ <!-- docs/ingestion/authentication.fr.md -->
2
+
3
+ # Authentification de Howler
4
+
5
+ L'API de Howler prend en charge un certain nombre d'approches d'authentification lors de l'accès à l'API. Ce document présente les
6
+ différentes approches et explique comment utiliser chacune d'entre elles.
7
+
8
+ ## Types d'authentification
9
+
10
+ Il existe quatre méthodes d'authentification que l'on peut utiliser pour se connecter à l'API howler:
11
+
12
+ 1. Nom d'utilisateur et mot de passe
13
+ 2. Nom d'utilisateur et clé API
14
+ 3. Nom d'utilisateur et clé d'application (après connexion)
15
+ 4. Jeton d'accès OAuth
16
+
17
+ Nous allons maintenant présenter les cas d'utilisation de chaque type d'authentification.
18
+
19
+ ### Authentification par nom d'utilisateur/mot de passe
20
+
21
+ L'authentification par nom d'utilisateur et mot de passe est la méthode d'authentification la plus simple et la moins sûre. Il est peu probable qu'elle soit activée
22
+ dans un environnement de production, elle permet aux utilisateurs de se connecter facilement à l'API Howler et d'effectuer des modifications en tant qu'utilisateur donné,
23
+ sans avoir à se soucier de créer des clés API ou d'utiliser un fournisseur OAuth comme Keycloak ou Azure. Les utilisateurs peuvent se connecter
24
+ en utilisant l'authentification par nom d'utilisateur et mot de passe de l'une des deux manières suivantes :
25
+
26
+ #### Appel direct au point de terminaison requis (mot de passe)
27
+
28
+ C'est de loin la méthode la plus simple. Il suffit d'ajouter un en-tête d'autorisation de base à la requête HTTP que vous souhaitez effectuer, et tout est pris en charge.
29
+ que vous voulez faire, et tout est pris en charge:
30
+
31
+ ```bash
32
+ echo -n "user:user" | base64 -w0
33
+ # -> dXNlcjp1c2Vy
34
+ ```
35
+
36
+ ```http
37
+ GET $CURRENT_URL/api/v1/user/whoami
38
+ Authorization: Basic dXNlcjp1c2Vy
39
+ ```
40
+
41
+ #### Échange contre un jeton d'application (mot de passe)
42
+
43
+ Il s'agit d'une approche un peu plus complexe, mais qui présente l'avantage de ne pas exposer le nom d'utilisateur et le mot de passe à chaque demande.
44
+ à chaque requête. Vous pouvez utiliser le point de terminaison `v1/auth/login` pour échanger votre nom d'utilisateur et votre mot de passe contre un jeton d'application. Le jeton
45
+ fonctionne de la même manière qu'un jeton d'accès OAuth - vous le fournissez à chaque requête ultérieure, et il vous authentifie jusqu'à ce que le jeton expire.
46
+ jusqu'à ce que le jeton expire.
47
+
48
+ ```http
49
+ POST $CURRENT_URL/api/v1/auth/login/
50
+ Content-Type: application/json
51
+
52
+ {
53
+ "user": "user",
54
+ "password": "user"
55
+ }
56
+ ```
57
+
58
+ Le résultat sera quelque chose comme:
59
+
60
+ ```json
61
+ {
62
+ "api_error_message": "",
63
+ "api_response": {
64
+ "app_token": "user:5791a142067745c3af51d6596da7da8f86357a9fa92ad78d1ce118ea7d89d34e",
65
+ "provider": null,
66
+ "refresh_token": null
67
+ },
68
+ "api_server_version": "0.0.0.dev0",
69
+ "api_status_code": 200
70
+ }
71
+ ```
72
+
73
+ Utilisation de ce jeton dans un autre appel d'API:
74
+
75
+ ```http
76
+ GET $CURRENT_URL/api/v1/user/whoami
77
+ Authorization: Bearer user:5791a142067745c3af51d6596da7da8f86357a9fa92ad78d1ce118ea7d89d34e
78
+ ```
79
+
80
+ ### Authentification par nom d'utilisateur/clé API
81
+
82
+ L'authentification par nom d'utilisateur et clé API fonctionne en grande partie de la même manière que l'authentification par nom d'utilisateur/mot de passe du point de vue du client.
83
+ Du côté du serveur, cependant, les clés API présentent plusieurs avantages essentiels. Tout d'abord, elles peuvent être facilement révoquées par l'utilisateur.
84
+ Deuxièmement, leurs privilèges peuvent être limités, n'autorisant qu'un sous-ensemble de permissions.
85
+
86
+ Il existe deux méthodes d'authentification, reflétant le nom d'utilisateur et le mot de passe:
87
+
88
+ #### Appel direct au point de terminaison requis (clé API)
89
+
90
+ Il suffit d'ajouter un en-tête d'autorisation de base contenant le nom d'utilisateur et la clé API à la requête HTTP que vous souhaitez effectuer, et
91
+ tout est pris en charge:
92
+
93
+ ```bash
94
+ # note the format is <username>:<apikeyname>:<secret>
95
+ echo -n "user:devkey:user" | base64 -w0
96
+ # -> dXNlcjpkZXZrZXk6dXNlcg==
97
+ ```
98
+
99
+ ```http
100
+ GET $CURRENT_URL/api/v1/user/whoami
101
+ Authorization: Basic dXNlcjpkZXZrZXk6dXNlcg==
102
+ ```
103
+
104
+ #### Échange contre un jeton d'application (clé API)
105
+
106
+ Vous pouvez également utiliser le point de terminaison `v1/auth/login` pour échanger votre nom d'utilisateur et votre clé API contre un jeton d'application. Le jeton
107
+ fonctionne de la même manière qu'un jeton d'accès OAuth - vous le fournissez à chaque demande ultérieure, et il vous authentifie jusqu'à ce que le jeton expire.
108
+
109
+ ```http
110
+ POST $CURRENT_URL/api/v1/auth/login/
111
+ Content-Type: application/json
112
+
113
+ {
114
+ "user": "user",
115
+ "apikey": "devkey:user"
116
+ }
117
+ ```
118
+
119
+ Le résultat sera quelque chose comme:
120
+
121
+ ```json
122
+ {
123
+ "api_error_message": "",
124
+ "api_response": {
125
+ "app_token": "user:f220eb76ff8404abfece8c0c2f3368c7d89618c776bedcd3a506843dc4a952e4",
126
+ "provider": null,
127
+ "refresh_token": null
128
+ },
129
+ "api_server_version": "0.0.0.dev0",
130
+ "api_status_code": 200
131
+ }
132
+ ```
133
+
134
+ Utilisation de ce jeton dans un autre appel d'API:
135
+
136
+ ```http
137
+ GET $CURRENT_URL/api/v1/user/whoami
138
+ Authorization: Bearer user:f220eb76ff8404abfece8c0c2f3368c7d89618c776bedcd3a506843dc4a952e4
139
+ ```
140
+
141
+ Notez que lorsque vous vous connectez à l'aide d'une clé d'api, les autorisations de la clé d'api continuent de s'appliquer. Ainsi, si vous essayez d'accéder à
142
+ à un point d'accès qui requiert l'autorisation "write" avec une clé API qui n'a que l'autorisation "read", cela provoquera une erreur 403
143
+ Forbidden (Interdit).
144
+
145
+ ### Authentification par jeton d'accès
146
+
147
+ En plus des méthodes d'authentification fournies en interne par Howler, vous pouvez également vous authentifier avec un fournisseur OAuth externe comme Azure ou Keycloak.
148
+ Pour ce faire, vous devez obtenir un jeton d'accès auprès de l'un de ces fournisseurs.
149
+ Pour obtenir un jeton d'accès, il y a généralement deux flux - On-Behalf-Of, ou le flux de connexion de l'utilisateur (voir [ici](https://www.rfc-editor.org/rfc/rfc6749#section-4.1) pour un récapitulatif
150
+ de cela). Dans le cas de Howler, le point de terminaison `v1/auth/login` est utilisé pour les étapes D & E du flux de connexion de l'utilisateur, et
151
+ il renvoie ce qui suit:
152
+
153
+ ```json
154
+ {
155
+ "api_response": {
156
+ "app_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyIn0",
157
+ "provider": "keycloak",
158
+ "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJyZWZyZXNoIn0"
159
+ }
160
+ }
161
+ ```
162
+
163
+ Dans ce cas, le `app_token` est le Web Token JSON que l'application utilise comme jeton d'accès. De la même manière, le
164
+ `refresh_token` est un autre JWT qui est utilisé pour rafraîchir le jeton d'accès si nécessaire. Enfin, le champ `provider` (fournisseur)
165
+ indique à quel fournisseur correspond ce jeton d'accès.
166
+
167
+ Une fois que vous avez ce jeton d'accès, vous pouvez simplement le transmettre dans l'en-tête Authorization :
168
+
169
+ ```http
170
+ GET $CURRENT_URL/api/v1/user/whoami
171
+ Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyIn0
172
+ ```
173
+
174
+ Howler détectera automatiquement qu'il s'agit d'un JWT et le traitera comme tel. Si le jeton est valide, l'utilisateur sera
175
+ authentifié.
176
+
177
+ Afin de rafraîchir un jeton d'accès expiré, vous pouvez utiliser l'appel API suivant:
178
+
179
+ ```http
180
+ POST $CURRENT_URL/api/v1/auth/login/
181
+ Content-Type: application/json
182
+
183
+ {
184
+ "oauth_provider": "keycloak",
185
+ "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJyZWZyZXNoIn0"
186
+ }
187
+ ```
188
+
189
+ Et vous obtiendrez quelque chose comme ceci en retour:
190
+
191
+ ```json
192
+ {
193
+ "api_response": {
194
+ "app_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ1c2VyMiJ9",
195
+ "provider": "keycloak",
196
+ "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJyZWZyZXNodG9rZW4yIn0"
197
+ }
198
+ }
199
+ ```
200
+
201
+ ## Impersonation
202
+
203
+ Le dernier élément important du flux d'authentification est la fonctionnalité d'usurpation d'identité. Pour qu'un compte de service
204
+ ou un autre utilisateur puisse se faire passer pour vous (c'est-à-dire créer des alertes en votre nom), Howler permet aux utilisateurs de fournir une deuxième clé API
205
+ afin de s'authentifier en tant qu'autre utilisateur.
206
+
207
+ Avant d'utiliser la clé API d'un autre utilisateur pour vous authentifier en tant que lui, il est important que la clé API que vous utilisez ait été
208
+ marquée comme valide pour l'usurpation d'identité - vérifiez auprès de l'utilisateur qui l'a fournie. Si c'est le cas, vous pouvez l'utiliser en formulant votre requête
209
+ comme suit:
210
+
211
+ ```bash
212
+ # Your credentials
213
+ echo -n "admin:devkey:admin" | base64 -w0
214
+ # -> YWRtaW46ZGV2a2V5OmFkbWlu
215
+
216
+ # Their credentials
217
+ echo -n "user:impersonate_admin:user" | base64 -w0
218
+ # -> dXNlcjppbXBlcnNvbmF0ZV9hZG1pbjp1c2Vy
219
+ ```
220
+
221
+ ```alert
222
+ Toute forme d'authentification peut être utilisée par l'usurpateur, mais les clés API validées sont la seule méthode d'authentification autorisée pour la personne dont vous usurpez l'identité.
223
+ ```
224
+
225
+ ```http
226
+ GET $CURRENT_URL/api/v1/user/whoami
227
+ Authorization: Basic YWRtaW46ZGV2a2V5OmFkbWlu
228
+ X-Impersonating: Basic dXNlcjppbXBlcnNvbmF0ZV9hZG1pbjp1c2Vy
229
+ ```
230
+
231
+ Si la configuration est correcte, le résultat sera le suivant:
232
+
233
+ ```json
234
+ {
235
+ "api_error_message": "",
236
+ "api_response": {
237
+ "avatar": null,
238
+ "classification": "TLP:W",
239
+ "email": "user@howler.cyber.gc.ca",
240
+ "groups": ["USERS"],
241
+ "is_active": true,
242
+ "is_admin": false,
243
+ "name": "User",
244
+ "roles": ["user"],
245
+ "username": "user"
246
+ },
247
+ "api_server_version": "0.0.0.dev0",
248
+ "api_status_code": 200
249
+ }
250
+ ```
251
+
252
+ Notez que le serveur a renvoyé cette requête comme si vous étiez `user`, PAS `admin`. Il est cependant clairement indiqué dans les logs que c'est vous qui faites la requête:
253
+
254
+ ```log
255
+ 22/12/05 14:15:02 INFO howler.api.security | Authenticating user for path /api/v1/user/whoami/
256
+ 22/12/05 14:15:03 WARNING howler.api.security | admin is impersonating user
257
+ 22/12/05 14:15:03 INFO howler.api.security | Logged in as user from 127.0.0.1
258
+ 22/12/05 14:15:03 INFO howler.api | GET /api/v1/user/whoami/ - 200
259
+ ```
@@ -0,0 +1,70 @@
1
+ <!-- docs/ingestion/bundles.fr.md -->
2
+
3
+ # Les groupes des hits Howler
4
+
5
+ Les groupes des hits peuvent être utilisés pour regrouper facilement un grand nombre d'alertes similaires, ce qui permet aux analystes de les traiter comme un seul incident. Prenons l'exemple d'un ordinateur qui effectue à plusieurs reprises un appel réseau vers `baddomain.ru` - bien qu'une alerte puisse être générée pour chaque cas où cet ordinateur accède à ce domaine, il est logique que les analystes traitent toutes ces alertes comme un seul et même cas.
6
+
7
+ ## Création de groupes via le client Howler
8
+
9
+ Il y a plusieurs façons de créer un groupe via le client Howler:
10
+
11
+ ```python
12
+ from howler_client import get_client
13
+
14
+ howler = get_client("https://howler.dev.analysis.cyber.gc.ca")
15
+
16
+ """Création simultanée d'un groupe howler et de hits"""
17
+ howler.bundle.create(
18
+ # Le premier argument est le hit de l'offre groupée
19
+ {
20
+ "howler.analytic": "example-test",
21
+ "howler.score": 0
22
+ },
23
+ # Le deuxième argument est un hit ou une liste de hits à inclure dans l'offre groupée.
24
+ [
25
+ {
26
+ "howler.analytic": "example-test",
27
+ "howler.score": 0
28
+ },
29
+ {
30
+ "howler.analytic": "example-test",
31
+ "howler.score": 0
32
+ }
33
+ ]
34
+ )
35
+
36
+ """Création d'un groupe howler à partir de hits existants"""
37
+ howler.bundle.create(
38
+ {
39
+ "howler.analytic": "example-test",
40
+ "howler.score": 0,
41
+ "howler.hits": ["YcUsL8QsjmwwIdstieROk", "6s7MztwuSvz6tM0PgGJhvz"]
42
+ },
43
+ # Noter: Dans les prochaines versions, vous n'aurez plus besoin d'inclure cet argument.
44
+ []
45
+ )
46
+
47
+
48
+ """Création à partir d'une carte"""
49
+ bundle_hit = {
50
+ "score": 0,
51
+ "bundle": True
52
+ }
53
+
54
+ map = {
55
+ "score": ["howler.score"],
56
+ "bundle": ["howler.is_bundle"]
57
+ }
58
+
59
+ howler.bundle.create_from_map("example-test", bundle_hit, map, [{"score": 0}])
60
+ ```
61
+
62
+ ## Visualiser les groupes sur l'interface utilisateur de Howler
63
+
64
+ Afin de visualiser les groupes créés sur l'interface utilisateur de Howler, vous pouvez utiliser la requête `howler.is_bundle:true`. Cela fournira une liste de groupes créés que vous pourrez consulter.
65
+
66
+ En cliquant sur un groupe, vous ouvrirez une interface de recherche légèrement différente de l'interface normale. Dans ce cas, nous filtrons automatiquement les résultats de la recherche pour n'inclure que les résultats inclus dans le groupe. Pour que cela soit évident, l'en-tête représentant le groupe apparaît au-dessus de la barre de recherche.
67
+
68
+ Vous pouvez continuer à filtrer les résultats en utilisant les mêmes requêtes que d'habitude et à les visualiser comme d'habitude. Lors du triage d'un groupe, son évaluation s'appliquera à tous les hits du groupe, **sauf ceux qui ont déjà été triés**. En d'autres termes, si le groupe est ouvert, tous les hits ouverts seront évalués lorsque vous l'évaluerez.
69
+
70
+ Les groupes disposent également d'un onglet **Résumé** qui n'est pas disponible pour les hits ordinaires. Cet onglet vous aidera à regrouper les données relatives à tous les résultats du groupe. Il suffit d'ouvrir l'onglet et de cliquer sur "Créer un sommaire". Notez que cette opération peut prendre un certain temps, car un grand nombre de requêtes sont exécutées pour agréger les données.