Sistemi di notifica
Recupero di tutti i sistemi di notifica
Richiesta
Definizione
GET /api/v1/settings/notifications
Headers
-
AuthorizationrichiestoToken di autenticazione con privilegi di lettura della risorsa.
Bearer {token}
Response
Status codes
| Status code | Message |
|---|---|
| 200 | "List of notifications" |
| 403 | "Forbidden" |
Body
- Attributi
- Esempio
-
data.settings.notifications.enabledbooleanIndica se il sistema di notifica è attivo.
-
data.settings.notifications.namestringNome assegnato al sistema di notifica.
-
data.settings.notifications.settingsobjectOggetto popolato con informazioni riguardanti la destinazione e il formato dei log.
-
data.settings.notifications.settings.destination_addressstringIndirizzo IP a cui vengono inviati i log.
-
data.settings.notifications.settings.destination_portintegerPorta dell'indirizzo IP a cui vengono inviati i log.
-
data.settings.notifications.settings.formatstringFormato dei log. I due formati accettati sono
leef,cefejson. -
data.settings.notifications.settings.protocolstringProtocollo d'invio dei dati. I due valori ammessi sono
tcpeudp. -
data.settings.notifications.typestringTipo di sistema di notifica. I valori ammessi sono
siemegeneric.
{
"data": {
"notifications": [
{
"enabled": true,
"name": "siem_test",
"settings": {
"destination_address": "127.0.0.1",
"destination_port": 59999,
"format": "leef",
"protocol": "udp"
},
"type": "siem"
}
]
},
"message": "List of notifications",
"status": "ok"
}
Recupero di uno specifico sistema di notifica
Richiesta
Definizione
GET /api/v1/settings/notifications/{notification_name}
Headers
-
AuthorizationrichiestoToken di autenticazione con privilegi di lettura della risorsa.
Bearer {token}
Risposta
Codici di stato
| Codice di stato | Messaggio |
|---|---|
| 200 | "Notification retrieved" |
| 400 | "Error retrieving notifications" |
| 403 | "Forbidden" |
Body
{
"data": {
"notification": {
"enabled": true,
"name": "siem_test",
"settings": {
"destination_address": "127.0.0.1",
"destination_port": 59999,
"format": "leef",
"protocol": "udp"
},
"type": "siem"
}
},
"message": "Notification retrieved",
"status": "ok"
}
Creazione di un sistema di notifica SIEM
Richiesta
Definizione
POST /api/v1/settings/notifications
Headers
-
AuthorizationrichiestoToken di autenticazione con privilegi di lettura della risorsa.
Bearer {token} -
Content-Typerichiestoapplication/json
Corpo della richiesta
{
"notification": {
"enabled": true,
"name": "new_name",
"settings": {
"destination_address": "10.2.3.4",
"destination_port": 80,
"format": "cef",
"protocol": "udp"
},
"type": "siem"
}
}
Risposta
Codici di stato
| Codice di stato | Messaggio |
|---|---|
| 200 | "Notification created" |
| 400 | "Error creating notification" |
| 403 | "Forbidden" |
Body
{
"data": {
"notification": {
"enabled": true,
"name": "new_name",
"settings": {
"destination_address": "10.2.3.4",
"destination_port": 80,
"format": "cef",
"protocol": "udp"
},
"type": "siem"
}
},
"message": "Notification created",
"status": "ok"
}
Modifica di un sistema di notifica
Richiesta
Definizione
PUT /api/v1/settings/notifications/{notification_name}
Headers
-
AuthorizationrichiestoToken di autenticazione con privilegi di lettura della risorsa.
Bearer {token} -
Content-Typerichiestoapplication/json
Corpo della richiesta
{
"attrs": {
"settings": {
"destination_address": "10.87.2.23",
"destination_port": 10800
}
}
}
Risposta
Status codes
| Status code | Message |
|---|---|
| 200 | "Notification updated" |
| 400 | "Error updating notification" |
| 403 | "Forbidden" |
Corpo
{
"data": {
"notification": {
"enabled": true,
"name": "new_name",
"settings": {
"destination_address": "10.87.86.85",
"destination_port": 10800,
"format": "cef",
"protocol": "udp"
},
"type": "siem"
}
},
"message": "Notification updated",
"status": "ok"
}
Eliminazione di un sistema di notifica
Richiesta
Definizione
DELETE /api/v1/settings/notifications/{notification_name}
Headers
-
AuthorizationrichiestoToken di autenticazione con privilegi di lettura della risorsa.
Bearer {token}
Risposta
Status codes
| Status code | Message |
|---|---|
| 200 | "Notification deleted" |
| 400 | "Error deleting notification" |
| 403 | "Forbidden" |
Corpo
{
"data": {
"notification": {
"enabled": true,
"name": "new_name",
"settings": {
"destination_address": "10.2.3.4",
"destination_port": 80,
"format": "cef",
"protocol": "udp"
},
"type": "siem"
}
},
"message": "Notification deleted",
"status": "ok"
}