Fortify SCA C#.NET 扫描方法(Visual Studio插件)

本文档介绍了如何准备环境,包括安装Visual Studio和Fortify SCA插件,以及如何利用Visual Studio对C#.NET项目进行编译、转换分析和扫描,以确保代码安全。
摘要由CSDN通过智能技术生成

环境准备

安装VisualStudio

这里写图片描述

安装Fortify SCA,并根据版本选择安装插件

这里写图片描述

扫描代码方法

通过VisualStudio对待扫描项目解决方案进行编译和转换分析
sourceanalyzer -b sec_scan -64 -Xmx2048M -Xms2048M -Xss24M "D:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe" project.sln

注:根据实际情况配置devenv.exe程序路径
VisualStudio加载解决方案后,使用“Fortify插件”完成编译和转换分析:

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
Fortify SCA(应用安全代码审查)是一种静态代码分析工具,用于检测软件中的安全漏洞和潜在的代码缺陷。以下是对Fortify SCA常见问题的回答: 1. 为什么要使用Fortify SCAFortify SCA能够在开发过程中自动扫描和标识软件中的安全漏洞,帮助开发团队及时修复风险,保护软件免受攻击。它提供了一种可靠的方式来提高代码质量和安全性。 2. Fortify SCA能够检测哪些安全漏洞? Fortify SCA可以检测各种安全漏洞,包括但不限于SQL注入、跨站脚本攻击(XSS)、代码注入、安全配置错误、缓冲区溢出等。它基于大量经验和规则库,能够准确地识别潜在的漏洞和弱点。 3. 如何使用Fortify SCA? 开发人员可以通过将Fortify SCA集成到他们的集成开发环境中,或者通过命令行方式执行扫描来使用该工具。Fortify SCA将会扫描源代码文件,查找潜在的安全问题,并生成详细的报告。 4. 如何解释Fortify SCA生成的扫描报告? Fortify SCA生成的扫描报告将列出所有发现的安全漏洞和问题,以及对应的代码位置和风险级别。开发人员应仔细阅读并理解报告中的问题描述和建议,以便及时修复漏洞和加强代码的安全性。 5. 如何解决Fortify SCA报告中的问题? 开发团队应根据Fortify SCA报告中的建议,对代码中的漏洞和问题进行修复。修复包括但不限于改正代码逻辑、过滤输入、验证用户输入、遵循安全最佳实践等。 总之,Fortify SCA是一款强大的静态代码分析工具,可以帮助开发人员发现和修复安全漏洞和潜在的代码缺陷。通过集成Fortify SCA到开发流程中,可以提高代码的安全性和质量。
评论 19
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值