New in Veracode Fix: Additional Language Support and Batch Fix

We’re excited to bring you two significant updates to Veracode Fix: our AI-powered security flaw remediation tool. Since we launched Fix nearly a year ago, two requests have dominated our customer feedback:

  • Can we have it for <our language>?
  • Can you make it work for <our scenario>?

We recently launched a new version of Veracode Scan for VS Code that included Fix (with more IDE’s to follow), which answered some of those requests, and now we’re updating Fix to cover more languages and a new mode that will automatically apply the top-ranked fix.

Veracode Batch Fix

Using Fix in the Veracode CLI tool with the new –-apply flag, you will be able to apply the top fix suggestion to the source code in one of two modes:  

Apply Single Finding to a Single File

By supplying Veracode Fix with the results JSON file, the source code file to update, and the relevant issue ID (contained in the results file) you can apply the top-recommended fix to the source code file.

For example:

In this way, Veracode Fix can apply remediations directly to a source file without further intervention. Since the Issue IDs are stored in a machine-readable JSON file, it’s possible to script a sequence of scanning, applying, and rescanning until all flaws of a certain severity are addressed.

If that seems overly complex then the next mode of applying remediations is probably for you:

Resolving All Addressable CWEs in a Directory

This use case is a trade-off between what kind of activity is quicker and easier for a developer. When a source file or project has multiple security flaws, a developer can choose to work through them one-by-one and address any changes needed to make sure the code still builds and functions properly after each fix is applied, or take the approach to resolve all flaws in one step, then work on any issues that arise afterward. Which practice works best is probably as much to do with the developer’s experience, preference, and mindset as anything else.

To apply all possible remediations to files in a directory, use the following syntax:

For example:

To make useful commit messages, Veracode suggests you use a command like tee to pipe the output of the command into a text file (tee is available in most Linux distributions, MacOS, and PowerShell on Windows, or via the UnixUtils port of common GNU Utilities for Windows.

For example, this command pipes a copy of the output text from the command above into a file that can be used as a commit message:

New Language Support

We’re excited to announce three new supported languages, bringing the total number that Fix supports to eight, which covers a majority of the static analysis scans that Veracode performs.

Fix now supports the following languages and CWE

LanguageSupported CWE IDs
C#80, 89, 201, 209, 259, 352, 404, 601, 611, 798
Java73, 80, 89, 113, 117, 327, 331, 382, 470, 597, 601, 611
JavaScript and TypeScript73, 78, 80, 89, 113, 117, 327, 611, 614
PHP73, 78, 80, 89, 117
Python73, 78, 80, 89, 295, 327, 331, 757
KotlinNew!80, 89, 113, 117, 331
GoNew!73, 78, 117
ScalaNew!78, 80, 89, 117, 611

To get the latest version of Fix in the CLI, follow the installation instructions, or to take advantage of Fix in VS Code install the Veracode Scan Extension. If you’re not a Veracode customer yet or would like to try Veracode Fix, then contact us or arrange a demo.