Skip to content
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

unable to import github.com/corazawaf/coraza/v3 #1590

Open
zetaab opened this issue Sep 4, 2023 · 2 comments
Open

unable to import github.com/corazawaf/coraza/v3 #1590

zetaab opened this issue Sep 4, 2023 · 2 comments

Comments

@zetaab
Copy link

zetaab commented Sep 4, 2023

The following program sample.go triggers an unexpected result

package main

// yaegi:tags purego
import (
        "fmt"

        "github.com/corazawaf/coraza/v3"
)


func main() {
        waf, err := coraza.NewWAF(coraza.NewWAFConfig().
                WithDirectives(`SecRule REMOTE_ADDR "@rx .*" "id:1,phase:1,deny,status:403"`))
        // Now we parse our rules
        if err != nil {
                fmt.Println(err)
        }
        fmt.Printf("%+v\n", waf)
}

Expected result

% go run main.go
{waf:0x14000174000}

Got

% yaegi ./main.go
run: ./main.go:7:2: import "github.com/corazawaf/coraza/v3" error: /path/to/go/src/project/name/vendor/github.com/corazawaf/coraza/v3/config.go:11:2: import "github.com/corazawaf/coraza/v3/internal/corazawaf" error: /path/to/go/src/project/name/vendor/github.com/corazawaf/coraza/v3/internal/corazawaf/rule.go:13:2: import "unsafe" error: unable to find source related to: "unsafe"

Yaegi Version

0.15.1

Additional Notes

with unsafe being blocked by default in traefik. We cannot develop coraza waf plugin which will be the next generation for modsecurity.

@litao09h
Copy link

image

Encountering similar problems,
It seems like there are many problems, not very mature。

@alarbada
Copy link

Such a shame, I also got a similar error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants