
Product Announcements — Tim J (Veracode PM) (Veracode) asked a question.
Hi folks! I wanted to highlight some work we’re doing that is intended to address a common pain point with static scanning, which we have been calling the “stuck scan problem.” This post will talk about what we’re working on, how you can take advantage of it today, and what’s coming next.
What are we announcing?
A new feature has been added to the uploadandscan action on the Java API Wrapper that automatically deletes the current scan under certain failure conditions.
Why this feature?
A “stuck scan” is a static scan that is started but not completed. It can happen for various reasons, including misconfiguration of the scan, upload of unscannable code, a scan that runs for longer than expected, or other issues. Stuck scans are a problem in a pipeline or other automated context because any given application or sandbox is only allowed one scan in an incomplete state at a time, so the “stuck scan” prevents a new scan from starting.
In many cases a “stuck scan” is a signal that the scan configuration should be reviewed—if a misconfiguration or unscannable code is the root cause, the scan will fail the next time it’s attempted unless the problem is fixed.
However, if a scan fails because of a one-time issue, removing the scan and trying again is absolutely the right thing to do. Today this has to be done manually by logging into the platform, finding the application and/or sandbox, and deleting the scan.
This last case has now been automated in the Veracode Java API Wrapper. If you use the Java API Wrapper uploadandscan action, you can now specify the --deleteIncompleteScan option. With this option specified, any incomplete scan that’s present for the specified application or sandbox will be deleted automatically when a new scan starts, removing the requirement for manual intervention.
This option is available for you in your pipeline if you call the Java API Wrapper directly. For example, if using the API Wrapper in Veracode’s Docker image, your task might look like this:
- java -jar veracodeJavaAPI.jar -vid $VERACODE_VID -vkey $VERACODE_VKEY
-action UploadAndScan -appname "Build System Demo Application" -createprofile false -autoscan true
-filepath target/verademo.war -version $BUILD_NUMBER -sandboxname ReleaseCandidate -createSandbox true
-deleteIncompleteScan true
We will update the Veracode Jenkins, Azure DevOps, and TeamCity integrations to support this option in the coming months as well.
Please leave a comment if you have any questions!
.png)
"uploadandscan" doesn't let you select the entry points that you would like to select, rather than proceed with the entry points that Veracode selects after pre-scan stage. We use uploadfile.do and BeginScan.do - where we have the flexibility to select the entry points through code in the BeginScan.do API. Will the feature be available for those who don't use "uploadandscan" and use "uploadfile.do" & "BeginScan.do"? The other API, "deletebuild.do", can also delete the latest build - only difference being "deletebuild.do" wont know if the latest build is an incomplete build. The new feature is an useful addition. Thanks.
VeracodeJavaAPI v21.5.7.7 c11.0.9
Parsing error(s):
-deleteIncompleteScan is not a valid parameter.
Are you sure this has been added to the latest VeracodeJavaAPI wrapper?
Looks like it's case sensitive... -deleteincompletescan works fine. Please update your documentation or fix the code in the jar file to allow camel case.
@PMalone884391 (Community Member)​ thank you for the above post, we will be updating the documentation accordingly.