Documentation Invantiveune partie de Invantive cloud
Forums d'Invantive SupportConnectez-vous/inscrivez-vous

Configuration du filtre de requêtes

Exemples

Le JSON suivant est un exemple pour ce composant de configuration standardisé permettant de bloquer l'accès aux demandeurs qui fournissent un agent utilisateur HTTP contenant 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"
    }
  ]
}

Définition

Configuration du filtre de requêtes

{
  "$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."
    }
  }
}

Configuration du schéma de filtrage des requêtes

{
  "$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."
    }
  }
}