linux中klocwork步骤,linux环境下的klockwork、fortify、c++ test比较

前一段时间,因为一些需要,分别在linux环境下试用了klockwork、foritfy、c++ test等可以静态走查软件代码的工具,现从各方面说一下个人使用的一些感受。

1)安装方面

三个软件安装都比较简单,基本上都是几个步骤完在安装。

2)操作方面

三个软件的操作都很简单,但是相对来说,个人感觉fortify会繁琐一些,每分析一个项目都要设置所使用的内存,否则可能因为内存不足导致分析过程超慢。

3)兼容性方面

klockwork最好,不管是automake还是cmake,直接支持,不需要额外操作;foritfy次之,如果是使用cmake,需要手工设置CXX环境变量;c++ test针对cmake需要进行多步操作,最是繁琐。当然,三者都不需要修改代码。

4)性能方面

klockwork最快,c++ test次之,foritfy最慢。基于10万左右的代码量,内存为1G的CentOS 5.5虚拟机中,完成代码的静态走查并生成报告,klockwork需要半个小时左右,c++ test需要1个小时左中,fortify在内存为2G的情况下,也需要1个小时左右。

5)误报率方面

klockwork最低,大约5%左右;fortify大约20%;c++ test不知道是因为基于不同的分析规则还是其它什么原因,误报率比较高,具体就不说了。

6)问题数量方面

klockwork最少,fortify与c++ test都很多,fortify与c++ test生成的问题数量基本上会是klockwork的好几倍,而且经常有超出10倍的情况。

7)功能方面

klockwork侧重于代码质量,兼少许代码安全;fortify功能klockwork是相反的,侧重于代码安全,兼代码质量;c++ test个人感觉更侧重于自动化测试,其代码质量与代码安全的分析只是辅助功能。

8)支持环境方面

常见的Windows、linux、ppc等环境基本上都支持,常用的vs、eclipse等IDE环境也没问题。

当然,以上的一些见解仅限于个人一小段时间内基于linux平台的使用感受,而且是基于最基本使用的结果。

fortify扫描工具的说明手册,对实际工作有指导作用,讲的比较清晰。 Fortify SCA分析原理 Front-End 3rd party IDE Java Pug-In C/C++ MicrOsoL NET IBM.eclipse Audit workbench PLSQL XML Analysis Engine Semantic fdi/ fpr Gobal Data flow N Control Flow Configuration Structural Fortify Manager NST Rules builder Custom Pre-Packaged FORTIFY Fortify SCA分析过程 SCA Engine Intermediate Scan phase fles Using Analyzers Tt transation (NST) .Rules Analysis Result File -b build id 阶段一:转换阶段( Translation) 阶段二:分析阶段(Scan o sourceanalyzer-b <build-id>-clean o sourceanalyzer -b <build-id> sourceanalyzer-b <build-id> -Xmx1250m-scan-f results fpr FORTIFY Fortify SCA扫描的工作 Visual studio Eclipse, IBM RAD 面 Audit Workbench Java,. Net Fortify Global Build Tool C, C/C++ Analysis JSP Touchless Build Fortify PL/SQL IDE Intermediate FPR TSOL Model Cold Command Line Interface Fusion 运己 Fortify I m Manager Secure Coding Rules Fortify Customized Rules Rules FORTIFY Fortify SCA扫描的五种方式 插件方式: Plug-In(Eclipse, vs WsAd,rad) 命令行方式 Command line ●扫描目录方式: Audit workbench scan Folder 与其他工具集成: Scan with ANt, Makefile ●编译监控器方式: Fortify SCA Build Monitor FORTIFY Fortify SCA扫描的四个步骤 Fortify SCA扫描总共可以分为四个步骤: ●1. Clean:清除阶段: sourceanalyzer -b proName -clean 2. Translation:转换阶段 3.ShoW-fe:查看阶段 sourceanalyzer -b proName -show-files 4.scan:扫描阶段 sourceanalyzer-b proName -Xmx1250m -scan -f proName. fpr FORTIFY Fortify SCA命令行参数说明 查看SCA扫描命令及参数→> sourceanalyzer ca\ C:\VIRDoS\syste32\cd. exe 川 icrosoft Windows XP[版不5.1268g Kc版权所有1985-2 061 Microsoft Gorp :Documents and settings anming >sourceanalyzer --he lp Fortify Source Code Analyze4..日.回153 Copyright (c>2003-2006 Fortify Software Usage Bu⊥1d Java: sourceanalyzer -b <buildid> <files> sourceanalyzer -b <buildid> javac <compiler opts> <files> G/C++: sourceanalyzer -b <buildid> <compiler> <compiler opts> <files> NET: sourceanalyzer -b <buildin> <exe file> scan〓 sourceanalyzer -b <buildid> -scan -f results. fpr Output opt ions -format <fmt> Controls the output format. Valid options are auto, fpr. fvdl, and text. Default is auto for which type will be determined automatically based on file extension 一£<fi1e> The file to which results are written Default is stdout build-pro ject <name> The name of the project being scanned. Will be inc luded in the output bu⊥1d-1abe1<labe1> The1abe1 of the project being scanned.W主工1 be inc luded in the output build-version <version> The version of the project being scanned. wil1RTIFY. e uale OFTWARE Fortify SCA转换源代码 转换Java代码 Java程序命令行语法 JaVa命令行语法例子 转换J2EE应用程序 使用 Find bugs 转换NET源代码 o. NET Versions 1.1 and 2.0 Visual studio. net version 2003 o Visual studio.net version 2005 转换CC++代码 ●转换 PL/SQLITSQL FORTIFY SCA转换JAVA源代码命令 sourceanalyzer -b <build-id> -cp <classpath> <file-list> ●附注参数:-Xmx;- encoding-jdk;- appserver- appserver- veron -appserver-home Table 1: File specifiers File specifier Description darna盈e All files found under the named directory or any subdirectories dx己盈e/古古 Any file named Example. java found under the named Example java directory or any subdirectories dx22盈e/,ava Any file with the extension. j ava found in the named directory dxna盈e吉/古,java Any file wth the extension j ava found under the named directory or any subdirectories d工22a盈e/方/吉 All files found under the named directory or ary subdirectories (same as dirname FORTIFY
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值