-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
request help: How to import rule set files in Coraza waf #2044
Comments
Try |
Hello sister, can you provide a complete demo? Also, which folder should these confs be placed in? |
APISIX uses coraza-proxy-wasm, in which I found: I have not tested this myself but I imagine updating configs here would serve the purpose: Let me know if this works. |
cc: @Sn0rt @Huanli-Meng |
Elder sister means that I need to import the firewall rules into a folder in apixsix, and then configure them directly like this?
|
The CRS should come embedded with the wasm module and you should not need to worry about the path. The path is internal. So I'd suggest you try this:
|
Dear sister, I still need your help I configured yaml to enable firewall plugin support for a certain route, but it reported an error
The error is because the plugin was not found
Then I will configure configMap to support plugins, which is the document I referenced https://apisix.apache.org/blog/2023/09/08/APISIX-integrates-with-Coraza/ There is a path that I don't know what I should fill in
The path I write by default does not work, do I still have any configuration errors? |
I have read this document, but I still don't quite understand. What should I write in this path, or where should I find the file? |
But I don't have this file |
Assuming the file path is correct. Have you reload APISIX after you update the |
Should this be an external file? I don't have this document |
Yes the wasm module needs to be downloaded first. Here's a doc based off the blog but offers more clarity in steps. It is based off an APISIX instance in Docker so just modify accordingly for your need. |
I'll take a look at the documents first. Sister, please rest early. Thank you, sister |
Sister, I'm sorry to bother you at night。 I followed the tutorial and moved the wasm file to my container. I also modified the configmap configuration file and restarted Apisix. However, when I configured it, I still prompted that the plugin was not found The following is the version I am using
I came across this document. https://apisix.apache.org/zh/docs/apisix/wasm/ He said I need to build an apisix base environment, and I looked at this document again https://github.com/api7/apisix-build-tools But when I build it myself, it will fail, so I used the Github action to build the already built image。 I replaced the image Then the container cannot start, I don't know if I want to directly replace the image . |
If you used the image we provide (e.g. As for the issue with importing core rule sets, I'll take a look and get back to you. |
@DokiDoki1103 I can reproduce the error you see. You need to add |
Just a caution note: once this PR (corazawaf/coraza-proxy-wasm#243) is merged and if you use the new release in the future, you would update |
I tested in apisix quickstart and successfully configured it
My configuration has successfully worked |
I set it but it doesn't take effect : "SecDefaultAction phase:1,log,auditlog,deny,status:403",
|
The specific issue isn't with APISIX anymore as the integration has now worked as intended. For questions about specific rules, please redirect them to |
The problem is that I can refer to * to make all rule sets effective, but referring to a single rule set does not |
The log you provided showed the single rule was effective and Coraza was detecting. It just wasn't blocking. This isn't an APISIX issue per se. Please do more research on your end. |
Dear sister, after continuous attempts, I have also successfully configured a single rule。
Configuring rule 913 in this way will succeed
That is to say, if one's own rules need to be placed in the middle, they must ensure consistency in order. I tested that if the order is incorrect, it will not take effect |
Ok great, thanks for sharing that info. I've tracked this and at some point we'll have a doc update to provide more examples, especially for including the CRS. If everything works out well now, we can close the issue? |
Yes, this issue can be resolved, but I encountered another issue when using apisix ingress controller. He will prompt me that I haven't found the plugin |
Issue description
see: #2043
I know the configuration method for a ruleset, but if multiple rulesets are referenced? Or is it possible to import files to make the firewall plugin effective? Configuration by configuration is too cumbersome.
This is the ruleset https://github.com/coreruleset/coreruleset/tree/v4.0/dev/rules
The text was updated successfully, but these errors were encountered: