JSON 위협 보호 런타임 오류 문제 해결

현재 Apigee Edge 문서가 표시되고 있습니다.
Apigee X 문서로 이동
정보

ExecutionFailed

오류 코드

steps.jsonthreatprotection.ExecutionFailed

오류 응답 본문

{
    "fault": {
        "faultstring": "JSONThreatProtection[policy_name]:
          Execution failed. reason: JSONThreatProtection[policy_name]: error_description
          at line line_num",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

오류 유형 및 가능한 원인

JSONThreatProtection 정책은 다양한 유형의 ExecutionFailed 오류를 발생시킬 수 있습니다. 아래 표에는 다양한 오류 유형과 가능한 원인이 나와 있습니다.

오류 유형 원인
객체 항목 이름 길이 초과 객체의 항목 이름에 허용되는 최대 문자열 길이를 초과했습니다.
객체 항목 수 초과 객체에 허용되는 최대 항목 수를 초과했습니다.
배열 요소 수 초과 배열에서 허용되는 최대 요소 수를 초과했습니다.
컨테이너 깊이 초과 허용되는 최대 중첩 깊이를 초과했습니다.
문자열 값 길이를 초과했습니다. 문자열 값에 허용되는 최대 길이를 초과했습니다.
잘못된 JSON 객체 입력 JSON 페이로드가 잘못되었습니다.

객체 항목 이름 길이 초과

오류 응답 본문

{
    "fault": {
        "faultstring": "JSONThreatProtection[policy_name]:
          Execution failed. reason: JSONThreatProtection[policy_name]:
          Exceeded object entry name length at line line_num",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

오류 응답 본문 예시

{
    "fault": {
        "faultstring": "JSONThreatProtection[JSON-Threat-Protection-1]:
          Execution failed. reason: JSONThreatProtection[JSON-Threat-Protection-1]:
          Exceeded object entry name length at line 2",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

원인

이 오류는 <Source> 요소에서 지정된 입력 메시지 페이로드에 속성 이름이 <ObjectEntryNameLength> 요소에 지정된 최대 길이를 초과하는 JSON 객체를 포함하는 경우 발생합니다.

예를 들어 정책에서 <ObjectEntryNameLength> 요소가 5로 지정되었지만 입력 메시지 페이로드에 이름이 5자(영문 기준)를 초과하는 JSON 속성이 포함된 경우 이 오류가 발생합니다.

진단

  1. 오류 메시지를 검토하여 JSONThreatProtection 정책 이름 및 긴 항목 이름이 발생하는 줄 번호를 식별합니다. 예를 들어 다음 오류 메시지에서 JSONThreatProtection 정책 이름은 JSON-Threat-Protection-1이고 페이로드의 줄 번호는 2입니다.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded object entry name
    length at line 2
    
  2. 1단계에서 확인한 정책을 검토하고 <ObjectEntryNameLength> 요소에 지정된 값을 확인합니다.

    예를 들어 다음 JSONThreatProtection 정책에서 <ObjectEntryNameLength>5로 설정되었습니다.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
        <DisplayName>JSON Threat Protection-1</DisplayName>
        <Properties/>
        <ArrayElementCount>3</ArrayElementCount>
        <ContainerDepth>12</ContainerDepth>
        <ObjectEntryCount>5</ObjectEntryCount>
        <ObjectEntryNameLength>5</ObjectEntryNameLength>
        <Source>request</Source>
        <StringValueLength>50</StringValueLength>
    </JSONThreatProtection>
    
  3. 입력 페이로드의 특정 행 번호(1단계에서 확인됨)를 검토하고 객체 이름의 길이가 2단계에서 확인된 <ObjectEntryNameLength> 요소에 지정된 값보다 큰지 점검합니다. 객체 이름 길이가 해당 숫자를 초과하면 이것이 오류의 원인입니다.

    다음은 입력 페이로드의 예시입니다.

    {
       "number" : 500,
       "string" : "text"
    }
    

    위에 표시된 JSON 페이로드에는 6자(이름 길이가 6임)인 2행에 number라는 속성이 있습니다. 객체 이름의 길이가 5(<ObjectEntryNameLength> 요소에 지정된 값)보다 크므로 다음과 같은 오류가 발생합니다.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded object entry name
    length at line 2
    

해상도

JSONThreatProtection 정책이 정의된 값을 초과하는 객체 항목 이름이 있는 페이로드로부터 보호하기 위한 것이라면 오류 메시지가 표시됩니다. 이 경우에는 추가 조치를 취할 필요가 없습니다.

그러나 더 긴 객체 항목 이름을 어떠한 결과도 없이 페이로드에 지정할 수 있다고 판단되면 <ObjectEntryNameLength>를 요구사항에 따라 적절한 값으로 수정합니다.

예를 들어 최대 10자의 객체 이름을 허용할 수 있다고 생각되면 다음과 같이 JSONThreatProtection 정책을 수정합니다.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
    <DisplayName>JSON Threat Protection-1</DisplayName>
    <Properties/>
    <ArrayElementCount>3</ArrayElementCount>
    <ContainerDepth>12</ContainerDepth>
    <ObjectEntryCount>5</ObjectEntryCount>
    <ObjectEntryNameLength>10</ObjectEntryNameLength>
    <Source>request</Source>
    <StringValueLength>50</StringValueLength>
</JSONThreatProtection>

객체 항목 수 초과

오류 응답 본문

{
    "fault": {
        "faultstring": "JSONThreatProtection[policy_name]:
          Execution failed. reason: JSONThreatProtection[policy_name]:
          Exceeded object entry count at line line_num",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

오류 응답 본문 예시

{
    "fault": {
        "faultstring": "JSONThreatProtection[JSON-Threat-Protection-1]:
          Execution failed. reason: JSONThreatProtection[JSON-Threat-Protection-1]:
          Exceeded object entry count at line 7",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

원인

이 오류는 <Source> 요소에서 지정된 입력 메시지 페이로드가 정책의 <ObjectEntryCount> 요소에 지정된 값보다 많은 항목(속성)을 포함하는 JSON 객체를 포함하는 경우 발생합니다.

예를 들어 <ObjectEntryCount> 요소가 5이지만 입력 JSON 페이로드에 항목이 5개 넘게 있으면 이 오류가 발생합니다.

진단

  1. 오류 메시지를 검토하여 JSONThreatProtection 정책 이름 및 항목 수를 초과하는 행 번호를 확인합니다. 예를 들어 다음 오류 메시지에서 정책 이름은 JSON-Threat-Protection-1이고 페이로드의 행 번호는 7입니다.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded object entry count
    at line 7
    
  2. 1단계에서 확인된 정책의 <ObjectEntryCount> 요소에 지정된 값을 기록해 둡니다.

    다음 정책 예시에서는 <ObjectEntryCount>5로 설정되었습니다.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
        <DisplayName>JSON Threat Protection-1</DisplayName>
        <Properties/>
        <ArrayElementCount>3</ArrayElementCount>
        <ContainerDepth>12</ContainerDepth>
        <ObjectEntryCount>5</ObjectEntryCount>
        <ObjectEntryNameLength>6</ObjectEntryNameLength>
        <Source>request</Source>
        <StringValueLength>50</StringValueLength>
    </JSONThreatProtection>
    
  3. 입력 페이로드의 특정 행 번호(1단계에서 확인됨)를 검토하고 페이로드의 항목 수가 <ObjectEntryCount> 요소에 지정된 값(2단계에서 확인됨)보다 큰지 점검합니다. 객체 수가 객체 항목 수를 초과하면 이것이 오류의 원인입니다.

    다음은 입력 페이로드의 예시입니다.

    {
    "name" : "John",
    "id" : 234687,
    "age" : 31,
    "city" : "New York",
    "country" : "USA",
    "company" : "Google"
    }
    

    위에 표시된 JSON 페이로드에서 6번째 항목은 7번 줄(회사)에 발생합니다. 입력 JSON 페이로드의 객체 항목 수가 5(<ObjectEntryCount> 요소에 지정된 값)를 초과하므로 다음 오류가 발생합니다.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded object entry count at
    line 7
    

해상도

JSONThreatProtection 정책이 특정 기준을 초과하는 여러 객체 항목이 포함된 페이로드로부터 보호하기 위한 것이라면 오류 메시지가 표시됩니다. 이 경우에는 추가 조치를 취할 필요가 없습니다.

그러나 어떠한 결과도 없이 페이로드에 더 많은 객체 항목이 포함될 수 있다고 판단되면 요구사항에 따라 <ObjectEntryCount>를 적절한 값으로 수정합니다.

예를 들어 최대 10개의 객체 항목을 허용할 수 있다고 생각되면 다음과 같이 JSONThreatProtection 정책을 수정합니다.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
    <DisplayName>JSON Threat Protection-1</DisplayName>
    <Properties/>
    <ArrayElementCount>3</ArrayElementCount>
    <ContainerDepth>12</ContainerDepth>
    <ObjectEntryCount>10</ObjectEntryCount>
    <ObjectEntryNameLength>6</ObjectEntryNameLength>
    <Source>request</Source>
    <StringValueLength>50</StringValueLength>
</JSONThreatProtection>

배열 요소 수 초과

오류 응답 본문

{
    "fault": {
        "faultstring": "JSONThreatProtection[policy_name]:
          Execution failed. reason: JSONThreatProtection[policy_name]:
          Exceeded array element count at line line-num",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

오류 응답 본문 예시

{
    "fault": {
        "faultstring": "JSONThreatProtection[JSON-Threat-Protection-1]:
          Execution failed. reason: JSONThreatProtection[JSON-Threat-Protection-1]:
          Exceeded array element count at line 3",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

원인

이 오류는 <Source> 요소로 지정된 입력 메시지 페이로드에 정책의 <ArrayElementCount> 요소에 지정된 수보다 많은 요소가 포함된 JSON 배열이 포함 된 경우 발생합니다.

예를 들어 <ArrayElementCount> 요소가 3으로 지정되었지만 입력 페이로드에 요소가 3개 넘게 있는 JSON 배열이 있는 경우 이 오류가 발생합니다.

진단

  1. 오류 메시지를 검토하여 정책 이름과 배열 길이가 초과된 행 번호를 확인합니다. 예를 들어 다음 오류 메시지에서 정책 이름은 JSON-Threat-Protection-1이고 페이로드의 행 번호는 3입니다.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded array element count at line 3
    
  2. 1단계에서 확인된 정책의 <ArrayElementCount> 요소에 지정된 값을 기록해 둡니다.

    다음 JSONThreatProtection 정책 예시에서 <ArrayElementCount>3으로 설정되었습니다.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
        <DisplayName>JSON Threat Protection-1</DisplayName>
        <Properties/>
        <ArrayElementCount>3</ArrayElementCount>
        <ContainerDepth>12</ContainerDepth>
        <ObjectEntryCount>5</ObjectEntryCount>
        <ObjectEntryNameLength>6</ObjectEntryNameLength>
        <Source>request</Source>
        <StringValueLength>50</StringValueLength>
    </JSONThreatProtection>
    
  3. 입력 페이로드의 특정 행 번호(1단계에서 확인됨)를 검토하고 지정된 배열에 <ArrayElementCount> 요소에 지정된 수(2단계에서 확인됨)보다 많은 요소가 있는지 확인합니다. 배열 요소 수가 해당 수를 초과하면 이것이 오류가 원인입니다.

    다음은 입력 페이로드의 예시입니다.

    {
     "name":"Ford",
     "models":[
        "Mustang",
        "Endeavour",
        "Fiesta",
        "EcoSport",
        "Focus"
     ]
    }
    

    위에 표시된 JSON 페이로드는 3행에서 models라는 배열에 5개의 요소가 있습니다. 배열 요소 수가 3개(<ArrayElementCount> 요소에 지정된 값)보다 크기 때문에 다음 오류가 발생합니다.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded array element count
    at line 3
    

해상도

JSONThreatProtection 정책이 특정 배열 카운트 임계값으로 페이로드로부터 보호하기 위한 것이라면 오류 메시지가 표시됩니다. 이 경우에는 추가 작업이 필요하지 않습니다.

그러나 배열에서 더 많은 수의 요소가 허용될 수 있다고 판단되면 요구사항에 따라 <ArrayElementCount>를 적절한 값으로 수정합니다.

예를 들어 최대 5개의 배열 요소를 허용할 수 있다고 생각되면 다음과 같이 정책을 수정합니다.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
    <DisplayName>JSON Threat Protection-1</DisplayName>
    <Properties/>
    <ArrayElementCount>5</ArrayElementCount>
    <ContainerDepth>12</ContainerDepth>
    <ObjectEntryCount>5</ObjectEntryCount>
    <ObjectEntryNameLength>6</ObjectEntryNameLength>
    <Source>request</Source>
    <StringValueLength>50</StringValueLength>
</JSONThreatProtection>

컨테이너 깊이 초과

오류 응답 본문

런타임 트래픽은 다음 오류와 함께 500 응답 코드를 반환합니다.

{
    "fault": {
        "faultstring": "JSONThreatProtection[policy_name]:
          Execution failed. reason: JSONThreatProtection[policy_name]:
          Exceeded container depth at line line-num",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

오류 응답 본문 예시

{
    "fault": {
        "faultstring": "JSONThreatProtection[JSON-Threat-Protection-1]:
          Execution failed. reason: JSONThreatProtection[JSON-Threat-Protection-1]:
          Exceeded container depth at line 5",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

원인

이 오류는 <Source> 요소로 지정된 입력 메시지 페이로드가 정책의 <ContainerDepth> 요소에 지정된 최대 컨테이너 깊이를 초과하는 JSON 요소가 포함된 JSON 객체를 포함하는 경우에 발생합니다. 컨테이너 깊이는 JSON 요소에 허용되는 최대 중첩 깊이입니다. 예를 들어 객체를 포함하는 객체가 포함된 배열은 컨테이너 깊이가 3입니다.

예를 들어 <ContainerDepth> 요소가 3이지만 입력 페이로드의 컨테이너 깊이가 이 제한을 초과하면 이 오류가 발생합니다.

진단

  1. 오류 메시지를 검토하여 JSONThreatProtection 정책 이름 및 컨테이너 깊이를 초과하는 줄 번호를 확인합니다. 예를 들어 다음 오류 메시지에서 정책 이름은 JSON-Threat-Protection-1이고 페이로드의 줄 번호는 5입니다.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded container depth at
    line 5
    
  2. <ContainerDepth> 요소에 지정된 값(1단계에서 확인됨)을 기록해 둡니다.

    다음 JSONThreatProtection 정책 예시에서 <ContainerDepth>5으로 설정되었습니다.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
        <DisplayName>JSON Threat Protection-1</DisplayName>
        <Properties/>
        <ArrayElementCount>3</ArrayElementCount>
        <ContainerDepth>5</ContainerDepth>
        <ObjectEntryCount>5</ObjectEntryCount>
        <ObjectEntryNameLength>20</ObjectEntryNameLength>
        <Source>request</Source>
        <StringValueLength>50</StringValueLength>
    </JSONThreatProtection>
    
  3. 입력 페이로드의 특정 행 번호(1단계에서 확인됨)를 검토하고 페이로드의 컨테이너 깊이가 <ContainerDepth> 요소에 지정된 값(2단계에서 확인됨)보다 큰지 점검합니다. 컨테이너 깊이가 해당 값을 초과하면 이것이 오류의 원인입니다.

    다음은 입력 페이로드의 예시입니다.

    {
     "ContainerDepth2":[ {
           "ContainerDepth4":[
              {
                 "ContainerDepth6":[
                    "1",
                    "2"
                 ]
              }
           ]
        }
     ]
    }
    

    위에 표시된 JSON 페이로드의 컨테이너 깊이는 5행에서 6입니다. 깊이가 5보다 크므로 JSONThreatProtection 정책의 <ContainerDepth> 요소에 지정된 값으로 인해 다음 오류가 발생합니다.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded container depth at
    line 5
    

해상도

JSONThreatProtection 정책이 지정된 값을 초과하는 컨테이너 깊이가 포함된 페이로드로부터 보호하기 위한 것이라면 오류 메시지가 표시됩니다. 이 경우에는 추가 작업이 필요하지 않습니다.

그러나 더 높은 컨테이너 깊이가 허용될 수 있다고 판단되면 <ContainerDepth>를 필요에 따라 적절한 값으로 수정합니다.

예를 들어 컨테이너 깊이를 최대 10까지 허용할 수 있다고 생각되면 다음과 같이 정책을 수정하세요.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
    <DisplayName>JSON Threat Protection-1</DisplayName>
    <Properties/>
    <ArrayElementCount>3</ArrayElementCount>
    <ContainerDepth>10</ContainerDepth>
    <ObjectEntryCount>5</ObjectEntryCount>
    <ObjectEntryNameLength>20</ObjectEntryNameLength>
    <Source>request</Source>
    <StringValueLength>50</StringValueLength>
</JSONThreatProtection>

문자열 값 길이 초과

오류 응답 본문

{
    "fault": {
        "faultstring": "JSONThreatProtection[policy_name]:
          Execution failed. reason: JSONThreatProtection[policy_name]:
          Exceeded string value length at line line-num",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

오류 응답 본문 예시

{
    "fault": {
        "faultstring": "JSONThreatProtection[JSON-Threat-Protection-1]:
          Execution failed. reason: JSONThreatProtection[JSON-Threat-Protection-1]:
          Exceeded string value length at line 3",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

원인

이 오류는 <Source> 요소로 지정된 입력 메시지 페이로드에 <StringValueLength> 요소에서 허용되는 것보다 더 많은 문자 값이 있는 JSON 요소가 포함된 경우 발생합니다.

예를 들어 정책에서 <StringValueLength> 요소가 50으로 설정되어 있지만 입력 페이로드에 값이 50자를 초과하는 요소가 하나 이상 있는 경우 이 오류가 발생합니다.

진단

  1. 오류 메시지를 검토하여 정책 이름과 문자열 길이가 초과된 행 번호를 확인합니다. 다음 예시에서 정책 이름은 페이로드 3JSON-Threat-Protection-1 and 행입니다.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded string value length at line 3
    
  2. 1단계에서 확인된 <StringValueLength> 요소에 지정된 값을 기록해 둡니다.

    다음 JSONThreatProtection 정책 예시에서는 <StringValueLength>50으로 설정되었습니다.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
        <DisplayName>JSON Threat Protection-1</DisplayName>
        <Properties/>
        <ArrayElementCount>3</ArrayElementCount>
        <ContainerDepth>5</ContainerDepth>
        <ObjectEntryCount>5</ObjectEntryCount>
        <ObjectEntryNameLength>20</ObjectEntryNameLength>
        <Source>request</Source>
        <StringValueLength>50</StringValueLength>
    </JSONThreatProtection>
    
  3. 입력 페이로드의 특정 행 번호(1단계에서 확인됨)를 검토하고 값 길이가 <StringValueLength> 요소에 지정된 문자 수(2단계에서 확인됨)보다 큰지 점검합니다. 값 길이가 한도를 초과하면 이것이 오류의 원인입니다.

    다음은 입력 페이로드의 예시입니다.

    {
      "Country": "New Zealand",
      "Place Name": "Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu"
    }
    

    위 JSON 페이로드에는 Place Name이라는 객체가 있으며, 이 객체의 값 Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu는 3행에서 85자입니다. 값의 길이가 <StringValueLength> 요소에 지정된 값인 50보다 크므로 다음 오류가 발생합니다.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    JSONThreatProtection[JSON-Threat-Protection-1]: Exceeded string value length
    at line 3
    

해상도

JSONThreatProtection 정책이 특정 문자열 길이를 초과하는 페이로드로부터 보호하기 위한 것이라면 오류 메시지가 표시됩니다. 이 경우에는 추가 작업이 필요하지 않습니다.

그러나 페이로드에 더 긴 값 길이를 지정할 수 있다고 판단되는 경우 <StringValueLength>를 요구사항에 따라 적절한 값으로 수정합니다.

예를 들어 길이를 최대 90까지 허용할 수 있다고 생각되면 다음과 같이 정책을 수정합니다.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
    <DisplayName>JSON Threat Protection-1</DisplayName>
    <Properties/>
    <ArrayElementCount>3</ArrayElementCount>
    <ContainerDepth>5</ContainerDepth>
    <ObjectEntryCount>5</ObjectEntryCount>
    <ObjectEntryNameLength>20</ObjectEntryNameLength>
    <Source>request</Source>
    <StringValueLength>90</StringValueLength>
</JSONThreatProtection>

잘못된 JSON 객체

오류 응답 본문

{
    "fault": {
        "faultstring": "JSONThreatProtection[policy_name]:
          Execution failed. reason: string: at line line-num",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

오류 응답 본문 예시

{
    "fault": {
        "faultstring": "JSONThreatProtection[JSON-Threat-Protection-1]:
          Execution failed. reason: Expecting : at line 3",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.ExecutionFailed"
        }
    }
}

원인

이 오류는 JSONThreatProtection 정책의 <Source> 요소에서 지정된 입력 메시지 페이로드가 유효한 JSON 객체가 아닌 경우에 발생합니다.

진단

  1. 오류 메시지를 검토하여 정책 이름과 오류가 발생한 행 번호를 확인합니다. 다음 예시에서 정책 이름은 페이로드 2JSON-Threat-Protection-1 and 행입니다.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason: Expecting : at line 3
    
  2. 입력 페이로드의 특정 행 번호(1단계에서 확인됨)를 검토하고 페이로드로 전달된 JSON 객체가 실제로 유효한 JSON 객체인지 점검합니다.

    다음은 입력 페이로드의 예시입니다.

    {
      "Longitude": 6.11499,
      "Latitude"  50.76891
    }
    

    위의 JSON 페이로드에서 3번째 줄에는 ":"(콜론)이 없습니다. 유효한 JSON 객체가 아니므로 다음 오류가 발생합니다.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason:
    Expecting : at line 3
    

해상도

유효한 입력 JSON 페이로드가 JSONThreatProtection 정책이 포함된 API 프록시로 전달되는지 확인합니다.

위에 설명된 예시에서는 다음과 같이 JSON 페이로드를 수정합니다.

{
    "Longitude": 6.11499,
  "Latitude" : 50.76891
}

SourceUnavailable

오류 코드

steps.jsonthreatprotection.SourceUnavailable

오류 응답 본문

{
    "fault": {
        "faultstring": "JSONThreatProtection[policy_name]::
          Source[var_name] is not available"
        "detail": {
            "errorcode": "steps.jsonthreatprotection.SourceUnavailable"
        }
    }
}

오류 응답 본문 예시

{
    "fault": {
        "faultstring": "JSONThreatProtection[JSON-Threat-Protection-1]::
          Source requests is not available",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.SourceUnavailable"
        }
    }
}

원인

이 오류는 JSONThreatProtection 정책의 <Source> 요소에 지정된 message 변수가 다음 중 하나일 때 발생합니다.

  • 범위를 벗어난 경우(정책이 실행 중인 특정 흐름에서 사용할 수 없음)
  • 유효한 값 request, response 또는 message 중 하나가 아님

예를 들어 정책의 <Source> 요소가 정책이 실행되는 흐름에 존재하지 않는 변수로 설정된 경우 이 오류가 발생합니다.

진단

  1. 오류 메시지에서 정책 이름과 소스 변수의 이름을 식별합니다. 예를 들어 다음 오류 메시지에서 정책 이름은 JSON-Threat-Protection-1이고 소스 변수는 requests입니다.

    JSONThreatProtection[JSON-Threat-Protection-1]:: Source requests is not available
    
  2. 1단계에서 확인된 <Source> 요소에 지정된 값을 검토합니다.

    다음 JSONThreatProtection 정책 예시에서는 <Source> 요소가 requests로 설정되었습니다.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
        <DisplayName>JSON Threat Protection-1</DisplayName>
        <Properties/>
        <ArrayElementCount>3</ArrayElementCount>
        <ContainerDepth>5</ContainerDepth>
        <ObjectEntryCount>5</ObjectEntryCount>
        <ObjectEntryNameLength>20</ObjectEntryNameLength>
        <Source>requests</Source>
        <StringValueLength>50</StringValueLength>
    </JSONThreatProtection>
    

    <Source> 요소의 유효한 값은 request, response, message입니다. 요청은 유효한 값이 아니며 정책이 실행되는 흐름에 없으므로 오류가 발생합니다.

    JSONThreatProtection[JSON-Threat-Protection-1]:: Source requests is not available
    

해상도

실패한 JSONThreatProtection 정책의 <Source> 요소에 설정된 변수가 request, response 또는 message로 설정되어 있고 정책이 실행되는 흐름에 존재하는지 확인합니다.

위의 JSONThreatProtection 정책 예시를 수정하려면 응답 흐름에 request 변수가 있으므로 이를 사용하기 위해 <Source> 요소를 수정할 수 있습니다.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
    <DisplayName>JSON Threat Protection-1</DisplayName>
    <Properties/>
    <ArrayElementCount>3</ArrayElementCount>
    <ContainerDepth>5</ContainerDepth>
    <ObjectEntryCount>5</ObjectEntryCount>
    <ObjectEntryNameLength>20</ObjectEntryNameLength>
    <Source>request</Source>
    <StringValueLength>50</StringValueLength>
</JSONThreatProtection>

NonMessageVariable

오류 코드

steps.jsonthreatprotection.NonMessageVariable

오류 응답 본문

{
    "fault": {
        "faultstring": "JSONThreatProtection[policy_name]:
          Variable var_name does not resolve to a Message"
        "detail": {
            "errorcode": "steps.jsonthreatprotection.NonMessageVariable"
        }
    }
}

오류 응답 본문 예시

{
    "fault": {
        "faultstring": "JSONThreatProtection[JSON-Threat-Protection-1]:
          Variable message.content does not resolve to a Message",
        "detail": {
            "errorcode": "steps.jsonthreatprotection.NonMessageVariable"
        }
    }
}

원인

이 오류는 JSONThreatProtection 정책의 <Source> 요소가 메시지 유형이 아닌 변수로 설정된 경우 발생합니다.

메시지 유형 변수는 전체 HTTP 요청 및 응답을 나타냅니다. 기본 제공되는 Apigee Edge 흐름 변수 요청, 응답, 메시지는 메시지 유형입니다. 메시지 변수에 대한 자세한 내용은 변수 참조를 확인하세요.

진단

  1. 오류 메시지에서 JSONThreatProtection 정책 이름과 소스 변수의 이름을 식별합니다. 예를 들어 다음 오류 메시지에서 정책 이름은 JSON-Threat-Protection-1이고 소스 변수는 message.content입니다.

    JSONThreatProtection[JSON-Threat-Protection-1]: Variable message.content does not resolve to a Message
    
  2. 1단계에서 확인된 JSONThreatProtection 정책의 <Source> 요소를 검토합니다.

    다음 JSONThreatProtection 정책 예시에서는 <Source>message 대신 message.content로 설정되었습니다.

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
        <DisplayName>JSON Threat Protection-1</DisplayName>
        <Properties/>
        <ArrayElementCount>3</ArrayElementCount>
        <ContainerDepth>5</ContainerDepth>
        <ObjectEntryCount>5</ObjectEntryCount>
        <ObjectEntryNameLength>20</ObjectEntryNameLength>
        <Source>message.content</Source>
        <StringValueLength>50</StringValueLength>
    </JSONThreatProtection>
    

    message.content는 메시지 유형이 아니므로 다음 오류가 발생합니다.

    JSONThreatProtection[JSON-Threat-Protection-1]: Variable message.content does
    not resolve to a Message
    

해상도

실패한 JSONThreatProtection 정책의 <Source> 요소가 정책이 실행되는 흐름에 있는 메시지 유형 흐름 변수로 설정되었는지 확인합니다.

정책을 수정하려면 <Source> 요소를 수정하여 메시지 유형의 변수를 지정합니다. 예를 들어 실패한 JSONThreatProtection에서 <Source> 요소를 message로 지정할 수 있습니다.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<JSONThreatProtection async="false" continueOnError="false" enabled="true" name="JSON-Threat-Protection-1">
    <DisplayName>JSON Threat Protection-1</DisplayName>
    <Properties/>
    <ArrayElementCount>3</ArrayElementCount>
    <ContainerDepth>5</ContainerDepth>
    <ObjectEntryCount>5</ObjectEntryCount>
    <ObjectEntryNameLength>20</ObjectEntryNameLength>
    <Source>message</Source>
    <StringValueLength>50</StringValueLength>
</JSONThreatProtection>