
maria.paula.cheska.tolentino (Community Member) asked a question.
We are using TeamCity plugin version 2.0, if we upload the files in a zip format, it returns Pass even if there were flaws logged. On the other hand, if we upload files individually, it does not scan JS and config files as it returns the message: "The file cannot be analyzed". However, it recognizes the flaws and fails the build.
Having said that, are there any workarounds we can do to retrieve the correct status when files are uploaded in zip format? We need this in order to trigger the notification for developers to look into the flaws. Thank you.
.png)
Hello Maria Paula,
The notification you need to send to developers, are they related to flaws found by the scan or the failure to upload the files, "The file cannot be analyzed"? Flaws found by a scan are not the same thing as “file cannot be analyzed” error.
When you upload your files for scanning, before the scan starts, the files must pass validation. If the file is not packaged/compiled according to the compilation guide or it contains languages or frameworks that are not supported it will fail the prescan check. When the files fail prescan you will get the file cannot be analyzed message.
Compilation guide: https://help.veracode.com/reader/4EKhlLSMHm5jC8P8j3XccQ/AM8PAkQKwsHbNYXy2VeX5Q
If the prescan is successful the files are submitted for scanning. If the scan finds issues in your application it will show those issues in the flaws report.
According to our compilation guide, .js files cannot upload by themselves, if they are the prescan check will fail, you will get the file cannot be analyzed message and the build will.
However, when you upload your .js project as .zip file, this will not cause the build to break because that is what the scanner expects.
You may leverage the getprescanresults.do API to check the status of a prescan and configured your notification based on the response from this call.
https://help.veracode.com/r/r_getprescanresults
I hope that helps.
Regards,
Rafael