将Fortify集成到构建过程中

时间:2017-03-03 16:44:23

标签: teamcity fortify

我试图看看我是否可以将Fortify扫描集成到我的构建过程中。我做了一些研究,但似乎无法从Fortify的审计工作台中找到提取脚本。这是可能吗?我应该只建立一个批处理文件来完成这个吗?

3 个答案:

答案 0 :(得分:1)

构建自己的批处理文件将是最好的方法。

您可以从HPE Security Fortify Static Code Analyzer User Guide和命令行sourceanalyzer -h

的帮助文件中获取有关扫描项目的信息

这实际上是一个三步过程

  1. 清洁
  2. 翻译
  3. 扫描
  4. 帮助文件顶部有一些示例。

    如果您愿意,也可以使用“扫描向导”工具,但我个人不喜欢长期使用它进行构建集成。它创建了一个复杂的批处理文件,它专门指定文件(因此,如果新文件随着时间的推移而增加,它将无法获取它们。)

    如果您想了解Audit workbench如何执行扫描,您可以添加以下命令选项: “-verbose” “-debug” “-logfile” “c:\ temp \ translate.log”或“c:\ temp \ scan.log”

    Screenshot of Audit Workbench with the above commands inserted into the translation and scan portions

    然后你可以查看“Args:”这一行的日志文件。这将包含一个参数列表(用引号括起来,用逗号分隔)是什么命令行参数传递给sourceanalyzer.exe。

    使用此信息,您可以创建一个批处理文件来运行并执行扫描。 (确保批处理文件包含我之前提到的所有三个步骤。)

    GUI只是sourceanalyzer.exe的前端

答案 1 :(得分:1)

Yes, use a batch script to do this.

Instead of trying to copy the commands from Audit Workbench, use the Scan Wizard. It's the tool specifically for solving this problem. You point it at your project, answer some questions, and it creates a script. Check a box and it'll also upload to SSC.

Scan Wizard is located in /bin. It may also be in your Start menu, next to Audit Workbench.

Note: Sometimes I have to modify the script. But if you're able to scan using the Fortify button in Visual Studio, then the default script usually works.

答案 2 :(得分:0)

您可以使用HP SCA的maven插件。它将作为HP SCA安装的一部分捆绑在一起(在plugins文件夹下),并且需要安装在Maven中。请注意,SCA插件未列为maven存储库,因此需要安装到本地存储库中。