How to Run Veracode SAST Scan in Local Environment
Running a Veracode SAST scan locally: Step-by-Step guide.
Start typing to search...
Running a Veracode SAST scan locally: Step-by-Step guide.
Static Application Security Testing (SAST) plays a vital role in detecting vulnerabilities within your application's source code, helping to ensure security compliance and address risks early in the development process. Veracode SAST offers an automated solution for analyzing source code, binaries, and dependencies to identify potential security flaws. By integrating Veracode SAST into your local environment, you can proactively secure your applications and ensure compliance with security best practices before deployment.
Follow the steps to do a Veracode SAST scan in the local environment
Invoke-WebRequest -Uri "https://downloads.veracode.com/securityscan/pipeline-scan-LATEST.zip" -OutFile "pipeline-scan.zip"
Compress-Archive -Path "your-project-path/*" -DestinationPath "your-project.zip" -Force
java -jar veracode/pipeline-scan.jar `
-f your-project.zip `
-vid "your_api_key_id" `
-vkey "your_api_secret_key" `
-p "Your-Project" `
-fs "High,Very High,Medium,Low"

To perform additional operations, such as retrieving the build list or deleting builds, you can use the Java API wrapper. The list of actions it can perform is listed in https://docs.veracode.com/r/c_wrapper_simple_actions
You can download the Java API wrapper from https://docs.veracode.com/r/t_working_with_java_wrapper
Unzip the file and place the VeracodeJavaAPI in the veracode folder created above
Run the following command to get information like the build list
java -jar veracode/VeracodeJavaAPI.jar
-action getbuildlist
-appid "your-app-id"
-vid "your_api_key_id"
-vkey "your_api_secret_key"
In conclusion, running a Veracode SAST scan locally provides valuable insights into potential security vulnerabilities within your codebase. By analyzing the results, prioritizing critical issues, and implementing necessary fixes, developers can enhance the security and robustness of their applications before deployment. Regular local scans help maintain code quality, reduce security risks, and ensure compliance with industry best practices.