Open helenlevich opened 4 years ago
Not sure if you found what you were looking for already but yes it can create the version if it does not exist. The account that is connecting just needs the permission Add Application Versions
.
Hi! I believe that the question is about more than just the version creation: create new project version as a copy of existing project version in SSC
. This is required to have the audit state copied from a version that has been already audited to the newly created one, to avoid the necessity to start everything from scratch.
I'm looking for this option too, but have not found it in any of the steps so far. Would appreciate if you could clarify this.
Thanks!
Hmm, right now there's no way to do it from the plugin, however... The audits are saved inside of your fpr file that you can download from SSC. If you manually download the fpr, you can use the fortifyUpload task that would upload it to the newly created version (this should only happen the first time app version is created), and that would carry all the audits over. The only difficulty is automating that fpr download (which can be done by the fortifyclient command line utility if you have SCA_and_Apps installed). I would probably need more information about your setup and your expectations step-by-step to help you develop the correct pipeline.
I would probably need more information about your setup and your expectations step-by-step to help you develop the correct pipeline.
Thanks for the reply! Here is what we would like to do with our multibranch projects in Jenkins:
fortifyUpload
functionality - this part is already working as long as we keep the version the same across the buildsIn general, the workflow that we envision would be similar to the one provided by Sonar plugin, where we only need to specify the branch / PR name, and the plugin would create the diffs and manage the results transparently (or not, depending on how transparency is defined) depending on what branch / PR name is specified.
Hi @UncleIS , @akaryakina , i am also looking to automate new version creation for existing fortify application, can you help me on this?
Hi, @gayathrisandra !
The plugin creates new versions, as long as the only thing that is required is to create it and upload scan results. In case you need a more intelligent approach, API can be used to code as complex logic as you need.
This is what we did actually:
It would be nice to have at least a part of it as a plugin functionality, though: being able to merge the results from one version to another would simplify things a lot!
Thank You @UncleIS, Can you please share the API to create new version by using existing application version if there is any inbuilt.
Hi, @gayathrisandra.
We POST /projectVersions
endpoint to create a project version.
Once the version is created, we PUT /projectVersions/{id}
to commit it (in Fortify SSC terms): once created, the project version is not usable right away.
After that, we POST /projectVersions/action/copyCurrentState
in order to copy the audit information from one version to another.
Our Fortify SSC installation provides a Swagger UI that can be used to investigate the capabilities and to select the right endpoints for your purpose, especially considering how much data you might need to provide to some of them. Have a look at your installation's API reference to find out about these and other endpoints (there are quite a lot).
Sometimes it was helpful to use browser web developer tools while clicking through the UI to capture the exact requests that the UI formed.
Hope this helps!
Best regards, Boris
@UncleIS Thanks Boris. Its really helpful.
From the documentation, it looks like fortify-plugin support SSC REST API. We are trying to automate version creation in SSC when we trigger job in Jenkins we want to create new project version as a copy of existing project version in SSC. Will fortify-plugin allow us to do that? Thank you