Skip to content

jptosso/coraza-gin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a test middleware for Ginonic powered by Coraza Web Application Firewall. You may check the WAF documentation at coraza.io

Looking for contributors and testers.

How to use

import(
    //...
    "github.com/corazawaf/coraza"
    "github.com/corazawaf/coraza/seclang"
    corazagin"github.com/jptosso/coraza-gin"
)
func main() {
    // Creates a router without any middleware by default
    r := gin.New()
    waf := coraza.NewWaf()
    parser, _ := seclang.NewParser(waf)
    //parser.FromString(`#... some rules`)
    r.Use(corazagin.Coraza(waf))

    // Per route middleware, you can add as many as you desire.
    r.GET("/mypath", MyFunction(), Endpoint)

    // Listen and serve on 0.0.0.0:8080
    r.Run(":8080")
}

About

Coraza WAF Gin-gonic middleware

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages