Passer au contenu principal
PATCH
https://{tenantDomain}/api/v2
/
attack-protection
/
suspicious-ip-throttling
Go
package example

import (
    context "context"

    attackprotection "github.com/auth0/go-auth0/management/management/attackprotection"
    client "github.com/auth0/go-auth0/management/management/client"
    option "github.com/auth0/go-auth0/management/management/option"
)

func do() {
    client := client.NewClient(
        option.WithToken(
            "<token>",
        ),
    )
    request := &attackprotection.UpdateSuspiciousIpThrottlingSettingsRequestContent{}
    client.AttackProtection.SuspiciousIpThrottling.Update(
        context.TODO(),
        request,
    )
}
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.attackProtection.suspiciousIpThrottling.update({});
}
main();
import { ManagementClient } from "auth0";

async function main() {
    const client = new ManagementClient({
        token: "<token>",
    });
    await client.attackProtection.suspiciousIpThrottling.update({});
}
main();
curl --request PATCH \
  --url https://{tenantDomain}/api/v2/attack-protection/suspicious-ip-throttling \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "enabled": true,
  "shields": [],
  "allowlist": [
    "127.0.0.1"
  ],
  "stage": {
    "pre-login": {
      "max_attempts": 100,
      "rate": 864000
    },
    "pre-user-registration": {
      "max_attempts": 50,
      "rate": 1728000
    }
  }
}
'
import requests

url = "https://{tenantDomain}/api/v2/attack-protection/suspicious-ip-throttling"

payload = {
    "enabled": True,
    "shields": [],
    "allowlist": ["127.0.0.1"],
    "stage": {
        "pre-login": {
            "max_attempts": 100,
            "rate": 864000
        },
        "pre-user-registration": {
            "max_attempts": 50,
            "rate": 1728000
        }
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://{tenantDomain}/api/v2/attack-protection/suspicious-ip-throttling",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PATCH",
  CURLOPT_POSTFIELDS => json_encode([
    'enabled' => true,
    'shields' => [
        
    ],
    'allowlist' => [
        '127.0.0.1'
    ],
    'stage' => [
        'pre-login' => [
                'max_attempts' => 100,
                'rate' => 864000
        ],
        'pre-user-registration' => [
                'max_attempts' => 50,
                'rate' => 1728000
        ]
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
HttpResponse<String> response = Unirest.patch("https://{tenantDomain}/api/v2/attack-protection/suspicious-ip-throttling")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"enabled\": true,\n  \"shields\": [],\n  \"allowlist\": [\n    \"127.0.0.1\"\n  ],\n  \"stage\": {\n    \"pre-login\": {\n      \"max_attempts\": 100,\n      \"rate\": 864000\n    },\n    \"pre-user-registration\": {\n      \"max_attempts\": 50,\n      \"rate\": 1728000\n    }\n  }\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://{tenantDomain}/api/v2/attack-protection/suspicious-ip-throttling")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"enabled\": true,\n  \"shields\": [],\n  \"allowlist\": [\n    \"127.0.0.1\"\n  ],\n  \"stage\": {\n    \"pre-login\": {\n      \"max_attempts\": 100,\n      \"rate\": 864000\n    },\n    \"pre-user-registration\": {\n      \"max_attempts\": 50,\n      \"rate\": 1728000\n    }\n  }\n}"

response = http.request(request)
puts response.read_body
{
  "enabled": true,
  "shields": [],
  "allowlist": [
    "127.0.0.1"
  ],
  "stage": {
    "pre-login": {
      "max_attempts": 100,
      "rate": 864000
    },
    "pre-user-registration": {
      "max_attempts": 50,
      "rate": 1728000
    }
  }
}

Autorisations

Authorization
string
header
requis

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Corps

enabled
boolean

Whether or not suspicious IP throttling attack protections are active.

shields
enum<string>[]

Action to take when a suspicious IP throttling threshold is violated. Possible values: block, admin_notification.

Options disponibles:
block,
admin_notification
allowlist
(string<ipv4> | string<cidr> | string<ipv6> | string<ipv6_cidr>)[]

List of trusted IP addresses that will not have attack protection enforced against them.

stage
object

Holds per-stage configuration options (max_attempts and rate).

Réponse

Suspicious IP throttling configuration successfully updated.

enabled
boolean

Whether or not suspicious IP throttling attack protections are active.

shields
enum<string>[]

Action to take when a suspicious IP throttling threshold is violated. Possible values: block, admin_notification.

Options disponibles:
block,
admin_notification
allowlist
(string<ipv4> | string<cidr> | string<ipv6> | string<ipv6_cidr>)[]

List of trusted IP addresses that will not have attack protection enforced against them.

stage
object

Holds per-stage configuration options (max_attempts and rate).