ocurity / dracon

Security scanning & static analysis tool - forked and rewritten from @thought-machine/dracon
https://smithy.security
Apache License 2.0
73 stars 12 forks source link

Enrichers Shouldn't Fail Silently #259

Open flowirtz opened 2 months ago

flowirtz commented 2 months ago

Currently, enrichers can fail silently. For example, if the enricher/deduplication fails to enrich an issue, it just continues, meaning if all issues fail to enrich it just passes, without writing anything, failing silently. Instead, we want it to make some noise when it fails, i.e. to crash.

https://github.com/ocurity/dracon/blob/aab55a0ff27f616f79c7d03d24e23be970bdff6f/components/enrichers/deduplication/main.go#L47-L60

Likely, we can make this change in the base enricher, by validating that len(original_issues) == len (enriched_issues) or at least that IF len(original_issues) > 0 THEN len(enriched_issues > 0 to allow for some of the enrichment to fail.