Documentación de Invantiveparte de Invantive Cloud
Foros de Soporte de InvantiveIniciar Sesión / Registrarse

Configuración del filtro de solicitudes

Ejemplos

El siguiente JSON es un ejemplo de este componente de configuración estandarizado para bloquear el acceso a los solicitantes que envíen un agente de usuario HTTP que contenga https://leakix.net:

{ "Patterns":
  [ { "Pattern": "https://leakix.net"
    , "Probability": 1.0
    , "MatchOnPath": false
    , "MatchOnIpAddress": false
    , "MatchOnUserAgent": true
    , "HttpStatusCode": 401
    , "PatternCode": "itgenclr999"
    , "MessageCode": "itgenclr999-001"
    , "MessageText": "Blocked."
    , "InternalNotes": "Blocked leakix."
    , "DateStartUtc": "2023-01-01"
    }
  ]
}

Definición

Configuración del filtro de solicitudes

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://invantive.com/schemas/defs/RequestFilterConfig.schema.json",
  "title": "RequestFilterConfig",
  "description": "Request filtering configuration.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "Patterns": {
      "type": ["array", "null"],
      "items": {
        "$ref": "./RequestFilterPatternConfig.schema.json"
      },
      "description": "Filter patterns."
    }
  }
}

Configuración del patrón del filtro de solicitudes

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://invantive.com/schemas/defs/RequestFilterPatternConfig.schema.json",
  "title": "RequestFilterPatternConfig",
  "description": "Request filter pattern configuration.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "Pattern": {
      "type": ["string", "null"],
      "description": "Regular expression pattern."
    },
    "Probability": {
      "type": ["number", "null"],
      "description": "Desired probability of the request failing (in value range 0..1)."
    },
    "MatchOnPath": {
      "type": "boolean",
      "description": "Whether to match on path.",
      "default": true
    },
    "MatchOnIpAddress": {
      "type": "boolean",
      "description": "Whether to match on IP address.",
      "default": true
    },
    "MatchOnUserAgent": {
      "type": "boolean",
      "description": "Whether to match on user agent.",
      "default": true
    },
    "HttpStatusCode": {
      "type": ["integer", "null"],
      "description": "HTTP status response code on match."
    },
    "PatternCode": {
      "type": ["string", "null"],
      "description": "Identifying code."
    },
    "MessageCode": {
      "type": ["string", "null"],
      "description": "Response message code."
    },
    "MessageText": {
      "type": ["string", "null"],
      "description": "Response message text."
    },
    "InternalNotes": {
      "type": ["string", "null"],
      "description": "Internal notes such as reason why filter applies."
    },
    "DateStartUtc": {
      "type": ["string", "null"],
      "format": "date-time",
      "description": "Start date (UTC) for match."
    },
    "DateEndUtc": {
      "type": ["string", "null"],
      "format": "date-time",
      "description": "End date (UTC) for match."
    }
  }
}