静态代码分析工具汇总

来源:互联网 发布:淘宝怎么选购液晶电视 编辑:程序博客网 时间:2024/06/07 00:37

静态代码扫描,借用一段网上的原文解释一下(这里叫静态检查):“静态测试包括代码检查、静态结构分析、代码质量度量等。它可以由人工进行,充分发挥人的逻辑思维优势,也可以借助软件工具自动进行。代码检查代码检查包括代码走查、桌面检查、代码审查等,主要检查代码和设计的一致性,代码对标准的遵循、可读性,代码的逻辑表达的正确性,代码结构的合理性等方面;可以发现违背程序编写标准的问题,程序中不安全、不明确和模糊的部分,找出程序中不可移植部分、违背程序编程风格的问题,包括变量检查、命名和类型审查、程序逻辑审查、程序语法检查和程序结构检查等内容。”。

我看了一系列的静态代码扫描或者叫静态代码分析工具后,总结对工具的看法:静态代码扫描工具,和编译器的某些功能其实是很相似的,他们也需要词法分析,语法分析,语意分析...但和编译器不一样的是他们可以自定义各种各样的复杂的规则去对代码进行分析。

以下将会列出的静态代码扫描工具,会由于实现方法,算法,分析的层次不同,功能上会差异很大。有的可以做SQL注入的检查,有的则不能(当然,由于时间问题还没有对规则进行研究,但要检查复杂的代码安全漏洞,是需要更高深分析算法的,所以有的东西应该不是设置规则库就可以检查到的,但在安全方面的检查,一定程度上也是可以通过设置规则进行检查的)

.NET

  • .NET Compiler Platform(代号罗斯林) -开源编译器框架,C#Visual Basic .NET中开发的微软 .NET。提供用于分析和操作语法的API。
  • CodeIt.Right  -结合静态代码分析和自动重构最佳实践,它允许代码中的错误和违规行为自动修正; 支持C#和VB.NET。
  • 的CodeRush  -一个插件的Visual Studio它提醒用户侵犯最佳做法。
  • 的FxCop  -免费静态分析微软.NET程序编译为CIL。独立和集成在一些微软的Visual Studio版本; 微软。
  • NDepend的  -简化了管理,通过分析和可视化代码的依赖关系,通过定义设计规则,这样做影响分析复杂的.NET代码库,并通过比较不同版本的代码。集成到Visual Studio中。
  • Parasoft dotTEST -静态分析,单元测试和代码审查的插件为Visual Studio的 ; 适用于语言的Microsoft .NET Framework和.NET Compact Framework,包括C#,VB.NET,ASP.NET和托管C ++。
  • 了StyleCop  -分析C#源代码来执行一组风格和一致性规则。它可以从内部运行的Microsoft Visual Studio中或整合到MSBuild的项目。

Ç,C ++ 

  • Astrée  -查找所有可能的运行时错误由抽象解释,可以证明不存在运行时错误,并能证明功能的断言; 针对对安全至关重要的C代码(例如航空电子设备)。
  • BLAST  - (伯克利懒惰抽象软件验证工具) -对C程序的基础上慵懒抽象的开源软件模型检测(后续项目CPAchecker。[5])。
  • Cppcheck  -开源的工具来检查几种类型的错误,包括使用STL。
  • cpplint  -一个开源的工具,它检查是否符合谷歌的风格指南对C ++编码。
  • Clang   -一个开放源代码编译器,它包括一个静态分析器它包括一个静态分析器
  • Coccinelle的  -一个开源的源代码模式匹配和改造。
  • Cppdepend  -简化了管理,通过分析和可视化代码的依赖关系,通过定义设计规则,这样做影响分析,并比较不同版本的代码的复杂的C / C ++代码库。
  • ECLAIR  -对于自动分析,验证,C和C ++程序的测试和转化的平台。
  • Eclipse(软件)  -一种开放源码的IDE,包括静态代码分析仪(CODAN)。
  • Fluctuat  - 抽象解释的程序数值属性的验证。
  • Frama-C  -一个开源的静态分析框架C.
  • Goanna  -软件分析工具,用于C / C ++。
  • Klocwork的静态代码分析  -静态分析工具,用于C / C ++。
  • Lint -原来的静态代码分析仪C.
  • LDRA Testbed  -软件分析与测试工具套件的C / C ++。
  • Parasoft C / C ++test  - C / C ++工具,它的静态分析,单元测试,代码审查,并且运行时错误检测; 可用于插件的Visual Studio和Eclipse的基础的集成开发环境。
  • PC-Lint -软件分析工具,用于C / C ++。
  • Polyspace  -使用抽象解释检测和证明不存在的运行时间错误,在死代码的源代码以及用于检查所有MISRA(2004,2012),规则(指令,非指令)。
  • PVS-Studio  -软件分析工具,用于C,C ++,C ++ 11,C ++ / CX(组件扩展)。
  • PRQA QA·C与QA·C ++  -的C / C ++质量保证和方针/编码标准执法与MISRA支持深度静态分析。
  • SLAM project  -一期工程微软研究院检查它使用的接口软件满足的关键行为属性。
  • Sparse  -一个开源工具,旨在发现故障的Linux内核。
  • Splint  -一个开源的进化版皮棉,为C.
  • ...

Java

  • Checkstyle  -除了一些静态代码分析,它可以用来显示侵犯一个配置编码标准。
  • FindBugs  -一个开源的静态分析字节码的Java(基于雅加达 BCEL马里兰大学)。
  • IntelliJ IDEA -跨平台的Java IDE,具有自己的一套几百代码检查可在即时在整个项目的编辑和批量分析分析代码。
  • JArchitect  -简化了分析和可视化代码的依赖关系,通过定义设计规则,这样做影响分析,并通过比较不同版本的代码管理复杂的Java代码库。
  • Jtest  -测试和静态代码分析产品通过Parasoft的。
  • LDRA Testbed   -软件分析与测试工具套件的Java。
  • PMD  -静态规则集基于Java源代码分析器,能够识别潜在问题。
  • SemmleCode  -面向对象的代码查询静态程序分析。
  •  Sonargraph(原SonarJ) -代码为目的的架构显示器的一致性,也计算了广泛的软件度量。
  • Soot  -一个语言处理和优化框架由中间语言的Java。
  • Squale  -管理软件质量的平台(也可用于其他语言,使用商业分析工具虽然)。
  • SonarQube  -对代码质量的持续检查的开源平台。
  • SourceQube  -一个独立于平台的命令行静态源代码分析器用于Java,C / C ++,RPG IV(AS / 400)和Python。
  • ThreadSafe  -一个静态分析工具,用于Java的重点是寻找并发错误。
  • ...

JavaScript

  • Google's Closure Compiler  -的JavaScript优化器重写代码,以更快,更小,并检查使用本地JavaScript功能。
  • JSLint -的JavaScript 语法检查和验证。
  • JSHint  - JSLint的的社区驱动的叉。

Objective-C, Objective-C++

  • Clang -免费锵项目包括静态分析。作为版本3.2,该分析仪包括在Xcode中 。[6]

Perl

  • Perl::Critic   -一个工具来帮助实施通用Perl的最佳实践。大多数的最佳做法是基于达米安康威的Perl的最佳实践的书。
  • PerlTidy  -程序作为一个语法检查和测试仪/实施者在Perl的编码实践。
  • Padre- Perl的一个IDE,它也提供了静态代码分析检查常见的初学者的错误。

Python的编辑]

  • pylint -静态代码分析。很严格的; 包括许多文体警告也是如此。
  • PyCharm  -跨平台的Python IDE,具有代码检查可在即时在整个项目的编辑和批量分析分析代码。

  以下我在网上搜集到的分析工具,我整理了以下挑了一些出来,这里只是一部分,另外一些可以到参考链接上看一下:

工具名静态扫描语言开源/付费厂商介绍主页网址ounec5.0VB.Net、C、C++和C#,
还支持Java。付  费Ounce Labs\http://www.ouncelabs.com/Coverity PreventC/C++,C#,JAVA付费Coverity还有其他辅助工具:
1.Coverity Thread Analyzer for Java
2.Coverity Software Readiness Manager for Java
3.Coverity Architecture Analyzerhttp://www.coverity.com/index.html@stake SmartRisk™ 
AnalyzerC/C++,Java付费Symantec 
Corporation@stake SmartRisk™ Analyzer harnesses the power of 
static analysis of binary executables (C, C++, and Java) to 
identify, categorize and prioritize security。
注:在Symantec没有搜到此产品?!http://www.symantec.com/business/index.jspRational PurifyC/C++,Java付费IBMProvides memory leak and memory corruption detection for 
Windows,Runtime?!http://www-01.ibm.com/software/awdtools/purify/PREfix\\microsoft微软用的静态分析工具,但暂时没有找到下载,
现在好像在考虑发布中!\JtextJava付费parasoft同时还有其他静态分析代码的产品,如:C++Test...
详细请查询官网http://www.parasoft.com/jsp/cn/support.jspflawfinderC/C++开源\用Python编写的c、c++程序安全审核工具,
可以检查潜在的安全风险。http://www.dwheeler.com/flawfinder/Static Code 
AnalyzerC/C++,C#,JAVA付费Fortify\http://www.fortify.com/Klocwork InsightC/C++ ,Java付费Klocwork\http://www.klocwork.com/products/insight.aspPolySpace
Client/ServerC/C++、Ada语言付费MathWorks\http://www.mathworks.cn/ratsC/C++, Python,
Perl, 
PHP代码进行安全审核的工具开源\\http://www.fortify.com/security-resources/rats.jspLAPSEJava开源\LAPSE stands for a Lightweight Analysis for Program 
Security in Eclipse. LAPSE is designed to help with 
the task of auditing Java J2EE applications for common 
types of security vulnerabilities found in Web applications.
LAPSE was developed by Benjamin Livshits as part of the 
Griffin Software Security Project.http://www.owasp.org/index.php/Category:OWASP_LAPSE_ProjectFluidjava开源\We have explored properties including:

    * race conditions and locking policies,
    * unique references and other programmer-significant
aliasing properties,
    * effects,
    * appropriate typing,
    * realtime threading policies, and
    * single-threading policies.http://www.fluid.cs.cmu.edu:8080/FluidSplintC开源University of 
Virginia,
Department of 
Computer
Science静态检测针对C语言的安全工具和漏洞检测。http://www.splint.org/cqualC/C++开源马里兰大学轻量级的静态扫描器,在类Linux系统下运行。http://www.cs.umd.edu/~jfoster/cqual/MOPSC开源berkeley大学MOPS is a tool for finding security bugs in C programs 
and for verifying conformance to rules of defensive programminghttp://www.cs.berkeley.edu/~daw/mops/BOONC开源berkeley大学BOON is a tool for automatically finding buffer overrun 
vulnerabilities in C source code. Buffer overruns are one
of the most common types of security holes, and we hope 
that BOON will enable software developers and code auditors
to improve the quality of security-critical programs.http://www.cs.berkeley.edu/~daw/boon/BLASTC开源The BLAST 
2.0 TeamBLAST is a software model checker for C programs.  
The goal of BLAST is to be able to check that software
satisfies behavioral properties of the interfaces it uses.
BLAST uses counterexample-driven automatic abstraction
refinement to construct an abstract model which is model
checked for safety properties. The abstraction is constructed
on-the-fly, and only to the required precision.http://mtc.epfl.ch/software-tools/blast/SpikeWAMPPhp开源\for analyzing PHP programshttp://developer.spikesource.com/wiki/index.php/SpikeWAMPPixyPhp开源\Finding XSS and SQLI vulnerabilitieshttp://pixybox.seclab.tuwien.ac.at/pixy/MikeJava开源\Java source code security scanner built on top of Orizon.
They are connected to OWASP.http://milk.sourceforge.net/download.htmlSmatchC开源\\http://smatch.sourceforge.net/OinkC++开源\C++ Static Analysis Toolshttp://www.cubewano.org/oinkFrama-CC开源\static analyzers for the C language.http://frama-c.cea.fr/RTL-check\开源\RTL-check is an extensible and powerful abstract interpretation
framework for static analysis of programs from a safety and
security perspectivehttp://rtlcheck.sourceforge.net/PMDJava开源\PMD scans Java source code and looks for potential problems like:

    * Possible bugs - empty try/catch/finally/
switch statements
    * Dead code - unused local variables, parameters
and private methods
    * Suboptimal code - wasteful String/StringBuffer usage
    * Overcomplicated expressions - unnecessary if statements,
for loops that could be while loops
    * Duplicate code - copied/pasted code means copied/pasted bugshttp://pmd.sourceforge.net/FindBugsJava开源马里兰大学uses static analysis to look for bugs in Java code.
注意:提供Eclipse插件。http://findbugs.sourceforge.net/ITS4C\C++开源\Cigital developed ITS4 to help automate source code
review for security.http://www.cigital.com/its4/QJ-ProJava开源\QJ-Pro is a comprehensive software inspection tool targeted 
towards the software developer.

QJ-Pro checks:
    * conformance to coding standards,
    * misuse of the Java language,
    * best practice conformence
    * code structure and
    * potential bugs at the earliest stages of development.
注意:提供各种IDE插件!http://qjpro.sourceforge.net/JintJava开源\Jlint will check your Java code and find bugs, inconsistencies
and synchronization problems by doing data flow analysis and
building the lock graph.http://artho.com/jlint/HammurapiJava开源\code review system captures coding best practices and delivers
them to developers' fingertips. It also generates consolidated
reports for lead developers, architects, and managers to
monitor codebase quality and evolution.http://www.hammurapi.biz/hammurapi-biz/ef/xmenu/hammurapi-group/index.htmlDoctorJJava开源\Among what it detects:

    * misspelled words
    * parameter and exception names:
          o missing
          o misordered
          o misspelled
    * Javadoc tags:
          o invalid
          o misordered
          o missing expected arguments
          o invalid arguments
          o missing descriptions
    * undocumented classes, methods, fields, 
parametershttp://www.incava.org/projects/java/doctorj/index.htmlDependency FinderJava开源\Dependency Finder is a suite of tools for analyzing
compiled Java code. At the core is a powerful dependency
analysis application that extracts dependency graphs and
mines them for useful information. This application comes
in many forms for your ease of use, including command-line 
tools, a Swing-based application, a web application ready
to be deployed in an application server, and a set of Ant
tasks.http://depfind.sourceforge.net/CheckstyleJava开源\Checkstyle is a development tool to help programmers
write Java code that adheres to a coding standard.
It automates the process of checking Java code to spare
humans of this boring (but important) task. This makes
it ideal for projects that want to enforce a coding standard. 
注意:提供多种IDE的插件。http://checkstyle.sourceforge.net/ClassycleJava开源\Classycle's Analyser analyses the static class and package
dependencies in Java applications or libraries.http://classycle.sourceforge.net/JDependJava开源\JDepend traverses Java class file directories and generates
design quality metrics for each Java package. 
JDepend allows you to automatically measure the quality
of a design in terms of its extensibility, reusability,
and maintainability to manage package dependencies effectively.http://www.clarkware.com/software/JDepend.htmlJCSCJava开源\JCSC is a powerful tool to check source code against a highly
definable coding standard and potential bad code.http://jcsc.sourceforge.net/

......

以下是直接提供代码检查/相关帮助的厂商:

Fortify:  

http://www.fortify.com/

ASPECT: 

http://www.aspectsecurity.com/

OWASP:   

http://www.owasp.org/index.php/Main_Page

securitycompass:

http://www.securitycompass.com/resources.shtml


参考资料:

1. http://www.dwheeler.com/flawfinder/
2. http://www.java2s.com/Product/Java/Byte-Source-Code/Source-Analysis-Diagram.htm
3. http://www.softwarelist.cn/?fsid=53&cid=530&cpath=ABAN
4. http://www.hacker.com.cn/article/view_14804.html
5. http://www.cs.cmu.edu/~aldrich/courses/654/tools/

注:以上链接列举了大量相关工具



Source URL: http://www.pin5i.com/showtopic-22624.html

0 0