mercedes-benz / sechub

SecHub provides a central API to test software with different security tools.
https://mercedes-benz.github.io/sechub/
MIT License
259 stars 61 forks source link

Resilience for terminated JVM but ongoing scans #142

Closed de-jcup closed 4 years ago

de-jcup commented 4 years ago

Defintions

Usecases

Restart zombie job

As an administrator I want to be able to restart a job supposed to be a "Zombie". Existing product results shall be re-fetched and job result updated as fast as possible.

Restart (hard) zombie job

As an administrator I want to be able to restart a job supposed to be a "Zombie" in a hard way, means complete job process is restarted. Existing former product results will be dropped.

Situation details

Solution

Adapter resilience via meta data

Access

Restart and Restart (hard) will be done as usual by REST calls. Can only be done by SUPER_ADMINrole

Audit

Every restart will show admin ID in autdit log. Also a notification to admins about the restart will be send on success of restart

Integration testing

Formerly mocked adapters did not really do things. But wit introduction of meta data every mocked adaper should at least read/write some dummy data - to simulate the persistence as well. Maybe even a mocked adapter should write same meta data identifier/data as origin one.

What happens when having started a restart accidently to a finished job ?

When a job has been finished, we do not provide any restart! It will give back an HTTP error and (maybe) a notification mail.

What happens when having race condition ?

E.g. A job is not really a zombie, but restart was triggered.

Solution: We try to stop the other running process - but if this would not work we don't bother. Just let the second scan job write again to DB - reason: Result is same, so it doesn't matter, only end time will be changed.

de-jcup commented 4 years ago

We must add a new column to store the product scan id.

de-jcup commented 4 years ago

Started new feature branch - because there were too much changes inside currently not necessary (and producing to much noise...)

de-jcup commented 4 years ago

Still todo:

de-jcup commented 4 years ago

Merged by https://github.com/Daimler/sechub/pull/221 so can close