scan (sc)
說明
掃描某個應用程式(或所有應用程式)、專案、資料夾或檔案。使用這個指令需要有效的 AppScan® Source for Automation 授權。
重要: 如果您使用的 AppScan® 來源 專案在開發環境中(例如 IBM®MobileFirst Platform 專案)有相依關係,請務必先在開發環境中建置專案,然後再匯入它。匯入專案之後,如果您修改其中的檔案,請務必先在開發環境中重建它,再於 AppScan® 來源 中掃描(如果不這樣做,AppScan® 來源 會忽略您對檔案所做的修改)。
註: 掃描資料夾時,不論語言如何,依預設都會掃描目標檔案夾中的所有檔案。因此,掃描結果可能與掃描應用程式或專案不同。若要鎖定特定的檔案,請建立一個
appscan-config.xml
檔案來定義掃描目標。當 appscan-config.xml
檔案出現在目標檔案夾中時,掃描程式會自動考慮其中的配置資訊。語法
scan [path][config <proj_config>][-name <assessment_name>]
[-scanconfig <scan_configuration_name>] [-sourcecodeonly <true/false>]
path
:選用。所匯出評量的完整儲存路徑和檔名 (.ozasmt)。註:- 如果您指定有效的目錄,但未指定檔名,則會根據您建立評量時使用的應用程式名稱、專案名稱及掃描配置,建立評量檔 (.ozasmt)。
- 如果您指定有效的目錄,但指定的檔名不存在,則會在該位置中使用指定的檔名建立評量檔。
- 如果您指定的檔案已存在,則會改寫現有檔案。
- 如果您在不存在的目錄中指定檔名 (.ozasmt),則不會儲存評量。
config <proj_config>
:選用。這個引數只對專案層次評量有效。如果專案有配置檔,請使用這個引數來指定它。-name <assessment_name>
:選用。提供評量的名稱。AppScan® 來源 用戶端產品中使用這個名稱來區別不同的評量(例如,在 AppScan® Source for Analysis 中,此名稱會出現在「我的評量」視圖的名稱直欄中)。-scanconfig <scan_configuration_name>
:選用。指定要用於掃描的掃描配置名稱。如果未指定掃描配置,掃描時會使用預設掃描配置。-sourcecodeonly <true/false>
:選用。請指定只掃描原始檔,並忽略其他支援的檔案類型 (.dll
、.exe
)。有效的值為true
和false
。註:- 只有在資料夾掃描時,才支援
-sourcecodeonly
選項。其不適用於應用程式和專案掃描。 -sourcecodeonly
是true
,且已提供appscan-config.xml
時 ,指令行指定的參數優先。
- 只有在資料夾掃描時,才支援
範例
- 掃描所有應用程式中的專案的預設配置:
AllApplications>> Scan
其結果如下:
New Scan started . . Preparing for Vulnerability Analysis... Performing Vulnerability Analysis... Generating Findings... Preparing project for scan... . . Scanned Project: Total files: 15 Total findings: 167 Total lines: 385 vkloc: 0.44448395412925595 v-Density: 22.446439683527426 Scanned Application: Total files: 15 Total findings: 167 Total lines: 385 vkloc: 0.44448395412925595 v-Density: 22.446439683527426 Scan completed: Total files: 15 Total findings: 167 Total lines: 385 vkloc: 0.44448395412925595 v-Density: 22.446439683527426 Elapsed Time - 18 Seconds
New Scan started. Please wait... Assessment complete ------------------- Total Call Sites: 75 Total Definitive Security Findings with High Severity: 25 Total Definitive Security Findings with Medium Severity: 37 Total Definitive Security Findings with Low Severity: 9 Total Suspect Security Findings with High Severity: 20 Total Suspect Security Findings with Medium Severity: 80 Total Suspect Security Findings with Low Severity: 60 Total Scan Coverage Findings with High Severity: 50 Total Scan Coverage Findings with Medium Severity: 33 Total Scan Coverage Findings with Low Severity: 17 Total Lines: 3000 ...
- 掃描 Prj1 的除錯配置:
AllApplications\Prj1>> SC config debug
- 如果要掃描資料夾,請執行下列動作:
AllApplications>> of C:\workspace\SimpleIOT SimpleIOT>> Scan