You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
secureCodeBox scanner jobs should be accompanied with a health-check sidecar. This sidecar continuously verifies whether the endpoint is still available. If an endpoint becomes unavailable mid-scan, the scanner job should be either marked Errored or rescheduled at another time.
Is your feature request related to a problem?
Currently, if an endpoint becomes unavailable mid-scan, the scanner may not detect this and ends up returning 0 findings.
Describe the solution you'd like
The scan definition includes a lifenessProbe definition similar to those already available on Kubernetes Deployments.
As a pentester, I would like to at least verify HTTP status codes and response times on a target.
That is a interesting proposal.
What happens in the case that the remote target goes down during the scan is currently undefined / completly dictated by the behavior of the scan tool. My expectations of a good tool would be that they retry / backoff to a certain extend by themself and error when they can't do that in a reasonable timespan.
If a scan tool does not do that that would be a issue / improvement that should ideally be done in the tool itself. As we integrate a lot 3rd party tools we don't always have influence in these things so a workaround like the one proposed here might be necessary.
Though I'm not sure using the livenessProbe is a clean option to do it, as these are meant to test the containers themselfs not the remote endpoint (even thought it is technically possible to use them for it).
What I'm thinking about, might not be possible for every scanner, is to add an additional sidecar to the scanners which talks to the scanners api (e.g. ZAP) and monitors their progress (e.g. how many requests were performed in the last 5 min). These could be a simple python / js / bash script. If the progress has stalled, the sidecar could exit and the pod would be marked as failed and restarted by kubernetes (if allowed by the restart backoff limit).
Activity
EndPositive commentedon Oct 19, 2021
With further investigation, I propose that we reuse the built-in Kubernetes lifeness probes since they supposedly also work on remote targets.
We could define a health configuration on a scan:
Since a
lifenessProbeis attached to a single container, we could do one of the following:We should probably also make sure that the job is not restarted automatically by Kubernetes by adding:
Any thoughts from core team?
J12934 commentedon Oct 19, 2021
Hi 👋
That is a interesting proposal.
What happens in the case that the remote target goes down during the scan is currently undefined / completly dictated by the behavior of the scan tool. My expectations of a good tool would be that they retry / backoff to a certain extend by themself and error when they can't do that in a reasonable timespan.
If a scan tool does not do that that would be a issue / improvement that should ideally be done in the tool itself. As we integrate a lot 3rd party tools we don't always have influence in these things so a workaround like the one proposed here might be necessary.
Though I'm not sure using the livenessProbe is a clean option to do it, as these are meant to test the containers themselfs not the remote endpoint (even thought it is technically possible to use them for it).
What I'm thinking about, might not be possible for every scanner, is to add an additional sidecar to the scanners which talks to the scanners api (e.g. ZAP) and monitors their progress (e.g. how many requests were performed in the last 5 min). These could be a simple python / js / bash script. If the progress has stalled, the sidecar could exit and the pod would be marked as failed and restarted by kubernetes (if allowed by the restart backoff limit).