diff --git a/GET-%2Fprotection%2Fflexrules.md b/GET-%2Fprotection%2Fflexrules.md new file mode 100644 index 0000000..1c93648 --- /dev/null +++ b/GET-%2Fprotection%2Fflexrules.md @@ -0,0 +1,133 @@ +## **GET /protection/flexrules** + + +## **Inhalt** +--- +- Parameter +- Optionale Parameter +- Beispiel Anfrage +- Beispiel Antwort +- Mögliche Fehlermeldungen +--- + +### Parameter + +|URL Parameter | Typ | Beschreibung| +|----------|-----|-------------| +|- | -| - + +|Body Parameter | Typ | Beschreibung| +|----------|-----|-------------| +| - | - | - | + + +--- + +### Optionale Parameter + +|Query-String Parameter | Typ | Beschreibung| +|----------|-----|-------------| +|?prefix | string | Die IP-Adresse welche enthalten sein muss +|?metrics | integer | Anzahl der zurückzugebenden Übereinstimmungsmetriken (pps) (max. 500, Standard: keine) +|?time_start | string | Unix-Zeitstempel der Metriken (pps) Zeitbereich Start +|?time_end | string | Unix-Zeitstempel der Metriken (pps) Zeitbereich Ende + +--- + +### Beispiel Anfrage + +##### PHP +```php + 'control.local/api/v2/protection/flexrules', + CURLOPT_CUSTOMREQUEST => 'GET', + CURLOPT_HTTPHEADER => array( + 'X-TOKEN: test-token', + 'Content-Type: application/json' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +echo $response; +``` + +##### cURL +```bash +curl --location --request GET 'control.local/api/v2/protection/flexrules' \ +--header 'X-TOKEN: test-token' \ +--header 'Content-Type: application/json' +``` + +--- + +### Beispiel Antwort + +```json +{ + "status": "OK", + "items": [ + { + "uuid": "ABCDE-FGHI-1234-567-8910", + "seq": 1, + "from": { + "ip": { + "src": { + "start": "X.X.X.X", + "end": "X.X.X.X" + }, + "dst": "192.168.1.2/32", + "protocol": 6 + }, + "port": { + "src": { + "start": 0, + "end": 0 + }, + "dst": { + "start": 0, + "end": 0 + } + }, + "length": { + "start": 0, + "end": 0 + }, + "payload": "", + "geo": { + "asn": 0, + "country": 0 + }, + "tcp": { + "flags": false, + "syn": false, + "ack": false, + "psh": false, + "fin": false, + "urg": false, + "rst": false + } + }, + "then": { + "ratelimit": 0, + "seqjump": 0, + "action": 1, + "gqc": { + "type": 0, + "ratelimit": 0, + "passthrough": false + } + } + } + ] +} +``` + +### Mögliche Fehlermeldungen + +> :warning: Status Code **403** - Permission denied