นโยบาย XMLThreatProtection

คุณกำลังดูเอกสารประกอบ Apigee Edge
ไปที่ เอกสารประกอบเกี่ยวกับ Apigee X.
ข้อมูล

อะไร

แก้ไขช่องโหว่ของ XML และลดการโจมตี API ของคุณ ตรวจหาเพย์โหลด XML (ไม่บังคับ) การโจมตีตามขีดจำกัดที่กำหนดค่าไว้ คัดกรองตามภัยคุกคาม XML โดยใช้ข้อมูลต่อไปนี้ ดังต่อไปนี้

  • ตรวจสอบความถูกต้องของข้อความโดยใช้สคีมา XML (.xsd)
  • ประเมินเนื้อหาข้อความสำหรับคีย์เวิร์ดหรือรูปแบบที่เจาะจงที่จะยกเว้น
  • ตรวจหาข้อความที่เสียหายหรือมีรูปแบบไม่ถูกต้องก่อนแยกวิเคราะห์ข้อความ

การอ้างอิงองค์ประกอบ

การอ้างอิงองค์ประกอบจะอธิบายองค์ประกอบและแอตทริบิวต์ของ XMLThreatProtection

<XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1">
   <DisplayName>XML Threat Protection 1</DisplayName>
   <NameLimits>
      <Element>10</Element>
      <Attribute>10</Attribute>
      <NamespacePrefix>10</NamespacePrefix>
      <ProcessingInstructionTarget>10</ProcessingInstructionTarget>
   </NameLimits>
   <Source>request</Source>
   <StructureLimits>
      <NodeDepth>5</NodeDepth>
      <AttributeCountPerElement>2</AttributeCountPerElement>
      <NamespaceCountPerElement>3</NamespaceCountPerElement>
      <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
   </StructureLimits>
   <ValueLimits>
      <Text>15</Text>
      <Attribute>10</Attribute>
      <NamespaceURI>10</NamespaceURI>
      <Comment>10</Comment>
      <ProcessingInstructionData>10</ProcessingInstructionData>
   </ValueLimits> 
</XMLThreatProtection>

&lt;XMLThreatProtection&gt; แอตทริบิวต์

<XMLThreatProtection async="false" continueOnError="false" enabled="true" name="XML-Threat-Protection-1"> 

ตารางต่อไปนี้อธิบายแอตทริบิวต์ทั่วไปในองค์ประกอบระดับบนสุดของนโยบายทั้งหมด

แอตทริบิวต์ คำอธิบาย ค่าเริ่มต้น การมีบุคคลอยู่
name

ชื่อภายในของนโยบาย ค่าของแอตทริบิวต์ name สามารถ ประกอบด้วยตัวอักษร ตัวเลข การเว้นวรรค ขีดกลางสั้น ขีดล่าง และจุด ค่านี้ไม่สามารถ เกิน 255 อักขระ

(ไม่บังคับ) ใช้องค์ประกอบ <DisplayName> เพื่อติดป้ายกำกับนโยบายใน เครื่องมือแก้ไขพร็อกซี UI การจัดการด้วยชื่อที่เป็นภาษาธรรมชาติต่างกัน

ไม่มี ต้องระบุ
continueOnError

ตั้งค่าเป็น false เพื่อแสดงผลข้อผิดพลาดเมื่อนโยบายล้มเหลว เป็นเรื่องปกติ พฤติกรรมสำหรับนโยบายส่วนใหญ่

ตั้งค่าเป็น true เพื่อให้ดำเนินการตามขั้นตอนได้อย่างต่อเนื่องแม้จะมีนโยบายแล้วก็ตาม ล้มเหลว

เท็จ ไม่บังคับ
enabled

ตั้งค่าเป็น true เพื่อบังคับใช้นโยบาย

ตั้งค่าเป็น false เพื่อปิดนโยบาย นโยบายจะไม่ บังคับใช้ แม้ว่าจะยังคงแนบกับขั้นตอน

จริง ไม่บังคับ
async

แอตทริบิวต์นี้เลิกใช้งานแล้ว

เท็จ เลิกใช้

&lt;DisplayName&gt; องค์ประกอบ

ใช้เพิ่มเติมจากแอตทริบิวต์ name เพื่อติดป้ายกำกับนโยบายใน เครื่องมือแก้ไขพร็อกซี UI การจัดการด้วยชื่อที่เป็นภาษาธรรมชาติต่างกัน

<DisplayName>Policy Display Name</DisplayName>
ค่าเริ่มต้น

ไม่มี

หากไม่ใส่องค์ประกอบนี้ ค่าของแอตทริบิวต์ name ของนโยบายจะเป็น

การมีบุคคลอยู่ ไม่บังคับ
ประเภท สตริง

&lt;NameLimits&gt; องค์ประกอบ

ระบุจำนวนอักขระสูงสุดที่จะตรวจสอบและบังคับใช้โดยนโยบาย

<NameLimits>
   <Element>10</Element>
   <Attribute>10</Attribute>
   <NamespacePrefix>10</NamespacePrefix>
   <ProcessingInstructionTarget>10</ProcessingInstructionTarget>     
</NameLimits>
ค่าเริ่มต้น: ไม่มี
การตรวจหาบุคคล: ไม่บังคับ
ประเภท: ไม่มี

&lt;NameLimits&gt;/&lt;Element&gt; องค์ประกอบ

ระบุขีดจำกัดจำนวนอักขระสูงสุดที่อนุญาตในชื่อองค์ประกอบใน XML เอกสาร

ตัวอย่างเช่น ลองใช้ XML ต่อไปนี้

<book category="WEB">
   <title>Learning XML</title>
   <author>Erik T. Ray</author>
   <year>2003</year>
</book>

เมื่อวิเคราะห์ XML ข้างต้น ค่าองค์ประกอบ <Element> ในนโยบาย ข้อมูลโค้ดด้านล่างจะตรวจสอบว่าชื่อองค์ประกอบ (book , title, author และ year) ต้องไม่เกิน 10 อักขระ

<NameLimits>
   <Element>10</Element>
   <Attribute>10</Attribute>
   <NamespacePrefix>10</NamespacePrefix>
   <ProcessingInstructionTarget>10</ProcessingInstructionTarget>     
</NameLimits>
ค่าเริ่มต้น: หากคุณไม่ระบุขีดจำกัด ระบบจะใช้ค่าเริ่มต้น -1 ซึ่งระบบจะไม่จำกัด
การตรวจหาบุคคล: ไม่บังคับ
ประเภท: จำนวนเต็ม

&lt;NameLimits&gt;/&lt;Attribute&gt; องค์ประกอบ

ระบุขีดจำกัดจำนวนอักขระสูงสุดที่อนุญาตในชื่อแอตทริบิวต์ใน เอกสาร XML

ตัวอย่างเช่น ลองใช้ XML ต่อไปนี้

<book category="WEB">
   <title>Learning XML</title>
   <author>Erik T. Ray</author>
   <year>2003</year>
</book>

เมื่อวิเคราะห์ XML ข้างต้น ค่าองค์ประกอบ <Attribute> ในนโยบาย ตัวอย่างข้อมูลด้านล่างจะตรวจสอบว่าชื่อแอตทริบิวต์ category ไม่เกิน 10 อักขระ

<NameLimits>
   <Element>10</Element>
   <Attribute>10</Attribute>
   <NamespacePrefix>10</NamespacePrefix>
   <ProcessingInstructionTarget>10</ProcessingInstructionTarget>     
</NameLimits>
ค่าเริ่มต้น: หากคุณไม่ระบุขีดจำกัด ระบบจะใช้ค่าเริ่มต้น -1 ซึ่งระบบจะไม่จำกัด
การตรวจหาบุคคล: ไม่บังคับ
ประเภท: จำนวนเต็ม

&lt;NameLimits&gt;/&lt;NamespacePrefix&gt; องค์ประกอบ

ระบุขีดจำกัดจำนวนอักขระสูงสุดที่อนุญาตในคำนำหน้าเนมสเปซใน เอกสาร XML

ตัวอย่างเช่น ลองใช้ XML ต่อไปนี้

<ns1:myelem xmlns:ns1="http://ns1.com"/>

เมื่อวิเคราะห์ XML ข้างต้น ค่าขององค์ประกอบ <NamespacePrefix> ใน ตัวอย่างนโยบายด้านล่างจะตรวจสอบว่าค่านำหน้าเนมสเปซ ns1 ไม่เกิน 10 อักขระ

<NameLimits>
   <Element>10</Element>
   <Attribute>10</Attribute>
   <NamespacePrefix>10</NamespacePrefix>
   <ProcessingInstructionTarget>10</ProcessingInstructionTarget>     
</NameLimits>
ค่าเริ่มต้น: หากคุณไม่ระบุขีดจำกัด ระบบจะใช้ค่าเริ่มต้น -1 ซึ่งระบบจะไม่จำกัด
การตรวจหาบุคคล: ไม่บังคับ
ประเภท: จำนวนเต็ม

&lt;NameLimits&gt;/&lt;ProcessingInstructionTarget&gt; องค์ประกอบ

ระบุขีดจำกัดจำนวนอักขระสูงสุดที่อนุญาตในเป้าหมาย วิธีการประมวลผลข้อมูลในเอกสาร XML

ตัวอย่างเช่น ลองใช้ XML ต่อไปนี้

<?xml-stylesheet type="text/xsl" href="style.xsl"?>

เมื่อวิเคราะห์ XML ด้านบน องค์ประกอบ <ProcessingInstructionTarget> ในข้อมูลโค้ดนโยบายด้านล่างจะตรวจสอบว่าเป้าหมายวิธีการประมวลผล xml-stylesheet ต้องมีความยาวไม่เกิน 10 อักขระ

<NameLimits>
   <Element>10</Element>
   <Attribute>10</Attribute>
   <NamespacePrefix>10</NamespacePrefix>
   <ProcessingInstructionTarget>10</ProcessingInstructionTarget>     
</NameLimits>
ค่าเริ่มต้น: หากคุณไม่ระบุขีดจำกัด ระบบจะใช้ค่าเริ่มต้น -1 ซึ่งระบบจะไม่จำกัด
การตรวจหาบุคคล: ไม่บังคับ
ประเภท: จำนวนเต็ม

&lt;Source&gt; องค์ประกอบ

ข้อความที่จะคัดกรองการโจมตีเพย์โหลด XML โดยทั่วไปจะตั้งค่าเป็น request เนื่องจากโดยปกติแล้วคุณจะต้องตรวจสอบคำขอขาเข้าจากแอปไคลเอ็นต์ เมื่อตั้งค่าเป็น message องค์ประกอบนี้จะประเมินข้อความคำขอโดยอัตโนมัติ เมื่อแนบไปกับขั้นตอนคำขอและข้อความตอบกลับเมื่อแนบมากับการตอบกลับ

<Source>request</Source>
ค่าเริ่มต้น: ส่งคำขอ
การตรวจหาบุคคล: ไม่บังคับ
ประเภท:

สตริง

เลือกจาก request, response หรือ message

&lt;StructuralLimits&gt; องค์ประกอบ

ระบุขีดจำกัดเชิงโครงสร้างที่จะตรวจสอบและบังคับใช้โดยนโยบาย

<StructureLimits>
   <NodeDepth>5</NodeDepth>
   <AttributeCountPerElement>2</AttributeCountPerElement>
   <NamespaceCountPerElement>3</NamespaceCountPerElement>
   <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
</StructureLimits>
ค่าเริ่มต้น: ไม่มี
การตรวจหาบุคคล: ไม่บังคับ
ประเภท: ไม่มี

&lt;StructuralLimits&gt;/&lt;NodeDepth&gt; องค์ประกอบ

ระบุความลึกของโหนดสูงสุดที่อนุญาตใน XML

<StructureLimits>
   <NodeDepth>5</NodeDepth>
   <AttributeCountPerElement>2</AttributeCountPerElement>
   <NamespaceCountPerElement>3</NamespaceCountPerElement>
   <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
</StructureLimits>
ค่าเริ่มต้น: หากคุณไม่ระบุขีดจำกัด ระบบจะใช้ค่าเริ่มต้น -1 ซึ่งระบบจะไม่จำกัด
การตรวจหาบุคคล: ไม่บังคับ
ประเภท:

จำนวนเต็ม

&lt;StructuralLimits&gt;/&lt;AttributeCountPerElement&gt; องค์ประกอบ

ระบุจำนวนแอตทริบิวต์สูงสุดที่อนุญาตสำหรับองค์ประกอบใดๆ

ตัวอย่างเช่น ลองใช้ XML ต่อไปนี้

<book category="WEB">
   <title>Learning XML</title>
   <author>Erik T. Ray</author>
   <year>2003</year>
</book>
เมื่อวิเคราะห์ XML ด้านบน ค่าองค์ประกอบ <AttributeCountPerElement> ในตัวอย่างนโยบายด้านล่างจะตรวจสอบว่าองค์ประกอบ book, title, author และ year แต่ละรายการมีแอตทริบิวต์ไม่เกิน 2 รายการ โปรดทราบว่าระบบจะไม่นับแอตทริบิวต์ที่ใช้สำหรับกำหนดเนมสเปซ
<StructureLimits>
   <NodeDepth>5</NodeDepth>
   <AttributeCountPerElement>2</AttributeCountPerElement>
   <NamespaceCountPerElement>3</NamespaceCountPerElement>
   <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
</StructureLimits>
ค่าเริ่มต้น: หากคุณไม่ระบุขีดจำกัด ระบบจะใช้ค่าเริ่มต้น -1 ซึ่งระบบจะไม่จำกัด
การตรวจหาบุคคล: ไม่บังคับ
ประเภท:

จำนวนเต็ม

&lt;StructuralLimits&gt;/&lt;NameSpaceCountPerElement&gt; องค์ประกอบ

ระบุจำนวนการกำหนดเนมสเปซสูงสุดที่อนุญาตสำหรับองค์ประกอบใดๆ

ตัวอย่างเช่น ลองใช้ XML ต่อไปนี้

<e1 attr1="val1" attr2="val2">
    <e2 xmlns="http://apigee.com" xmlns:yahoo="http://yahoo.com" one="1" yahoo:two="2"/>
</e1>

เมื่อวิเคราะห์ XML ด้านบน ค่าขององค์ประกอบ <NamespaceCountPerElement> ในตัวอย่างนโยบายด้านล่างจะตรวจสอบว่าองค์ประกอบ e1 และ e2 แต่ละรายการมีคำจำกัดความของเนมสเปซได้ไม่เกิน 2 รายการ ในกรณีนี้ <e1> มีคำจำกัดความของเนมสเปซ 0 รายการและ <e2> มีเนมสเปซ 2 รายการ คำจำกัดความ: xmlns="http://apigee.com" และ xmlns:yahoo="http://yahoo.com"

<StructureLimits>
   <NodeDepth>5</NodeDepth>
   <AttributeCountPerElement>2</AttributeCountPerElement>
   <NamespaceCountPerElement>3</NamespaceCountPerElement>
   <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
</StructureLimits>
ค่าเริ่มต้น: หากคุณไม่ระบุขีดจำกัด ระบบจะใช้ค่าเริ่มต้น -1 ซึ่งระบบจะไม่จำกัด
การตรวจหาบุคคล: ไม่บังคับ
ประเภท:

จำนวนเต็ม

&lt;StructuralLimits&gt;/&lt;ChildCount&gt; องค์ประกอบ

ระบุจำนวนองค์ประกอบย่อยสูงสุดที่อนุญาตสำหรับองค์ประกอบใดก็ได้

<StructureLimits>
   <NodeDepth>5</NodeDepth>
   <AttributeCountPerElement>2</AttributeCountPerElement>
   <NamespaceCountPerElement>3</NamespaceCountPerElement>
   <ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">3</ChildCount>
</StructureLimits>
ค่าเริ่มต้น: หากคุณไม่ระบุขีดจำกัด ระบบจะใช้ค่าเริ่มต้น -1 ซึ่งระบบจะไม่จำกัด
การตรวจหาบุคคล: ไม่บังคับ
ประเภท:

จำนวนเต็ม

Attributes

แอตทริบิวต์ ค่าเริ่มต้น การมีบุคคลอยู่
includeComment จริง ไม่บังคับ
includeElement จริง ไม่บังคับ
includeProcessingInstructions จริง ไม่บังคับ
includeText จริง ไม่บังคับ

&lt;ValueLimits&gt; องค์ประกอบ

ระบุจำนวนอักขระสูงสุดที่จะตรวจสอบและบังคับใช้โดยนโยบาย

<ValueLimits>
   <Text>15</Text>
   <Attribute>10</Attribute>
   <NamespaceURI>10</NamespaceURI>
   <Comment>10</Comment>
   <ProcessingInstructionData>10</ProcessingInstructionData>
</ValueLimits>
ค่าเริ่มต้น: ไม่มี
การตรวจหาบุคคล: ไม่บังคับ
ประเภท:

ไม่มี

&lt;ValueLimits&gt;/&lt;Text&gt; องค์ประกอบ

ระบุจำนวนอักขระสูงสุดสำหรับโหนดข้อความที่แสดงในเอกสาร XML

ตัวอย่างเช่น ลองใช้ XML ต่อไปนี้

<book category="WEB">
   <title>Learning XML</title>
   <author>Erik T. Ray</author>
   <year>2003</year>
</book>
เมื่อวิเคราะห์ XML ด้านบน ค่าองค์ประกอบ <Text> ในนโยบาย ตัวอย่างข้อมูลด้านล่างจะตรวจสอบว่าค่าข้อความขององค์ประกอบ Learning XML, Erik T. Ray, และ 2003 แต่ละรายการต้องไม่เกิน 15 อักขระ
<ValueLimits>
   <Text>15</Text>
   <Attribute>10</Attribute>
   <NamespaceURI>10</NamespaceURI>
   <Comment>10</Comment>
   <ProcessingInstructionData>10</ProcessingInstructionData>
</ValueLimits>
ค่าเริ่มต้น: หากคุณไม่ระบุขีดจำกัด ระบบจะใช้ค่าเริ่มต้น -1 ซึ่งระบบจะไม่จำกัด
การตรวจหาบุคคล: ไม่บังคับ
ประเภท:

จำนวนเต็ม

&lt;ValueLimits&gt;/&lt;Attribute&gt; องค์ประกอบ

ระบุจำนวนอักขระสูงสุดสำหรับค่าแอตทริบิวต์ที่ปรากฏในเอกสาร XML

ตัวอย่างเช่น ลองใช้ XML ต่อไปนี้

<book category="WEB">
   <title>Learning XML</title>
   <author>Erik T. Ray</author>
   <year>2003</year>
</book>
เมื่อวิเคราะห์ XML ด้านบน ค่าองค์ประกอบ <Attribute> ในนโยบาย ตัวอย่างข้อมูลด้านล่างจะตรวจสอบว่าค่าแอตทริบิวต์ WEB ไม่เกิน 10 อักขระ
<ValueLimits>
   <Text>15</Text>
   <Attribute>10</Attribute>
   <NamespaceURI>10</NamespaceURI>
   <Comment>10</Comment>
   <ProcessingInstructionData>10</ProcessingInstructionData>
</ValueLimits>
ค่าเริ่มต้น: หากคุณไม่ระบุขีดจำกัด ระบบจะใช้ค่าเริ่มต้น -1 ซึ่งระบบจะไม่จำกัด
การตรวจหาบุคคล: ไม่บังคับ
ประเภท:

จำนวนเต็ม

&lt;ValueLimits&gt;/&lt;NamespaceURI&gt; องค์ประกอบ

ระบุจำนวนอักขระสูงสุดสำหรับ URI ของเนมสเปซที่มีอยู่ในเอกสาร XML

ตัวอย่างเช่น ลองใช้ XML ต่อไปนี้

<ns1:myelem xmlns:ns1="http://ns1.com"/>
เมื่อวิเคราะห์ XML ด้านบน ค่าองค์ประกอบ <NamespaceURI> ใน ตัวอย่างนโยบายด้านล่างจะตรวจสอบว่าค่า URI ของเนมสเปซ http://ns1.com ทำเช่นนั้น ไม่เกิน 10 อักขระ
<ValueLimits>
   <Text>15</Text>
   <Attribute>10</Attribute>
   <NamespaceURI>10</NamespaceURI>
   <Comment>10</Comment>
   <ProcessingInstructionData>10</ProcessingInstructionData>
</ValueLimits>
ค่าเริ่มต้น: หากคุณไม่ระบุขีดจำกัด ระบบจะใช้ค่าเริ่มต้น -1 ซึ่งระบบจะไม่จำกัด
การตรวจหาบุคคล: ไม่บังคับ
ประเภท:

จำนวนเต็ม

&lt;ValueLimits&gt;/&lt;Comment&gt; องค์ประกอบ

ระบุจำนวนอักขระสูงสุดสำหรับความคิดเห็นที่แสดงในเอกสาร XML

ตัวอย่างเช่น ลองใช้ XML ต่อไปนี้

<book category="WEB">
   <!-- This is a comment -->
   <title>Learning XML</title>
   <author>Erik T. Ray</author>
   <year>2003</year>
</book>
เมื่อวิเคราะห์ XML ด้านบน ค่าองค์ประกอบ <Comment> ในนโยบาย ตัวอย่างข้อมูลด้านล่างจะตรวจสอบว่าข้อความความคิดเห็น This is a comment ไม่เกิน 10 อักขระ
<ValueLimits>
   <Text>15</Text>
   <Attribute>10</Attribute>
   <NamespaceURI>10</NamespaceURI>
   <Comment>10</Comment>
   <ProcessingInstructionData>10</ProcessingInstructionData>
</ValueLimits>
ค่าเริ่มต้น: หากคุณไม่ระบุขีดจำกัด ระบบจะใช้ค่าเริ่มต้น -1 ซึ่งระบบจะไม่จำกัด
การตรวจหาบุคคล: ไม่บังคับ
ประเภท:

จำนวนเต็ม

&lt;ValueLimits&gt;/&lt;ProcessingInstructionData&gt; องค์ประกอบ

ระบุจำนวนอักขระสูงสุดสำหรับคำสั่งการประมวลผลที่มีอยู่ใน XML เอกสาร

ตัวอย่างเช่น ลองใช้ XML ต่อไปนี้

<?xml-stylesheet type="text/xsl" href="style.xsl"?>
เมื่อวิเคราะห์ XML ด้านบน องค์ประกอบ <ProcessingInstructionData> ในตัวอย่างนโยบายด้านล่างจะตรวจสอบว่าข้อความวิธีการประมวลผล type="text/xsl" href="style.xsl" ไม่เกิน 10 อักขระ
<ValueLimits>
   <Text>15</Text>
   <Attribute>10</Attribute>
   <NamespaceURI>10</NamespaceURI>
   <Comment>10</Comment>
   <ProcessingInstructionData>10</ProcessingInstructionData>
</ValueLimits>
ค่าเริ่มต้น: หากคุณไม่ระบุขีดจำกัด ระบบจะใช้ค่าเริ่มต้น -1 ซึ่งระบบจะไม่จำกัด
การตรวจหาบุคคล: ไม่บังคับ
ประเภท:

จำนวนเต็ม

ข้อมูลอ้างอิงข้อผิดพลาด

This section describes the fault codes and error messages that are returned and fault variables that are set by Edge when this policy triggers an error. This information is important to know if you are developing fault rules to handle faults. To learn more, see What you need to know about policy errors and Handling faults.

Runtime errors

These errors can occur when the policy executes.

Fault code HTTP status Cause Fix
steps.xmlthreatprotection.ExecutionFailed 500 The XMLThreatProtection policy can throw many different types of ExecutionFailed errors. Most of these errors occur when a specific threshold set in the policy is exceeded. These types of errors include: element name length, child count, node depth, attribute count, attribute name length, and many others. You can see the complete list in the XMLThreatProtection policy runtime error troubleshooting topic.
steps.xmlthreatprotection.InvalidXMLPayload 500 This error occurs if the input message payload specified by the XMLThreatProtection policy's <Source> element is not a valid XML Document.
steps.xmlthreatprotection.SourceUnavailable 500 This error occurs if the message variable specified in the <Source> element is either:
  • Out of scope (not available in the specific flow where the policy is being executed)
  • Is not one of the valid values request, response, or message
steps.xmlthreatprotection.NonMessageVariable 500 This error occurs if the <Source> element is set to a variable which is not of type message.

Notes:

  • The error name ExecutionFailed is the default error name and will be returned regardless of the type of error detected; however, this default can be changed by setting an organization-level property. When this property is set, the error name will reflect the actual error. For example, "TextExceeded" or "AttrValueExceeded". See Usage Notes for details.
  • The 500 HTTP status is the default; however, the HTTP Status can be changed to 400 for request flow faults by setting an organization-level property. See Usage Notes for details.

Deployment errors

None.

Fault variables

These variables are set when a runtime error occurs. For more information, see What you need to know about policy errors.

Variables Where Example
fault.name="fault_name" fault_name is the name of the fault, as listed in the Runtime errors table above. The fault name is the last part of the fault code. fault.name Matches "SourceUnavailable"
xmlattack.policy_name.failed policy_name is the user-specified name of the policy that threw the fault. xmlattack.XPT-SecureRequest.failed = true

Example error response

{
  "fault": {
    "faultstring": "XMLThreatProtection[XPT-SecureRequest]: Execution failed. reason: XMLThreatProtection[XTP-SecureRequest]: Exceeded object entry name length at line 2",
    "detail": {
      "errorcode": "steps.xmlthreatprotection.ExecutionFailed"
    }
  }
}

Example fault rule

<FaultRule name="XML Threat Protection Policy Faults">
    <Step>
        <Name>AM-CustomErrorResponse</Name>
        <Condition>(fault.name Matches "ExecutionFailed") </Condition>
    </Step>
    <Condition>(xmlattack.XPT-SecureRequest.failed = true) </Condition>
</FaultRule>

สคีมา

หมายเหตุการใช้งาน

เซิร์ฟเวอร์ใดๆ ที่รับข้อมูลออนไลน์จะถูกโจมตี ไม่ว่าจะเป็นอันตรายหรือไม่ได้ตั้งใจ การโจมตีบางอย่างใช้ประโยชน์จากความยืดหยุ่นของ XML โดยสร้างเอกสารที่ไม่ถูกต้องที่มี ความเสี่ยงต่อระบบแบ็กเอนด์ เอกสาร XML ที่เสียหายหรือมีความซับซ้อนมาก ทำให้เซิร์ฟเวอร์จัดสรรหน่วยความจำมากกว่าที่มีอยู่ ทำให้ทรัพยากรของ CPU และหน่วยความจำเพิ่มขึ้นมาก โปรแกรมแยกวิเคราะห์ที่ขัดข้อง และโดยทั่วไปจะปิดการใช้งานการประมวลผลข้อความและการสร้างระดับแอปพลิเคชัน และการโจมตีแบบปฏิเสธการให้บริการ

การกำหนดค่าข้อผิดพลาดเกี่ยวกับการป้องกันภัยคุกคาม

ข้อมูลสำคัญหากคุณสร้าง FaultRules สำหรับนโยบายนี้โดย ตามค่าเริ่มต้น Edge จะแสดงรหัสสถานะข้อผิดพลาดภายในเซิร์ฟเวอร์ HTTP 500 และข้อผิดพลาด ExecutionFailed หากข้อความไม่ส่งผ่านนโยบายการป้องกันภัยคุกคามของ JSON หรือ XML คุณสามารถเปลี่ยน กับพร็อพเพอร์ตี้ระดับองค์กรแบบใหม่ เมื่อตั้งค่าองค์กร พร็อพเพอร์ตี้ features.isPolicyHttpStatusEnabled เป็นจริง ค่าต่อไปนี้ เกิดการทำงานต่อไปนี้

  • คำขอ: เมื่อแนบนโยบายการป้องกันภัยคุกคามแนบไปกับขั้นตอนคำขอ ข้อความที่ไม่ถูกต้อง แสดงรหัสสถานะคำขอ 400 ไม่ถูกต้อง พร้อมข้อผิดพลาดด้านนโยบายที่เกี่ยวข้อง (ไม่ใช่แค่ ExecutionFailed)
  • การตอบสนอง: เมื่อแนบนโยบายการป้องกันภัยคุกคามแนบไปกับขั้นตอนการตอบสนอง ข้อความที่ไม่ถูกต้อง ยังคงส่งคืนรหัสสถานะข้อผิดพลาดภายในเซิร์ฟเวอร์ 500 และรายการใดรายการหนึ่ง มีการแสดงรหัสข้อผิดพลาดของนโยบายที่เกี่ยวข้อง (ไม่ใช่แค่ ExecutionFailed)

ลูกค้า Cloud ต้องติดต่อทีมสนับสนุนของ Apigee Edge เพื่อตั้งค่า ขององค์กร

หัวข้อที่เกี่ยวข้อง

ภัยคุกคามของ JSON นโยบายการป้องกัน

เบนซินธรรมดา นโยบายการปกป้องนิพจน์