Use as library
#1016
Replies: 3 comments 5 replies
-
Totally, Coraza is a Go library you can use to build whatever you want :)
José Carlos Chávez
tor. 14. mars 2024 kl. 10:24 skrev Sundar ***@***.***>:
… Hello,
I want to integrate coraza to only detect the issues on a fixed set of API
Requests that we already log into a file. So I'm writing it as a go binary,
which gets each of these API requests indvidiaully and then I want to run
the OWASP rules against each request individually.
Can coraza be used as a library within my golang application? Any examples
on how to achieve that.
—
Reply to this email directly, view it on GitHub
<#1016>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXOYAXEK4AZCXV7NAIIHFLYYFUD7AVCNFSM6AAAAABEVWYWTCVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZWGM3TCOBWGE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Yes, look at the examples dir, you will notice you have access to everything required to write your own implementation |
Beta Was this translation helpful? Give feedback.
3 replies
-
Check https://pkg.go.dev/github.com/corazawaf/coraza/v3
In the official http middleware you can see how to populate the
request/response elements.
This is how you create a transaction:
https://github.com/corazawaf/coraza/blob/9184eeebf038decac73bf81616374c0932eb2ba7/http/middleware.go#L122
These are the methods you can use to populate the transaction with http
request/response components:
https://github.com/corazawaf/coraza/blob/9184eeebf038decac73bf81616374c0932eb2ba7/types/transaction.go#L19
José Carlos Chávez
tor. 14. mars 2024 kl. 14:23 skrev Sundar ***@***.***>:
… I’m trying to get information on
1. how to set my own transaction - as I have the URL, Query Params,
Request Body
2. How to call the coraza with this manually set transaction and get
the matching rules
https://pkg.go.dev/github.com/corazawaf/coraza
The above godoc shows an old 2021 package. Is there a newer godoc for this.
—
Reply to this email directly, view it on GitHub
<#1016 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXOYASKXJPY434LOV3FRJTYYGQFBAVCNFSM6AAAAABEVWYWTCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DOOBWGMYDG>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I want to integrate coraza to only detect the issues on a fixed set of API Requests that we already log into a file. So I'm writing it as a go binary, which gets each of these API requests indvidiaully and then I want to run the OWASP rules against each request individually.
Can coraza be used as a library within my golang application? Any examples on how to achieve that.
Beta Was this translation helpful? Give feedback.
All reactions