2016-03-29 70 views
0

我提的使用-libdirs並獲得以下錯誤庫路徑:Scanning.Net代碼庫與Fortify的掃描嚮導和-libdirs參數

Extracting Arguments File 
Searching VS Version.... 
Found .NET 4.0 setting to VS version 10.0 
Cleaning previous scan artifacts 
Translating files 
[error]: No parameter specified for argument -libdirs 
Fortify Static Code Analyzer 5.15.0.0060 
Copyright (c) 2003-2012 Fortify Software 
For command-line help, type 'sourceanalyzer -h' 
Sourceanalyzer failed, exiting 
vices\bin\Debug\Shared.Services.dll was unexpected at this time. 
the same thing. 

我加入以下行來設置-libdirs參數(路徑只是舉例): 集LIBDIRS = -libdirs 「C:\ Program Files文件\ HP_Fortify \ HP_Fortify_SCA_and_Apps_4.21 \樣本\高級\ webgoat」

可有人告訴我如何使用-libdirs同時掃描與掃描嚮導。

回答

2

當使用掃描嚮導時,如果你想添加對外部庫的引用,這可以在「評論源文件」被稱爲「.Net參考目錄」之後在scree上完成(我將其指向.Net這我假設你的項目在您的輸出也並給出了「搜索VS版本...」)

Showing the HPE Fortify Scan Wizard screen that allows you to point to folders that contain references for the project you are scanning.

我不知道你的具體情況,但如果你要掃描.NET應用程序,我會推薦進行構建集成。在第二個屏幕,「查看源文件」,我將使構建集成的Visual Studio

Showing the HPE Fortify Scan Wizard. ON the Review Source file tab/page, highlighting the Enable Build Integration at the bottom wtih "Visual Studio" checked.

然後確保你設置的構建集成設置下頁

Showing the HPE Fortify Scan Wizard step where setting the Visual Studio Integration Settings are set.

上如果您想繼續使用掃描嚮導,則可以執行此操作。

個人而言,我更喜歡直接創建自己的批處理文件(.bat)來調用sourceanalyzer.exe。 (「掃描嚮導」會創建一些複雜的批處理文件,以後難以進行調試/修改)。

如果你想創建自己的批處理文件,你需要確保你做3個命令(可能是4,如果你想自動上傳到SSC [這裏沒有顯示])

下面是一個批處理的例子文件我有掃描.Net應用程序

sourceanalyzer -b BeforeDebugTest -clean 

sourceanalyzer -b BeforeDebugTest "D:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe" "D:\Samples\DebugReleaseScanTest\DebugReleaseScanTest.sln" /REBUILD Debug 

sourceanalyzer -b BeforeDebugTest -Xmx8G -scan -f BeforeDebugTest.fpr 

正如你可以用這個,我使用了兩種devenv.exe的(Visual Studio的2015年在這種情況下)和.sln文件的絕對路徑看。這使我可以從我想要的位置和常規命令行窗口中運行此批處理文件,並且不會將我限制爲「Visual Studio命令提示符工具」。

-Xmx8G正在使用Fortify 8G內存。一般來說,你想給Fortify儘可能多的內存。