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"
        }
    }
}

अलग-अलग तरह की गड़बड़ियां और संभावित वजहें

JSONThreadProtection नीति की मदद से, Exec फ़्रेमो पर असर डालने वाली कई गड़बड़ियां अलग-अलग तरह की हो सकती हैं. नीचे दी गई टेबल में अलग-अलग तरह की गड़बड़ियों और उनकी संभावित वजहों के बारे में बताया गया है:

गड़बड़ी का टाइप वजह
ऑब्जेक्ट एंट्री के नाम की लंबाई इससे ज़्यादा है ऑब्जेक्ट के एंट्री नाम में स्ट्रिंग की तय सीमा पार हो गई है.
ऑब्जेक्ट एंट्री की संख्या पार हो गई है एक ऑब्जेक्ट में प्रविष्टियों की अधिकतम संख्या पार हो गई है.
अरे एलिमेंट की संख्या ज़्यादा है किसी ऐरे में तय सीमा से ज़्यादा एलिमेंट नहीं जोड़े जा सकते.
कंटेनर की ज़्यादा गहराई नेस्ट की गई गहराई की तय सीमा पार हो गई है.
स्ट्रिंग में तय सीमा से ज़्यादा वर्ण हैं स्ट्रिंग की वैल्यू के लिए तय सीमा से ज़्यादा वर्ण इस्तेमाल किए जा सकते हैं.
अमान्य 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> एलिमेंट के दिए गए इनपुट मैसेज पेलोड में, प्रॉपर्टी के नाम वाला ऐसा JSON ऑब्जेक्ट हो जो <ObjectEntryNameLength> एलिमेंट में दी गई सीमा से ज़्यादा हो.

उदाहरण के लिए, अगर नीति में <ObjectEntryNameLength> एलिमेंट को 5 के तौर पर बताया गया है, लेकिन इनपुट मैसेज पेलोड में ऐसी JSON प्रॉपर्टी है जिसका नाम पांच वर्णों से ज़्यादा है, तो यह गड़बड़ी दिखती है.

संक्रमण की जांच

  1. JSON ThreadProtection नीति का नाम और उस लाइन नंबर की पहचान करने के लिए, गड़बड़ी के मैसेज की जांच करें जहां लॉन्ग एंट्री का नाम डाला गया है. उदाहरण के लिए, गड़बड़ी के इस मैसेज में, JSONThreadProtection नीति का नाम 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. पहले चरण में बताई गई नीति की जांच करें और <ObjectEntryNameLength> एलिमेंट में दी गई वैल्यू को नोट करें.

    उदाहरण के लिए, नीचे दी गई JSON ThreadProtection की नीति में, <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. इनपुट पेलोड की खास लाइन नंबर (पहले चरण में पहचाना गया) की जांच करें और देखें कि ऑब्जेक्ट के नाम की लंबाई, <ObjectEntryNameLength> एलिमेंट में दी गई वैल्यू से ज़्यादा है या नहीं (जिसकी पहचान दूसरे चरण में की गई है). अगर ऑब्जेक्ट के नाम की लंबाई इस संख्या से ज़्यादा है, तो यही गड़बड़ी की वजह है.

    इनपुट पेलोड का एक उदाहरण यहां दिया गया है:

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

    ऊपर दिखाए गए JSON पेलोड में, लाइन 2 पर number नाम की प्रॉपर्टी है. इस प्रॉपर्टी में छह वर्ण हैं (नाम की लंबाई 6 है). ऑब्जेक्ट के नाम की लंबाई 5 (<ObjectEntryNameLength> एलिमेंट के लिए दी गई वैल्यू) से ज़्यादा है, इसलिए आपको यह गड़बड़ी दिखेगी:

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

रिज़ॉल्यूशन

अगर JSON ThreadProtection की नीति को ऑब्जेक्ट एंट्री के नाम वाले पेलोड से सुरक्षित रखने के लिए बनाया गया था, तो यह मैसेज मिलने के बाद ही गड़बड़ी का मैसेज मिल सकता है. इस मामले में आपको और कुछ करने की ज़रूरत नहीं है.

हालांकि, अगर आपको लगता है कि पेलोड में बिना किसी नतीजे के लंबे ऑब्जेक्ट एंट्री के नाम तय किए जा सकते हैं, तो <ObjectEntryNameLength> को अपनी ज़रूरतों के मुताबिक सही वैल्यू में बदलें.

उदाहरण के लिए, अगर आपको लगता है कि 10 वर्णों तक के ऑब्जेक्ट के नामों को अनुमति दी जा सकती है, तो JSONThreadProtection की नीति में इस तरह से बदलाव करें:

<?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> एलिमेंट के दिए गए इनपुट मैसेज पेलोड में एक ऐसा JSON ऑब्जेक्ट शामिल हो जिसमें नीति के <ObjectEntryCount> एलिमेंट में बताई गई वैल्यू से ज़्यादा एंट्री (प्रॉपर्टी) हों.

उदाहरण के लिए, अगर <ObjectEntryCount> एलिमेंट 5 है, लेकिन इनपुट JSON पेलोड में पांच से ज़्यादा एंट्री हैं, तो यह गड़बड़ी दिखती है.

संक्रमण की जांच

  1. JSONThreadProtection नीति का नाम और उस लाइन नंबर की पहचान करने के लिए, गड़बड़ी के मैसेज की जांच करें जिसमें एंट्री की संख्या तय सीमा से ज़्यादा है. उदाहरण के लिए, गड़बड़ी के इस मैसेज में, नीति का नाम 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. नीति के <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. इनपुट पेलोड की खास लाइन नंबर (पहले चरण में पहचाना गया) की जांच करें और देखें कि पेलोड में मौजूद इकाइयों की संख्या, <ObjectEntryCount> एलिमेंट के लिए दी गई वैल्यू से ज़्यादा है या नहीं (जिसकी पहचान दूसरे चरण में की गई है). अगर ऑब्जेक्ट की संख्या, ऑब्जेक्ट एंट्री की संख्या से ज़्यादा है, तो यही गड़बड़ी है.

    इनपुट पेलोड का एक उदाहरण यहां दिया गया है:

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

    ऊपर दिखाए गए JSON पेलोड में छठी एंट्री, लाइन #7 (कंपनी) पर होती है. इनपुट JSON पेलोड में ऑब्जेक्ट एंट्री की संख्या पांच (<ObjectEntryCount> एलिमेंट के लिए बताई गई वैल्यू) से ज़्यादा है, इसलिए आपको यह गड़बड़ी मिली है:

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

रिज़ॉल्यूशन

अगर JSON ThreadProtection की नीति का मकसद, तय सीमा से ज़्यादा ऑब्जेक्ट एंट्री वाले पेलोड से सुरक्षित रहना है, तो गड़बड़ी का मैसेज मिल सकता है. इस मामले में, आपको कुछ और करने की ज़रूरत नहीं है.

हालांकि, अगर आपको लगता है कि पेलोड में बिना किसी नतीजे के ज़्यादा ऑब्जेक्ट एंट्री शामिल की जा सकती हैं, तो <ObjectEntryCount> को अपनी ज़रूरतों के मुताबिक सही वैल्यू में बदलें.

उदाहरण के लिए, अगर आपको लगता है कि ज़्यादा से ज़्यादा 10 ऑब्जेक्ट एंट्री को अनुमति दी जा सकती है, तो JSONThreadProtection की नीति में इस तरह से बदलाव करें:

<?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> एलिमेंट के ज़रिए दिए गए इनपुट मैसेज पेलोड में JSON कलेक्शन शामिल हो. इस कलेक्शन में, नीति के <ArrayElementCount> एलिमेंट में दी गई संख्या से ज़्यादा एलिमेंट होते हैं.

उदाहरण के लिए, अगर <ArrayElementCount> एलिमेंट को 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. नीति के <ArrayElementCount> एलिमेंट के लिए तय की गई वैल्यू को नोट कर लें (पहले चरण में इसकी पहचान की गई है).

    JSON ThreadProtection की नीति के इस उदाहरण में, <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. इनपुट पेलोड की खास लाइन नंबर की जांच करें (पहले चरण में पहचान की गई) और देखें कि क्या वहां दिए गए अरे की संख्या, <ArrayElementCount> एलिमेंट में दी गई संख्या (दूसरे चरण में पहचानी गई) से ज़्यादा है. अगर ऐरे एलिमेंट की संख्या, संख्या से ज़्यादा है, तो यही गड़बड़ी की वजह है.

    इनपुट पेलोड का एक उदाहरण यहां दिया गया है:

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

    ऊपर दिखाए गए JSON पेलोड में लाइन 3 पर, models नाम के कलेक्शन में पांच एलिमेंट हैं. ऐरे एलिमेंट की संख्या तीन (<ArrayElementCount> एलिमेंट के लिए दी गई वैल्यू) से ज़्यादा है. इसलिए, आपको यह गड़बड़ी दिखेगी:

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

रिज़ॉल्यूशन

अगर JSONThreadProtection नीति को तय किए गए कलेक्शन की संख्या के हिसाब से पेलोड से सुरक्षित करने के लिए बनाया गया था, तो गड़बड़ी का मैसेज मिल सकता है. इस मामले में आपको कुछ और करने की ज़रूरत नहीं है.

हालांकि, अगर आपको लगता है कि किसी ऐरे में ज़्यादा संख्या में एलिमेंट इस्तेमाल करने की अनुमति दी जा सकती है, तो <ArrayElementCount> को अपनी ज़रूरतों के मुताबिक सही वैल्यू पर बदलें.

उदाहरण के लिए, अगर आपको लगता है कि ज़्यादा से ज़्यादा पांच ऐरे एलिमेंट को अनुमति दी जा सकती है, तो नीति में इस तरह से बदलाव करें:

<?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> एलिमेंट के बताए गए इनपुट मैसेज पेलोड में एक JSON ऑब्जेक्ट शामिल होता है, जिसमें कंटेनर की डेप्थ वाले JSON ऑब्जेक्ट शामिल होते हैं, जो नीति के <ContainerDepth> एलिमेंट में बताए गए कंटेनर की ज़्यादा से ज़्यादा गहराई से ज़्यादा होते हैं. कंटेनर की गहराई, JSON एलिमेंट के लिए नेस्ट की गई गहराई की ज़्यादा से ज़्यादा अनुमति है. उदाहरण के लिए, अगर किसी ऐरे में कोई ऐसा ऑब्जेक्ट है जिसमें कोई ऑब्जेक्ट है, तो उसके नतीजे के तौर पर कंटेनमेंट डेप्थ 3 होगा.

उदाहरण के लिए, अगर <ContainerDepth> एलिमेंट 3 है, लेकिन इनपुट पेलोड में कंटेनर की गहराई इस सीमा से ज़्यादा है, तो यह गड़बड़ी दिखती है.

संक्रमण की जांच

  1. गड़बड़ी के मैसेज की जांच करके, JSONThreadProtection की नीति के नाम और उस लाइन नंबर की पहचान करें जहां कंटेनर की गहराई ज़्यादा है. उदाहरण के लिए, नीचे दिए गए गड़बड़ी के मैसेज में, नीति का नाम 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> एलिमेंट के लिए तय की गई वैल्यू नोट कर लें (पहले चरण में इसकी पहचान की गई है).

    JSON ThreadProtection की नीति के इस उदाहरण में, <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. इनपुट पेलोड की खास लाइन नंबर की जांच करें (पहले चरण में इसकी पहचान की गई है) और देखें कि पेलोड में कंटेनर की डेप्थ, <ContainerDepth> एलिमेंट में दी गई वैल्यू से ज़्यादा है या नहीं (जिसकी पहचान दूसरे चरण में की गई है). अगर कंटेनर की गहराई संख्या से ज़्यादा है, तो यही गड़बड़ी की वजह है.

    इनपुट पेलोड का एक उदाहरण यहां दिया गया है:

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

    ऊपर दिखाए गए JSON पेलोड में लाइन 5 पर 6 कंटेनर डेप्थ है. ज़्यादा से ज़्यादा पांच से ज़्यादा होने की वजह से, JSONट्टProtection की नीति के <ContainerDepth> एलिमेंट के लिए तय की गई वैल्यू से आपको यह गड़बड़ी मिलेगी:

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

रिज़ॉल्यूशन

अगर JSONThreadProtection की नीति का मकसद, तय की गई वैल्यू से ज़्यादा कंटेनर डेप्थ वाले पेलोड से बचाव करना है, तो गड़बड़ी का मैसेज मिल सकता है. इस मामले में आपको कुछ और करने की ज़रूरत नहीं है.

हालांकि, अगर आपको लगता है कि कंटेनर की ज़्यादा गहराई स्वीकार की जा सकती है, तो <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> एलिमेंट के दिए गए इनपुट मैसेज पेलोड में ऐसे JSON एलिमेंट शामिल हों जिनमें <StringValueLength> एलिमेंट की तय सीमा से ज़्यादा वर्णों वाली वैल्यू हों.

उदाहरण के लिए, अगर नीति में <StringValueLength> एलिमेंट को 50 पर सेट किया गया है, लेकिन इनपुट पेलोड में एक या उससे ज़्यादा ऐसे एलिमेंट हैं जिनकी वैल्यू में 50 से ज़्यादा वर्ण हैं, तो यह गड़बड़ी दिखती है.

संक्रमण की जांच

  1. नीति के नाम और उस लाइन नंबर की पहचान करने के लिए गड़बड़ी के मैसेज की जांच करें जहां स्ट्रिंग की लंबाई ज़्यादा हो गई है. नीचे दिए गए उदाहरण में, नीति का नाम पेलोड 3 में JSON-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. (पहले चरण में इसकी पहचान की गई है) में, <StringValueLength> एलिमेंट के लिए तय की गई वैल्यू नोट कर लें.

    JSON ThreadProtection की नीति के इस उदाहरण में, <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. इनपुट पेलोड की खास लाइन नंबर (पहले चरण में पहचाना गया) की जांच करें और देखें कि वैल्यू की लंबाई, <StringValueLength> एलिमेंट के लिए बताए गए वर्णों की संख्या (दूसरे चरण में पहचानी गई) से ज़्यादा है या नहीं. अगर वैल्यू की लंबाई सीमा से ज़्यादा है, तो यही गड़बड़ी की वजह है.

    इनपुट पेलोड का एक उदाहरण यहां दिया गया है:

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

    ऊपर दिखाए गए JSON पेलोड में Place Name नाम का एक ऑब्जेक्ट है, जिसकी वैल्यू Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu में लाइन 3 में 85 वर्ण हैं. वैल्यू की लंबाई 50 से ज़्यादा है, इसलिए <StringValueLength> एलिमेंट में इसकी जानकारी दी गई है. इसलिए, आपको यह गड़बड़ी दिखेगी:

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

रिज़ॉल्यूशन

अगर JSONThreadProtection नीति का मकसद, तय स्ट्रिंग की लंबाई से ज़्यादा वैल्यू वाले पेलोड को सुरक्षित रखना है, तो गड़बड़ी का मैसेज मिल सकता है. इस मामले में आपको कुछ और करने की ज़रूरत नहीं है.

हालांकि, अगर आपको लगता है कि पेलोड में ज़्यादा लंबाई वाली वैल्यू तय की जा सकती है, तो <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"
        }
    }
}

वजह

यह गड़बड़ी तब होती है, जब JSON उम्मीद के मुताबिक सुरक्षा नीति में <Source> एलिमेंट से तय किया गया इनपुट मैसेज पेलोड, एक मान्य JSON ऑब्जेक्ट नहीं है.

संक्रमण की जांच

  1. नीति का नाम और उस लाइन नंबर की पहचान करने के लिए गड़बड़ी के मैसेज की जांच करें जहां गड़बड़ी हुई थी. नीचे दिए गए उदाहरण में, नीति का नाम पेलोड 2 में JSON-Threat-Protection-1 andलाइन है.

    JSONThreatProtection[JSON-Threat-Protection-1]: Execution failed. reason: Expecting : at line 3
    
  2. इनपुट पेलोड के लाइन नंबर (पहले चरण में पहचाना गया) की जांच करें और देखें कि पेलोड में पास किया गया JSON ऑब्जेक्ट, वाकई में कोई मान्य JSON ऑब्जेक्ट है या नहीं.

    इनपुट पेलोड का एक उदाहरण यहां दिया गया है:

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

    ऊपर दिखाए गए JSON पेलोड में, लाइन 3 में ":" (कोलन) नहीं है. यह एक मान्य JSON ऑब्जेक्ट नहीं है, इसलिए आपको यह गड़बड़ी मिली है:

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

रिज़ॉल्यूशन

पक्का करें कि मान्य इनपुट JSON पेलोड ऐसे किसी भी एपीआई प्रॉक्सी को पास किया गया हो जिसमें JSONThreadProtection नीति शामिल हो.

ऊपर दिए गए उदाहरण के लिए, 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"
        }
    }
}

वजह

यह गड़बड़ी तब होती है, जब JSONThreadProtection नीति के <Source> एलिमेंट में बताया गया message वैरिएबल इनमें से कोई एक हो:

  • दायरे से बाहर है (यह सुविधा उस फ़्लो में उपलब्ध नहीं होती जहां नीति लागू की जा रही है)
  • request, response या message मान्य वैल्यू में से एक नहीं है

उदाहरण के लिए, यह गड़बड़ी तब होती है, जब नीति में <Source> एलिमेंट को किसी ऐसे वैरिएबल पर सेट किया गया हो जो उस फ़्लो में मौजूद नहीं है जहां नीति लागू की जाती है.

संक्रमण की जांच

  1. गड़बड़ी के मैसेज से नीति का नाम और सोर्स वैरिएबल के नाम की पहचान करें. उदाहरण के लिए, नीचे दिए गए गड़बड़ी के मैसेज में नीति का नाम JSON-Threat-Protection-1 है और सोर्स वैरिएबल requests है:

    JSONThreatProtection[JSON-Threat-Protection-1]:: Source requests is not available
    
  2. पहले चरण में पहचाने गए <Source> एलिमेंट के लिए दी गई वैल्यू की जांच करें.

    नीचे दिए गए JSONथProtection की नीति के उदाहरण में, <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
    

रिज़ॉल्यूशन

पक्का करें कि JSON ThreadProtection से जुड़ी नीति के <Source> एलिमेंट में सेट किया गया वैरिएबल, request, response या message पर सेट हो. साथ ही, यह उस फ़्लो में मौजूद हो जहां नीति लागू होती है.

उदाहरण के तौर पर, ऊपर दिखाई गई JSON ThreadProtection की नीति को ठीक करने के लिए, <Source> एलिमेंट में बदलाव किया जा सकता है. ऐसा करके, request वैरिएबल का इस्तेमाल किया जा सकता है, क्योंकि यह वैरिएबल, अनुरोध के फ़्लो में मौजूद होता है:

<?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"
        }
    }
}

वजह

यह गड़बड़ी तब होती है, जब JSONThreadProtection नीति में <Source> एलिमेंट को किसी ऐसे वैरिएबल पर सेट किया गया हो जो message का नहीं है.

मैसेज टाइप वैरिएबल से पूरे एचटीटीपी अनुरोध और उनके जवाब दिखते हैं. बिल्ट-इन Apigee Edge फ़्लो वैरिएबल, अनुरोध, रिस्पॉन्स, और मैसेज टाइप मैसेज होते हैं. मैसेज वैरिएबल के बारे में ज़्यादा जानने के लिए, वैरिएबल रेफ़रंस देखें.

संक्रमण की जांच

  1. JSONCrashProtection की नीति के नाम और सोर्स वैरिएबल के नाम की पहचान, गड़बड़ी के मैसेज से करें. उदाहरण के लिए, नीचे दिए गए गड़बड़ी के मैसेज में नीति का नाम JSON-Threat-Protection-1 है और सोर्स वैरिएबल message.content है:

    JSONThreatProtection[JSON-Threat-Protection-1]: Variable message.content does not resolve to a Message
    
  2. JSON ThreadProtection नीति के <Source> एलिमेंट की जांच करें. इसके बारे में पहले चरण में बताया गया है.

    यहां दिए गए JSONथProtection की नीति के उदाहरण में, <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
    

रिज़ॉल्यूशन

पक्का करें कि 'पुष्टि नहीं किए जा सके' JSONThreadProtection की नीति में मौजूद <Source> एलिमेंट को मैसेज टाइप के फ़्लो वैरिएबल पर सेट किया गया हो. यह वैरिएबल उस फ़्लो में मौजूद होता है जहां नीति लागू होती है.

इस नीति को ठीक करने के लिए, <Source> एलिमेंट में बदलाव किया जा सकता है, ताकि मैसेज टाइप वाला वैरिएबल तय किया जा सके. उदाहरण के लिए, काम न करने वाले JSON ThreadProtection में <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>