How to write HP Fortify Custom Rules language Specific? (595 Views)
Reply
Occasional Collector
michaelhidalgo
Posts: 1
Registered: ‎09-02-2013
Message 1 of 1 (595 Views)

How to write HP Fortify Custom Rules language Specific?

Hi guys,

I'm running HP Fortify 5.16  and I'm writting some custom rules. The problem I'm facing is that Custom Rules are not language Specific. If I create a custom rule that matches SQL Injection for instance, This rule is presented either if I'm running a Java project or a .NET project.

 

Do you know how to make this custom description language specific. It seems like the match is performed by category and the language is ignored because the below description appears when both projects are scanned (.NET and Java).

 

I would expect that this custom description is displayed just for .NET because I used the language attribute (see below rule)

 

Note that I'm using the language attribute but it seems like it is ignored. This is an example of the Custom rule : Look that I used the Language attribute :

 

<?xml version="1.0" encoding="UTF-8"?>
<RulePack xmlns="xmlns://www.fortifysoftware.com/schema/rules">
<RulePackID>9F5481F2-B600-48CE-9DBE-F195F5DAFB82</RulePackID>
<SKU>SKU-9F5481F2-B600-48CE-9DBE-F195F5DAFB82</SKU>
<Name>Secure Coding Rules, Core, .NET</Name>
<Version>1.0</Version>
<Language>dotnet</Language>
<Description><![CDATA[Secure Coding Rules, Core, .NET]]></Description>
<Rules version="3.16" language="dotnet" >
<RuleDefinitions>
<CustomDescriptionRule formatVersion="3.16" language="dotnet">
<RuleID>D50B314C-F9D6-424F-9D62-BB1FA3D3C74C</RuleID>
<Notes></Notes>
<RuleMatch>
<Category>
<Value>SQL Injection</Value>
</Category>

</RuleMatch>
<Description formatVersion="3.16" language="dotnet" >
<Explanation><![CDATA[SQL Injection custom rule
Hi There!, this is a .NET custom description!
]]></Explanation>
<Tips>
<Tip><![CDATA[Validate all input:]]></Tip>
<Tip><![CDATA[ this is another Tip]]></Tip>
<Tip><![CDATA[<a href="http://www.google.com">link</a> <h1> header </h1> text]]></Tip>
</Tips>
<ContentType value="HTML"/>
</Description>
</CustomDescriptionRule>
</RuleDefinitions>
</Rules>
</RulePack>

 

 

I appreciate your help!.

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation