
More best practices covered in API Security Best Practices blog series.
Refer Rate limit API calls blog to create an API Proxy to an OData API from SAP Gateway and applying an API Rate limit using Quota policy. In this blog we would be extending the same to add the support for data masking for OData APIs.
<XMLThreatProtection async="false" continueOnError="false" enabled="true" xmlns="http://www.sap.com/apimgmt">
<NameLimits>
<Element>50</Element>
<Attribute>10</Attribute>
<NamespacePrefix>10</NamespacePrefix>
<ProcessingInstructionTarget>10</ProcessingInstructionTarget>
</NameLimits>
<Source>request</Source>
<StructureLimits>
<NodeDepth>10</NodeDepth>
<AttributeCountPerElement>5</AttributeCountPerElement>
<NamespaceCountPerElement>5</NamespaceCountPerElement>
<ChildCount includeComment="true" includeElement="true" includeProcessingInstruction="true" includeText="true">50</ChildCount>
</StructureLimits>
<ValueLimits>
<Text>50</Text>
<Attribute>100</Attribute>
<NamespaceURI>100</NamespaceURI>
<Comment>10</Comment>
<ProcessingInstructionData>10</ProcessingInstructionData>
</ValueLimits>
</XMLThreatProtection>
Note that the values of XML threat protection limit used in this blog is just a sample and a lower value has been set for ease of testing.
request.verb = "PUT" or request.verb = "POST"
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
<category term="GWSAMPLE_BASIC.SalesOrder" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<link href="SalesOrderSet('0500000000')/ToLineItems" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ToLineItems" type="application/atom+xml;type=feed" title="ToLineItems">
<m:inline>
<feed>
<entry>
<category term="GWSAMPLE_BASIC.SalesOrderLineItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/xml">
<m:properties>
<d:ItemPosition>0000000010</d:ItemPosition>
<d:ProductID>HT-1031</d:ProductID>
<d:Note>EPM DG</d:Note>
<d:NoteLanguage>EN</d:NoteLanguage>
<d:CurrencyCode>GBP</d:CurrencyCode>
<d:GrossAmount>1017.45</d:GrossAmount>
<d:NetAmount>855.00</d:NetAmount>
<d:TaxAmount>162.45</d:TaxAmount>
<d:DeliveryDate>2017-08-24T04:00:00.0000000</d:DeliveryDate>
<d:Quantity>3</d:Quantity>
<d:QuantityUnit>EA</d:QuantityUnit>
</m:properties>
</content>
</entry>
</feed>
</m:inline>
</link>
<content type="application/xml">
<m:properties>
<d:Note>EPM DG</d:Note>
<d:NoteLanguage>EN</d:NoteLanguage>
<d:CustomerID>0100000000</d:CustomerID>
<d:CustomerName>SAP</d:CustomerName>
<d:CurrencyCode>EUR</d:CurrencyCode>
<d:GrossAmount>28142.31</d:GrossAmount>
<d:NetAmount>23649.00</d:NetAmount>
<d:TaxAmount>4493.31</d:TaxAmount>
<d:LifecycleStatus>N</d:LifecycleStatus>
<d:LifecycleStatusDescription>New</d:LifecycleStatusDescription>
<d:BillingStatus/>
<d:BillingStatusDescription>Initial</d:BillingStatusDescription>
<d:DeliveryStatus/>
<d:DeliveryStatusDescription>Initial</d:DeliveryStatusDescription>
<d:CreatedAt>2017-08-17T04:00:00.0000000</d:CreatedAt>
<d:ChangedAt>2017-08-18T07:21:02.6190000</d:ChangedAt>
</m:properties>
</content>
</entry>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
<category term="GWSAMPLE_BASIC.SalesOrder" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<link href="SalesOrderSet('0500000000')/ToLineItems" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ToLineItems" type="application/atom+xml;type=feed" title="ToLineItems">
<m:inline>
<feed>
<entry>
<category term="GWSAMPLE_BASIC.SalesOrderLineItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/xml">
<m:properties>
<d:ItemPosition>0000000010</d:ItemPosition>
<d:ProductID>HT-1031</d:ProductID>
<d:Note>EPM DG: SO ID 0500000000 Item 0000000090</d:Note>
<d:NoteLanguage>EN</d:NoteLanguage>
<d:CurrencyCode>GBP</d:CurrencyCode>
<d:GrossAmount>1017.45</d:GrossAmount>
<d:NetAmount>855.00</d:NetAmount>
<d:TaxAmount>162.45</d:TaxAmount>
<d:DeliveryDate>2017-08-24T04:00:00.0000000</d:DeliveryDate>
<d:Quantity>3</d:Quantity>
<d:QuantityUnit>EA</d:QuantityUnit>
</m:properties>
</content>
</entry>
</feed>
</m:inline>
</link>
<content type="application/xml">
<m:properties>
<d:Note>EPM DG: SO ID 0500000000 Deliver as fast as possible</d:Note>
<d:NoteLanguage>EN</d:NoteLanguage>
<d:CustomerID>0100000000</d:CustomerID>
<d:CustomerName>SAP</d:CustomerName>
<d:CurrencyCode>EUR</d:CurrencyCode>
<d:GrossAmount>28142.31</d:GrossAmount>
<d:NetAmount>23649.00</d:NetAmount>
<d:TaxAmount>4493.31</d:TaxAmount>
<d:LifecycleStatus>N</d:LifecycleStatus>
<d:LifecycleStatusDescription>New</d:LifecycleStatusDescription>
<d:BillingStatus/>
<d:BillingStatusDescription>Initial</d:BillingStatusDescription>
<d:DeliveryStatus/>
<d:DeliveryStatusDescription>Initial</d:DeliveryStatusDescription>
<d:CreatedAt>2017-08-17T04:00:00.0000000</d:CreatedAt>
<d:ChangedAt>2017-08-18T07:21:02.6190000</d:ChangedAt>
</m:properties>
</content>
</entry>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
22 | |
9 | |
8 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |