簡體   English   中英

HP Fortify ASP.Net Web表單

[英]HP Fortify ASP.Net Web Forms

我有這個.bat文件,它掃描工作中的我的一個應用程序。

我正在比較兩種生成.fpr文件的方式:

  • 使用掃描向導
  • 使用適用於Visual Studio的HP Fortify插件。

發生的情況是,當.fpr文件由掃描向導的.bat文件生成時,它似乎完全忽略了應用程序內部的所有.aspx,aspx.cs和.cs文件。

我的應用程序是一個舊的Web窗體,為了發布它,我們需要在Visual Studio中選擇該預編譯選項。

我已經在帖子中嘗試過Eric的解決方案。 HP Fortify掃描得到ASP預編譯錯誤

但是仍然沒有。

我已經嘗試過在發布前后生成bat文件,但是它們都返回了相同數量的漏洞。 大約15。發布后,它會為所有頁面生成dll,這意味着從理論上講它應該檢測所有應用程序代碼。

另一方面,當我通過Visual Studio插件生成.fpr文件時,它返回了大約600個漏洞。

我真正的問題是,我們需要運行.bat文件而不是Visual Studio,因為我們有一個持續的集成過程,在該過程中,我們構建應用程序,運行代碼分析,然后由HP Fortify完成該過程,所以我當我使用.bat文件運行時,需要使運行該插件返回的漏洞數量相同。

任何幫助將不勝感激。

感謝您的時間 !

您可以執行幾種不同的選擇。

1)在裝有Fortify插件的CI機器上安裝Visual Studio。 這是我使用Visual Studio掃描WebGoat.Net的示例批處理文件

sourceanalyzer -b test -clean

sourceanalyzer -b test -Xmx6G -verbose -debug -logfile vs_translate.txt "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe" NewWebForms.sln /REBUILD Debug

sourceanalyzer -b test -show-files > vs_files.txt

sourceanalyzer -b test -show-build-warnings > vs_warnings.txt

sourceanalyzer -b test -verbose -debug -logfile vs_scanlog.txt -scan -f vs_scan.fpr

fprutility -information -categoryIssueCounts -project vs_scan.fpr

2)使用最新版本的Fortify(16.20),您可以直接掃描.Net代碼。 這是我創建的用於掃描WebGoat.Net的批處理文件

sourceanalyzer -b test -clean

sourceanalyzer -b test -dotnet-version 4.5.2 -cs-extern-alias "global=C:\Samples\NewWebForms\packages\Microsoft.AspNet.Identity.EntityFramework.2.2.1\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll;global=C:\Samples\NewWebForms\packages\Microsoft.AspNet.Identity.Core.2.2.1\lib\net45\Microsoft.AspNet.Identity.Core.dll;global=C:\Samples\NewWebForms\packages\Microsoft.AspNet.Identity.Owin.2.2.1\lib\net45\Microsoft.AspNet.Identity.Owin.dll;global=C:\Samples\NewWebForms\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll" -dotnetwebroot NewWebForms\ -libdirs packages\**/*.dll;NewWebForms\bin\*.dll NewWebForms\**/*

sourceanalyzer -b test -show-files > cmd_files.txt

sourceanalyzer -b test -show-build-warnings > cmd_warnings.txt

sourceanalyzer -b test -Xmx6G -verbose -debug -logfile cmd_scanlog.txt -scan -f cmd_scan.fpr

fprutility -information -categoryIssueCounts -project cmd_scan.fpr

3)如果需要,還可以掃描項目的編譯.dll。 這是我掃描WebGoat.Net所做的

sourceanalyzer -b test -Xmx8G -vsversion 14.0 
               @excludelist.txt 
               -Dcom.fortify.sca.SourceFiles=WebGoat.NET\WebGoat 
               -libdirs WebGoat.NET\WebGoat\bin WebGoat.NET\**/*.dll
               WebGoat.NET/**/*

要對此進行更詳細的了解,請看一下我在Fortify上的回答, 以掃描第三方dll的

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM