go-ftw icon indicating copy to clipboard operation
go-ftw copied to clipboard

feat: add quantitative testing

Open fzipi opened this issue 1 year ago • 6 comments

what

  • 💡 add quantitative testing to the testing tool !
  • run using a local engine instead of parsing logs!
  • let the tool interface with the corpus to test, instead of pointing to a file
  • allow caching corpus files to ease CI/CD testing caching big files
  • plenty of variables and highly configurable from the cmd line
  • [EXPERIMENTAL] interface for adding more corpus
  • right now the tests are run against CRS mostly, but could be extended to additional rulesets

why

  • reuse the tool we use for testing and add more features
  • speed

future

  • get a threshold for knowing what is considered "bad" or "worse" than before
  • probably using go funcs to process corpus in parallel to lower times. right now is just line by line, which probably is really underperformant

fzipi avatar Sep 14 '24 18:09 fzipi

Could you please link some basic theoretical explanation to this issue to outline the motivation standing behind this PR. Thanks in advance!

huberts90 avatar Sep 20 '24 08:09 huberts90

Well, I don't know if there is any "theoretical" explanation here, other than plain numbers.

We take a bunch of standard (meaning it doesn't contain attacks) text grabbed from the internet, and we run it against CRS. We get the percentage of the text that matches certain rules.

If you modify a rule and the numbers go up, your change will get more false positives. That's the gist of quantitative testing around rules.

fzipi avatar Sep 21 '24 13:09 fzipi

BTW, this is experimental until we have a good notion on what output we want from the tool.

fzipi avatar Sep 22 '24 00:09 fzipi

@fzipi there are still two unresolved comments from the previous review.

theseion avatar Sep 22 '24 07:09 theseion

@fzipi there are still two unresolved comments from the previous review.

I always fall in the hidden comments 🤦

fzipi avatar Sep 22 '24 14:09 fzipi

  • Added some factory methods
  • Cleaned up outputs
  • Added line number when printing payload in debug mode

fzipi avatar Sep 23 '24 01:09 fzipi