coreruleset: time worst-case inspections against reference work (closes #400) #402
Open
clawbot
wants to merge 1 commits from
issue-400-coreruleset-timing-ref into next
pull from: issue-400-coreruleset-timing-ref
merge into: sneak:next
sneak:main
sneak:next
sneak:issue-398-breaker-test-without-questions
sneak:issue-400-coreruleset-timing
sneak:issue-396-no-own-hosts
sneak:issue-394-decide-in-time
sneak:issue-392-rproxy-circuit-breaker
sneak:issue-216-oci-labels
sneak:issue-388-any-tls-proxy
sneak:issue-386-readme-rproxy-alone
sneak:issue-387-readme-scraper-policy
sneak:issue-339-long-line-limits
sneak:issue-379-lookup-headers-by-default
sneak:issue-315-remove-crowdsec
sneak:issue-354-package-registry-searches
sneak:issue-353-api-searches
sneak:issue-234-rename-settings
sneak:issue-359-ghost-remaining-fields
sneak:issue-373-read-rest-after-connection-close
sneak:issue-374-ghost-canonical-url
sneak:issue-371-body-over-limit-test-reset
sneak:issue-358-ghost-scripts
sneak:issue-211-viper-config
sneak:issue-357-ghost
sneak:issue-346-names-in-bodies
sneak:issue-365-adopt-form-repository-names
sneak:issue-220-apps-by-hostname
sneak:issue-352-shared-searches
sneak:issue-215-golines
sneak:issue-227-settings-file-per-daemon
sneak:issue-350-forgejo-searches
sneak:issue-349-gitea-user-page-ls
sneak:issue-287-crs-test-cpu
sneak:issue-284-wordpress-recorded-both-ways
sneak:readme-rewrite-155
No Reviewers
Labels
Clear labels
critical
merge-ready
needs-checks
needs-decision
needs-decision
needs-decision
needs-rebase
needs-review
needs-rework
post-1.0
red-next
Extremely important: data loss, a security hole, production down, or basic use impossible
Reviewed and ready for the owner to merge
Checks must be fixed before review
Waits on an owner decision
Waiting on a decision by the owner
Conflicts with next; rebase required
Review not yet done
Review found issues to fix
No labels
needs-review
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/smallwebwaf#402
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #400
TestTheCoreRuleSetInspectsEachWorstCaseRequestInTimecompared each inspection with a fixed 1 second, so a busy host failedmake checkat random. As decided on the issue, it now compares each inspection with reference work: a fixed regular-expression match, unrelated to the Core Rule Set, timed on the same thread just before and after. Both are timed in processor time (CLOCK_THREAD_CPUTIME_ID, with the goroutine locked to its thread), so time other programs hold the processor does not count. A busy host's lower clock speed and shared cores slow both alike.The limit is 13 times the mean reference time. How 13 was fitted, over five
make testruns on our check host withtest-racerunning alongside and load averages from 45 to 125:A Core Rule Set about 1.4 times slower on that request fails the test.
golang.org/x/sysmoves from indirect to direct, forunix.ClockGettime;syscalldoes not export it.Judgement call: 13 is fitted to one host. On a much faster or slower processor the ratio, not the seconds, is what holds.
Model: opus-5-5
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.