본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

XML 위협 방지 플러그인 설정 참조

원문 보기 위키 갱신

XML 위협 방지 플러그인 설정 참조 (XML Threat Protection Plugin Configuration Reference)

이 문서는 Kong의 XML Threat Protection 플러그인에서 설정할 수 있는 모든 파라미터를 참조 형식으로 정리해요. 문서 전체 크기부터 속성값, 주석, 엔티티 같은 XML 요소별 최대 크기 제한과 DTD 허용 여부를 지정하는 방법을 설명해요. 또한 Billion Laughs Attack 같은 XML 폭탄 공격을 막기 위한 증폭 한도와 임계값 설정, 검사 대상이나 예외로 허용할 Content-Type 지정 방법도 함께 다루어요

출처: 문서

본문

{
  "properties": {
    "config": {
      "properties": {
        "allow_dtd": {
          "default": false,
          "description": "Indicates whether an XML Document Type Definition (DTD) section is allowed.",
          "type": "boolean"
        },
        "allowed_content_types": {
          "default": [],
          "description": "A list of Content-Type values with payloads that are allowed, but aren't validated.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "attribute": {
          "default": 1048576,
          "description": "Maximum size of the attribute value.",
          "type": "integer"
        },
        "bla_max_amplification": {
          "default": 100,
          "description": "Sets the maximum allowed amplification. This protects against the Billion Laughs Attack.",
          "minimum": 1,
          "type": "number"
        },
        "bla_threshold": {
          "default": 8388608,
          "description": "Sets the threshold after which the protection starts. This protects against the Billion Laughs Attack.",
          "minimum": 1024,
          "type": "integer"
        },
        "buffer": {
          "default": 1048576,
          "description": "Maximum size of the unparsed buffer (see below).",
          "type": "integer"
        },
        "checked_content_types": {
          "default": [
            "application/xml"
          ],
          "description": "A list of Content-Type values with payloads that must be validated.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "comment": {
          "default": 1024,
          "description": "Maximum size of comments.",
          "type": "integer"
        },
        "document": {
          "default": 10485760,
          "description": "Maximum size of the entire document.",
          "type": "integer"
        },
        "entity": {
          "default": 1024,
          "description": "Maximum size of entity values in EntityDecl.",
          "type": "integer"
        },
        "entityname": {
          "default": 1024,
          "description": "Maximum size of entity names in EntityDecl.",
          "type": "integer"
        },
        "entityproperty": {
          "default": 1024,
          "description": "Maximum size of systemId, publicId, or notationName in EntityDecl.",
          "type": "integer"
        },
        "localname": {
          "default": 1024,
          "description": "Maximum size of the localname. This applies to tags and attributes.",
          "type": "integer"
        },
        "max_attributes": {
          "default": 100,
          "description": "Maximum number of attributes allowed on a tag, including default ones. Note: If namespace-aware parsing is disabled, then the namespaces definitions are counted as attributes.",
          "type": "integer"
        },
        "max_children": {
          "default": 100,
          "description": "Maximum number of children allowed (Element, Text, Comment, ProcessingInstruction, CDATASection). Note: Adjacent text and CDATA sections are counted as one. For example, text-cdata-text-cdata is one child.",
          "type": "integer"
        },
        "max_depth": {
          "default": 50,
          "description": "Maximum depth of tags. Child elements such as Text or Comments are not counted as another level.",
          "type": "integer"
        },
        "max_namespaces": {
          "default": 20,
          "description": "Maximum number of namespaces defined on a tag. This value is required if parsing is namespace-aware.",
          "type": "integer"
        },
        "namespace_aware": {
          "default": true,
          "description": "If not parsing namespace aware, all prefixes and namespace attributes will be counted as regular attributes and element names, and validated as such.",
          "type": "boolean"
        },
        "namespaceuri": {
          "default": 1024,
          "description": "Maximum size of the namespace URI. This value is required if parsing is namespace-aware.",
          "type": "integer"
        },
        "pidata": {
          "default": 1024,
          "description": "Maximum size of processing instruction data.",
          "type": "integer"
        },
        "pitarget": {
          "default": 1024,
          "description": "Maximum size of processing instruction targets.",
          "type": "integer"
        },
        "prefix": {
          "default": 1024,
          "description": "Maximum size of the prefix. This applies to tags and attributes. This value is required if parsing is namespace-aware.",
          "type": "integer"
        },
        "text": {
          "default": 1048576,
          "description": "Maximum text inside tags (counted over all adjacent text/CDATA elements combined).",
          "type": "integer"
        }
      },
      "type": "object"
    },
    "consumer": {
      "additionalProperties": false,
      "description": "If set, the plugin will activate only for requests where the specified has been authenticated. (Note that some plugins can not be restricted to consumers this way.). Leave unset for the plugin to activate regardless of the authenticated Consumer.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "expressions": {
      "additionalProperties": true,
      "type": "object"
    },
    "protocols": {
      "default": [
        "grpc",
        "grpcs",
        "http",
        "https"
      ],
      "description": "A set of strings representing HTTP protocols.",
      "items": {
        "enum": [
          "grpc",
          "grpcs",
          "http",
          "https"
        ],
        "type": "string"
      },
      "type": "array"
    },
    "route": {
      "additionalProperties": false,
      "description": "If set, the plugin will only activate when receiving requests via the specified route. Leave unset for the plugin to activate regardless of the route being used.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "service": {
      "additionalProperties": false,
      "description": "If set, the plugin will only activate when receiving requests via one of the routes belonging to the specified Service. Leave unset for the plugin to activate regardless of the Service being matched.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    }
  }
}

관련 리소스

더 알아보기 (Learn more)

  • XML 대신 JSON 페이로드의 위협을 검사할 때 사용하는 유사 플러그인의 설정 참조도 함께 확인하면 좋아요 — JSON Threat Protection plugin