DataDog / datadog-static-analyzer

Datadog Static Analyzer
https://docs.datadoghq.com/static_analysis/
Apache License 2.0
100 stars 12 forks source link

Add stopgap cache clearing for ddsa on the analyzer server #429

Closed jasonforal closed 3 months ago

jasonforal commented 3 months ago

What problem are you trying to solve?

We currently cache a v8::Script for each rule once per runtime and re-use it for every execution. This cache is keyed by the rule's name. This works well for analysis, however, when authoring a rule, that the key is the rule's name means the first version will always be returned.

What is your solution?

Clear the rule cache for the rules in the HTTP request before executing any of them. This isn't the most elegant solution, but it serves as a stopgap to fix a behavior regression on ddsa that effectively makes rule authoring impossible.

Alternatives considered

What the reviewer should know