-
Notifications
You must be signed in to change notification settings - Fork 2
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
File access #17
Comments
Will this include the log path |
I'm using Traefik 3.2.0 I'm trying to load a file, and it does not seem to work. Traefik static config experimental:
plugins:
coraza-http-wasm-traefik:
moduleName: "github.com/jcchavezs/coraza-http-wasm-traefik"
version: "v0.2.2"
settings:
mounts:
- /coraza
Via volumes: volumes:
- ./coraza:/coraza The folder in the middleware, I'm trying to load the file http:
middlewares:
my-coraza-http-wasm-traefik:
plugin:
coraza-http-wasm-traefik:
crsEnabled: true
directives:
- Include ./coraza/crs-setup.conf I get following error
If I try to load it via
Any idea? |
@tiran133 try |
Unfortunately not.
Not sure what's going, but I tried all sorts of combinations to include the file, but it seems that the folder is not mounted. |
I see. This sounds more like a traefik issue.
José Carlos Chávez
…On Tue, 29 Oct 2024 at 11:05, tiran133 ***@***.***> wrote:
Unfortunately not.
Still getting
Failed to initialize WAF: invalid WAF config from string: failed to readfile: open crs-setup.conf: file does not exist
Not sure what's going, but I tried all sorts of combinations to include
the file, but it seems that the folder is not mounted.
—
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXOYAXUST3YAUXJJ4GTQKLZ55MXFAVCNFSM6AAAAABIFVR5CWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBTG43TCNZQGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Well the implementation is here it looks ok to me, I guess, but I'm not a go expert so not sure. For now, I gave up, and I will use the example file |
you are right. It might not be a traefik issue. Let me put up a fix.
José Carlos Chávez
…On Tue, 29 Oct 2024 at 11:17, tiran133 ***@***.***> wrote:
Well the implementation is here it looks ok to me, I guess, but I'm not a
go expert so not sure.
https://github.com/juliens/traefik/blob/ac0c880b1ffbe7d888a67586397976856cd7fc34/pkg/plugins/middlewarewasm.go#L89
For now, I gave up, and I will use the example file Include
@crs-setup.conf.example and overwrite/add everything I need
through the middleware directive.
—
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXOYAT7WATJUOGFNSMHLP3Z55OETAVCNFSM6AAAAABIFVR5CWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBTHAYDKOBXGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
fix: fallsback on OS FS when not loading CRS (#17)
Done, check 0.3.0 |
Great! Thank you for your fast reply! Can you tag the traefik plugin too? EDIT: Just compiled to locally and used the 'localPlugins' for traefik. Still getting the same error.
Any combination of mounts and what not, it will not work for me. Thank you anyway! |
Done
https://github.com/jcchavezs/coraza-http-wasm-traefik/releases/tag/v0.3.0
José Carlos Chávez
…On Tue, 29 Oct 2024 at 13:32, tiran133 ***@***.***> wrote:
Great! Thank you for your fast reply!
Can you tag the traefik plugin too?
https://github.com/jcchavezs/coraza-http-wasm-traefik
—
Reply to this email directly, view it on GitHub
<#17 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXOYARB4ZZINCFN3OPOAULZ55553AVCNFSM6AAAAABIFVR5CWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBUGA4DEOJQGU>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Thank you. It is still not working for me. 😮💨 |
I believe the problem comes from corazawaf/coraza#1208. I am testing the fix. |
I reopened this issue because I could not find an easy fix for it. I suspect the failure comes from the mounting functionality provided by traefik. When I mount a folder e.g. package main
import httpwasm "github.com/http-wasm/http-wasm-guest-tinygo/handler"
func main() {
readDir(httpwasm.Host, ".")
readDir(httpwasm.Host, "/")
readDir(httpwasm.Host, "./etc")
readDir(httpwasm.Host, "/etc")
readDir(httpwasm.Host, "/etc/my-file")
}
func readDir(host api.Host, dir string) {
dirEntries, err := os.ReadDir(dir)
if err == nil {
host.Log(api.LogLevelError, "=> reading dir"+dir)
for _, f := range dirEntries {
host.Log(api.LogLevelError, "reading file"+f.Name())
}
} else {
host.Log(api.LogLevelError, "error reading dir "+err.Error())
}
} Fails all the time Ping @juliens |
Traefik merged a fix for this traefik/traefik#11321. Let's see when they cut a release. |
traefik/traefik#10739
The text was updated successfully, but these errors were encountered: