corazawaf / libcoraza

OWASP Coraza C connector
Other
18 stars 7 forks source link

feat: Implement coraza rules add file and coraza_rules_add_file #23

Closed potats0 closed 1 year ago

potats0 commented 1 year ago

Implement coraza_rules_add and coraza_rules_add_file functions, which can dynamically add rules at any time. such as

er := stringToC("a")
waf := coraza_new_waf()
coraza_rules_add(waf, stringToC(`SecRule REQUEST_HEADERS:User-Agent "Mozilla" "phase:1, id:3,drop,status:403,log,msg:'Blocked User-Agent'"`), &er)
coraza_rules_add_file(waf, stringToC(`default.conf`), &er)