[Fortify] 언어 별 분석 방법 정리

REM ##########################################################################
REM Clean
REM ##########################################################################
sourceanalyzer -b test -clean

REM --------------------------------------------------------------------------
REM Android
REM --------------------------------------------------------------------------
sourceanalyzer -b test -Xmx8192m -Xss16m -logfile test_translate.log gradlew assemble taskname

REM --------------------------------------------------------------------------
REM ASP
REM --------------------------------------------------------------------------
sourceanalyzer -b test -Xmx8192m -Xss16m -logfile test_translate.log "-Dcom.fortify.sca.ASPVirtualRoots=C:\files\foo" "-Dcom.fortify.sca.ASPVirtualRoots.Include=C:\WebServer\CustomerOne\inc" "-Dcom.fortify.sca.ASPVirtualRoots.Library=C:\WebServer\CustomerTwo\Stuff"

REM --------------------------------------------------------------------------
REM C/C++
REM --------------------------------------------------------------------------
sourceanalyzer -b test -Xmx8192m -Xss16m -logfile test_translate.log gcc -I. -o hello.o -c helloworld.c

REM --------------------------------------------------------------------------
REM C/C++ Make (Pro*C)
REM --------------------------------------------------------------------------
sourceanalyzer -b test -Xmx8192m -Xss16m -logfile test_translate.log touchless make -f Makefile

REM --------------------------------------------------------------------------
REM .NET (C#)
REM --------------------------------------------------------------------------
SET "PATH=%PATH%;C:\Program Files\Fortify\Fortify_SCA_and_Apps_20.1.2\Core\private-bin\sca\MSBuild\Current\Bin"
sourceanalyzer -b test -Xmx16g -Xss16m -encoding UTF-8 -logfile test_translate.log C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe D:\dotnet_project\test.sln /logger "C:\Program Files\Fortify\Fortify_SCA_and_Apps_20.1.2\Core\lib\FortifyMSBuildTouchless.dll" /fl /t:Rebuild /p:Configuration=Debug

REM --------------------------------------------------------------------------
REM Apple IOS
REM --------------------------------------------------------------------------
sourceanalyzer -b test -Xmx8192m -Xss16m -logfile test_translate.log xcodebuild clean build -workspace DemoAppSwift.xcworkspace -scheme DemoAppSwift -sdk iphonesimulator

REM --------------------------------------------------------------------------
REM Java
REM --------------------------------------------------------------------------
sourceanalyzer -b test -Xmx8192m -Xss16m -logfile test_translate.log -cp "build/classes:lib/*.jar" "/**/*.java"

REM --------------------------------------------------------------------------
REM Java EE
REM --------------------------------------------------------------------------
sourceanalyzer -b test -Xmx8192m -Xss16m -logfile test_translate.log -cp "build/classes:lib/*.jar" "/**/*.jsp" "/**/*.xml"

REM --------------------------------------------------------------------------
REM Java ANT
REM --------------------------------------------------------------------------
sourceanalyzer -b test -Xmx8192m -Xss16m -logfile test_translate.log ant build.xml

REM --------------------------------------------------------------------------
REM Java Gradle
REM --------------------------------------------------------------------------
sourceanalyzer -b test -Xmx8192m -Xss16m -logfile test_translate.log gradle clean build
sourceanalyzer -b test -Xmx8192m -Xss16m -logfile test_translate.log gradle --info assemble

REM --------------------------------------------------------------------------
REM Java Maven (maven 플러그인이 기 설치되어 있어야 한다)
REM --------------------------------------------------------------------------
REM mvn com.fortify.sca.plugins.maven:sca-maven-plugin:20.1.2:clean
REM mvn com.fortify.sca.plugins.maven:sca-maven-plugin:20.1.2:translate
sourceanalyzer -b test -Xmx8192m -Xss16m -logfile test_translate.log -exclude "fileA;fileB;fileC;" mvn package

REM --------------------------------------------------------------------------
REM Python
REM --------------------------------------------------------------------------
sourceanalyzer -b test -Xmx8192m -Xss16m -logfile test_translate.log -python-version 3 -python-path "/usr/lib/python3.4:/usr/local/lib/python3.4/site-packages" "src/*.py"

REM --------------------------------------------------------------------------
REM SQL
REM --------------------------------------------------------------------------
sourceanalyzer -b test -Xmx8192m -Xss16m -logfile test_translate.log -sql-language TSQL "sources/**/*.sql"
sourceanalyzer -b test -Xmx8192m -Xss16m -logfile test_translate.log -sql-language PL/SQL "sources/**/*.pks"

REM ##########################################################################
REM MBS Export
REM ##########################################################################
sourceanalyzer -b test -export-build-session test.mbs

REM ##########################################################################
REM MBS Import 후 Scan
REM ##########################################################################
sourceanalyzer -b test -clean
sourceanalyzer -b test -import-build-session test.mbs
sourceanalyzer -b test -Xmx8192m -Xss16m -logfile test_scan.log -scan -f test.fpr

REM ##########################################################################
REM Application ID 열람
REM ##########################################################################
fortifyclient -url "http://10.10.10.31:8080/ssc" -user admin -password pass1234 listApplicationVersions

REM ##########################################################################
REM SSC에 FPR 업로드
REM ##########################################################################
fortifyclient -url "http://10.10.10.31:8080/ssc" -user admin -password pass1234 uploadFPR -file test.fpr -applicationVersionID 1002
위로 스크롤