EASY7
Fortify Linux 본문
Fortify 리눅스에서 사용하기
1. 압축파일 풀기
$tar xvzf 압축파일
2. run 파일 실행 시키기
./~~~~~.run 파일
3. 라이센스 위치 넣기
리눅스는 평가판이 없기때문에(?) 제품 구매후 라이센스 필요함.
4. Update server URL 은 https://update.fortify.com으로 하고 다음.
5. 이전에 설치한 SCA 병합하는지 -> NO
Static Code Analyzer임.
6. 자동으로 update해줌.
/opt/Fortify/Fortify_SCA_and_Apps_18.10/Core/config/rules에 룰 파일들이 있음을 알 수 있다.
/opt/Fortify/Fortify_SCA_and_Apps_18.10/bin에 sourceanalyzer가 있음.
root@kali:/opt/Fortify/Fortify_SCA_and_Apps_18.10/bin# ./sourceanalyzer -h Fortify Static Code Analyzer 18.10.0187 Copyright (c) 2003-2018 Micro Focus or one of its affiliates Usage: Clean: sourceanalyzer -b -clean Build: sourceanalyzer -b Scan: sourceanalyzer -b -scan Detailed invocation: Build: sourceanalyzer -b [ ] sourceanalyzer -b [ ] sourceanalyzer -b [ ] touchless [ ] sourceanalyzer -b [ ] devenv /REBUILD Debug sourceanalyzer -b [ ] xcodebuild -project sourceanalyzer -b mybuild -source-base-dir Scan: sourceanalyzer -b -scan [ -f ] [ -findbugs [ -java-build-dir ] ] [ -rules <rules.xml> [ -no-default-rules ] ] [ -filter ] Clean: sourceanalyzer -b -clean Query: sourceanalyzer -b { -show-build-warnings | -show-files } sourceanalyzer { -version | -show-build-ids } sourceanalyzer { -h | -? | -help } Options General Options These options are applicable to all sourceanalyzer invocations. @ Reads command line options from the specified file. Note that there is no space before the file argument. -debug Causes the build step to write additional troubleshooting information to the log file. Use if instructed by Fortify Technical Support. Also see "-logfile". -logfile Specifies a destination for the log file. -verbose Outputs verbose messages to the console. -XmxM Specifies the maximum Java heap size. Default is -Xmx1800M. -autoheap Instructs SCA to set the maximum Java heap size based on available physical memory. Use instead of -Xmx. -version Shows the sourceanalyzer version string. Command Options Note: Only one "command" option is allowed per invocation. -h Displays this help text. -help -? -clean Deletes all intermediate files and build records. When a build ID is also specified with -b, only files and build records related to that build ID are deleted. -show-binaries See the Fortify SCA User's Guide. -show-build-tree See the Fortify SCA User's Guide. -show-build-ids Lists all the Fortify build IDs (analysis models). -show-build-warnings Displays all the actionable warnings that occurred during the translation phase of the build ID specified by "-b". -show-files Displays all the source files built into the model specified by "-b". -show-loc Displays lines of code processed for files built into the model specified by "-b". This is the number of lines that would be deducted by a scan in per-use mode. -scan Causes sourceanalyzer to run an analysis. (none) If no command option is present, a build step is assumed. Build Options "Build" options translate source code into a Fortify analysis model. -b Specifies a unique name that identifies the Fortify analysis model to be built. Also see "-scan". -build-label Java sources are being compiled. May also be specified at scan time. Other Language-Specific Build Options -libdirs Accepts a colon or semicolon separated list of directories where reference DLLs are located. (For .NET builds). -dotnet-version Specifies target .Net framework version for .NET projects. Valid values are from 2.0 to 4.7.1. This option replaces deprecated -vsversion option. Must be specified at build time. -dotnetwebroot The home directory of an ASP.Net project. For .NET Web applications. -source-base-dir The base directory for a ColdFusion application. -python-path Add an import directory for a Python application. -apex Set ".cls" file extension to Apex language. (VB6 by default). The same if use -Dcom.fortify.sca.fileextensions.cls=APEX -apex-sobject-path Add file to load SObject types in Apex application. Scan Options -b Specifies the build ID. The build ID is used to track which files are compiled and linked as part of a build, to later scan those files. This option may be specified more than once to include multiple build IDs in the same scan. -bin All source files compiled and linked into the specified binary are scanned. Multiple binaries may be specified. -disable-default-rule-type See the Fortify SCA User's Guide. -f The file to which analysis results are written. Default is stdout. -filter Specifies a filter file. For more information, see the Fortify SCA User's Guide. -findbugs Enable FindBugs integration for Java scans. See "-java-build-dir". -java-build-dir Java sources have been compiled. May also be specified at build time. -no-default-issue-rules See the Fortify SCA User's Guide. -no-default-sink-rules See the Fortify SCA User's Guide. -no-default-source-rules See the Fortify SCA User's Guide. -no-default-rules Indicates that Fortify SCA should not use its default rules. Must be used in conjuction with "-rules" -rules Specifies custom rules file or directory. If a directory is specified, all files ending in ".bin" or ".xml" are included. This option may be used multple times. -quick Runs a quick scan. Quick scans complete faster at the cost of reduced accuracy. -quiet Disables the command line progress bar. -scan Causes Fortify SCA to perform analysis against a model. The model must be specified with "-b". -source-archive See the Fortify SCA User's Guide. Build Sessions -export-build-session <file.mbs> Store the translated model specified by -b to the specified file. -import-build-session <file.mbs> Load the specified file into a build model. If the build id of the model already exists in the model registry, the import fails with the message that a build already exists with that id. EXAMPLES Build examples: Generic (Java, configuration, PHP, JavaScript, ASP/VBScript, VB6): sourceanalyzer -b mybuild . sourceanalyzer -b mybuild file1.java file2.java sourceanalyzer -b mybuild *.bas *.cls *.frm sourceanalyzer -b mybuild "site/**/*.php" ColdFusion translation: sourceanalyzer -b mybuild -source-base-dir /www/app "/www/app/**/*.cfm" SQL translation: sourceanalyzer -b mybuild -Dcom.fortify.sca.fileextensions.sql=PLSQL *.sql sourceanalyzer -b mybuild -Dcom.fortify.sca.fileextensions.sql=TSQL *.sql C/C++ builds: sourceanalyzer -b mybuild gcc -c test.c sourceanalyzer -b mybuild CL.EXE /o HelloWorld HelloWorld.c sourceanalyzer -b mybuild touchless make sourceanalyzer -b mybuild devenv myproject.msproj /REBUILD sourceanalyzer -b mybuild touchless perl build.pl Objective-C/C++ builds: sourceanalyzer -b mybuild clang -ObjC HelloWorld.m sourceanalyzer -b mybuild xcodebuild -project myproject.xcodeproj .NET builds: sourceanalyzer -b mybuild -dotnet-version 4.5 -libdirs 3rdParty\Lib myCode\*.cs sourceanalyzer -b mybuild -dotnet-version 4.0 -dotnetwebroot myCode\Web -libdirs 3rdParty\Lib myCode\*\*.cs myCode\Web\*.aspx sourceanalyzer -b mybuild devenv myproj.sln /REBUILD DEBUG Java specific builds: sourceanalyzer -b mybuild -cp lib/dependency.jar "src/**/*.java" sourceanalyzer -b mybuild -cp mytaglibs.jar webapp/*.jsp sourceanalyzer -b mybuild touchless ant J2EE specific builds: sourceanalyzer -b mybuild -cp "app/WEB-INF/lib/*.jar" app/*.jsp Scan step: sourceanalyzer -b mybuild -scan -f results.fpr Java build / scan with FindBugs support: sourceanalyzer -b fb -java-build-dir classes "src/**/*" sourceanalyzer -b fb -scan -findbugs -java-build-dir classes -f results.fpr See Fortify SCA User's Guide for a complete explanation of each SCA option. You can open a support case for Fortify products online using our customer support system. This streamlined procedure is designed to provide easier access and improved customer satisfaction. Access your account at the Fortify Support Portal at https://softwaresupport.softwaregrp.com/. |
sourceanalyzer -b <build_id> -clean
sourceanalyzer -b <build_id>...
sourceanalyzer -b <build_id> -scan -f <results>.fpr
sourceanalyzer -clean : 청소하기
sourceanalyzer -b 파일명: build 하기
sourceanalyzer -b -scan 파일명 : build 후 스캔하기
sourceanalyzer -scan 파일명 : build 된 파일 스캔하기
b가 세션인가??빌드 번호.
제공해주는 Sample사용해보기
/opt/Fortify/Fortify_SCA_and_Apps_18.10/Samples/
/opt/Fortify/Fortify_SCA_and_Apps_18.10/bin/sourceanalyzer
$ /opt/Fortify/Fortify_SCA_and_Apps_18.10/bin/sourceanalyzer -b sample-php -clean
$ /opt/Fortify/Fortify_SCA_and_Apps_18.10/bin/sourceanalyzer -b sample-php source.php sink.php
$ /opt/Fortify/Fortify_SCA_and_Apps_18.10/bin/sourceanalyzer -b sample-php -scan -f sample-php.fpr
리눅스 PATH 추가하기
PATH=$PATH:/opt/Fortify/Fortify_SCA_and_Apps_18.10/bin
에러 처리.
** 독립적으로 실행될 수 있는 하나의 파일이어야함.
** c나 C++ 에 대해서는 컴파일러가 필요하다.-> 컴파일 해주기 (gcc 파일이름.c -o 파일이름.o)
** ./sourceanalyzer -b 1 gcc /hack/test.c-> 이건 안됨..
[error]: Translator execution failed. Please consult the Troubleshooting section of the User Manual.
Translator returned status 139:
** Fortify 가이드
'보안 공부 > 다양한 지식' 카테고리의 다른 글
Unix 시간 계산법, Year 2038 Problem (0) | 2019.10.28 |
---|---|
악성코드의 종류 (0) | 2019.10.25 |
JIRA Software (0) | 2019.10.18 |
QoS (Quality of Service) (0) | 2019.10.11 |
UTM 공부하기 (0) | 2019.10.09 |