ScanApplication
說明
掃描指定的應用程式以及執行與掃描相關的其他動作。
語法
ounceauto ScanApplication
-application <name of application>|
-application_file <path to application file>
[-name <assessment name>]
[-scanconfig <scan_configuration_name>]
[-waitforlicense <wait_time>]
[-save <filename>]
[-caller <caller>]
[-publish]
[-clearcache]
[-report <report type> <output format> <output location>]
[-export <export type> <output location>]
[-includeSrcBefore <n>]
[-includeSrcAfter <n>]
[-includeTraceDefinitive]
[-includeTraceSuspect]
[-includeTraceCoverage]
[-includeHowToFix]
[-appserver_type]
[-include_all_lib_jars]
[-include_lib_jars]
[-no_ear_project]-application <name of application>或-application_file <path to application file>:其中之一是必要的。- 如果您指定
-application <name of application>,請指出要掃描之應用程式的名稱。 - 如果您指定
-application_file <path to application file>,請指出下列其中一個檔案類型的完整路徑和檔名:- AppScan® Source 應用程式檔案 (.paf)。
- Eclipse 工作區 (.ewf)註: .ewf 當您使用
openapplication來開啟工作區目錄時(指定其路徑),會產生檔案。 - WAR 檔案 (.war)
- EAR 檔案 (.ear)
- 僅限 Windows:Microsoft™ Visual C++ 工作區檔案 (.dsw)
- 僅限 Windows:Microsoft™ Visual Studio.NET 解決方案檔 (.sln)
註: 如果要瞭解 AppScan® Source for Analysis、AppScan® Source for Automation 和 AppScan® Source command line interface 支援哪些版本的匯入檔案,請參閱 系統需求和安裝必備項目。在此頁面上,選取您使用的 AppScan® Source 版本標籤,然後選取您使用的 AppScan® Source 元件。如果 AppScan® Source 支援開啟及掃描來自其他開發環境的檔案,該支援會列在支援的軟體標籤的編譯器與語言區段中。
- 如果您指定
-name <assessment name>:選用。評量的名稱。-scanconfig <scan_configuration_name>:選用。指定要用於掃描的掃描配置名稱。如果未指定掃描配置,掃描時會使用預設掃描配置。-waitforlicense <wait_time>:選用。指定當 AppScan® Source for Automation 授權不可用時,掃描所要等待的時間(以分鐘為單位)。若沒有使用-waitforlicense指示等待時間,則會從CLI.ozsettings取得預設值。可以透過將值設定為 0 來停用等待時間。-save <filename>:選用。將評量結果儲存到這個檔案。-caller <caller>:選用。將呼叫者指派至該作業。呼叫者可以是實際的使用者,但這不是必要的。呼叫者名稱會寫入ounceauto日誌檔。-publish:選用。在掃描之後發佈評量。-clearcache:選用。掃描之前,移除漏洞分析快取和自訂規則簽章資料。-report:選用。在掃描之後產生報告。- 必要的
-report指令選項:<report type>:報告的類型。報告類型是由發現項目報告、AppScan® Source 報告及自訂報告所組成。請參閱 GenerateReport 中的選項。<output format>:指定報告格式。請參閱 GenerateReport 中的選項。<output location>:儲存報告的位置。
- 選用的
-report指令選項:-includeSrcBefore <n>:要包括在每一個發現項目之前的原始碼行數。-includeSrcAfter <n>:要包括在每一個發現項目之後的原始碼行數。-includeTraceDefinitive:在明確發現項目的報告中併入追蹤資訊(請參閱 分類 以瞭解發現項目分類)。-includeTraceSuspect:在可疑項目發現項目的報告中併入追蹤資訊。-includeTraceCoverage:在掃描涵蓋面發現項目的報告中併入追蹤資訊。
- 必要的
-export:選用。將掃描發現項目匯出至 CSV 或 SARIF 檔。如果使用,則需要下列指令選項。<export type>:匯出報告的格式,可以是 CSV 或 SARIF。<output location>:用來儲存報告的路徑和檔名。
-includeHowToFix:包括有關如何處理和更正發現項目的諮詢資訊。-appserver_type:選用。如果您要開啟的應用程式包括 JavaServer Pages(例如 WAR 或 EAR 檔),請使用這項設定來指定用於 JSP 編譯的應用程式伺服器。請指定下列其中一項(以雙引號括住):Tomcat 8Tomcat 9WebSphere 7.0WebSphere 8.0WebSphere 8.5WebLogic 11gWebLogic 12c
註:- 在指定應用程式伺服器之前,請先確定其已在 AppScan® Source for Analysis 喜好設定中適當地配置。
- 如果未使用
-appserver_type,則會使用 AppScan® Source for Analysis 中目前設定的預設 JSP 編譯器進行 JSP 編譯。既有的 Tomcat 9 即是預設 JSP 編譯器。
- 若為 WAR 檔:
-include_all_lib_jars:使用此設定,即可在掃描期間在 WAR 檔中併入所有程式庫。-include_lib_jars:使用此設定,即可指定掃描期間要在 WAR 檔中併入哪些程式庫。使用此設定時,請不要加入程式庫路徑資訊,並以逗點分隔多個程式庫。
-no_ear_project:在匯入 EAR 檔時,系統會自動建立專案來儲存共用程式庫。如果沒有共用程式庫,會建立專案,但專案是空的。使用此設定時,不會為 EAR 檔建立專案。
回覆值
要求 ID(如果成功)或 -1(如果要求提交不成功)。
範例
- 掃描 WebGoat 應用程式,發佈它,並在日誌中標註 John Smith 是呼叫者:
ounceauto scanapplication -application_file C:\WebGoat\WebGoat.paf -publish -caller JohnSmith - 掃描 WebGoat 應用程式,並在 C:\WebGoat directory 中建立發現項目報告。在報告中,併入明確發現項目的追蹤資訊:
ounceauto scanapplication -application WebGoat -report Findings html C:\WebGoat\MyReport.html -includeTraceDefinitive - 掃描 WAR 檔且只併入其部分的程式庫:
ounceauto scanapplication -application_file c:\mywar.war -include_lib_jars lib1.jar,lib2.jar