secureCodeBox / secureCodeBox

secureCodeBox (SCB) - continuous secure delivery out of the box
https://www.secureCodeBox.io
Other
762 stars 148 forks source link

Add a optional ttlSecondsAfterFinished field to scans to cleanup finished scans #2293

Closed danil-smirnov closed 1 week ago

danil-smirnov commented 6 months ago

Your Question

Hi, if we run scheduled and on-demand scans, they appear as CRDs in the cluster. Is there any automated way to clean up old scans? It would be great if we could define retention time for scans to keep, and then remove them automatically.

J12934 commented 6 months ago

Hi @danil-smirnov No, scans right now have no automatic cleanup. Adding a ttlSecondsAfterFinished field would be cool. (simmilar to the field on k8s jobs: https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/#cleanup-for-finished-jobs)

ScheduledScans however will automatically only keep around x number of the most recent scans. (configurable on the scheudledscan).

danil-smirnov commented 6 months ago

Thank you @J12934 If we switch to ScheduledScans and we create tens of them, is it possible to distribute their runs over time to avoid rate-limiting issues and save costs? I haven't found any cron-like syntax or a parameter to set the starting time.

J12934 commented 6 months ago

Thank you @J12934 If we switch to ScheduledScans and we create tens of them, is it possible to distribute their runs over time to avoid rate-limiting issues and save costs? I haven't found any cron-like syntax or a parameter to set the starting time.

oh, whoops somehow that wen't missing in the docs. cron expression support was added in release 4.1.0 opened a pr to add the docs: https://github.com/secureCodeBox/secureCodeBox/pull/2296/files