Integrating CAT.NET into Hudson for Continuous Security Analysis

This tutorial shows how to integrate CAT.NET static security scanning into Hudson by chaining a downstream analysis job from the main build. It covers workspace reuse, command-line scanner execution, and report artifact archiving for continuous visibility.

Coveros Staff

December 5, 2012

I recently published an article about . Once you get it running, it’s fairly simple to integrate it into your continuous integration process.

Our strategy here will be to use a down-stream job in Hudson to run static security analysis on our application build after the main compilation/packaging job completes. For this, we will use a “build other projects” post-build trigger, then set up a scanning job that uses a uses a custom workspace pointing to the original build location.

  1. First, install the 64-bit command-line version of CAT.NET from my original post (see above). In my case, I installed it in C:\SecureCI\CAT.NET64.
  2. Next, set up your job:
  3. Create a free-form job called “App-Analyze”
  4. Use the Advanced project options button to display additional project configuration options
  5. Use the “Use Custom Workspace” check box to enter the workspace of the ORIGINAL build project that was built.
  6. Enter a new Build step for “Execute Windows batch command”
      •  

:: Run CAT.NET on MyApp CD %WORKSPACE%\trunk set PATH=C:\SecureCI\CAT.NET64;%PATH% set DLL=MyApp\obj\Debug\MyApp.dll CatNetCmd64.exe /file:MyApp\obj\Debug\MyApp.dll /verbose:Debug /report:MyApp.AnalysisReport.xml /reportxsloutput:MyApp.Report.html

      •  
  1. Use the “Archive the artifacts” plug-in to capture the following patterns: “**/*.Report.html, **/*.AnalysisReport.xml”
  2. Save your job

That’s it. Run your job. It should scan the DLL you listed and capture a Report.html and AnalysisReport.xml file. The HTML report shows a browser-compatible version of your results that you can easily browse from the Hudson UI. The XML file is useful if you want to use the CAT.NET 32-bit GUI to inspect the results in Visual Studio.

Coveros Staff

Coveros Staff

This post represents the collective insights of the Coveros team. Our staff consists of software experts who bring deep experience in secure agile development, DevOps, testing, and software quality. Over the past 20 years, Coveros has trained more than 30,000 professionals and worked with half of the Fortune 100 companies on mission-critical software development challenges. We draw on this extensive experience to share practical insights, proven strategies, and real-world solutions that help organizations build better software faster and more securely.