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

C Wrapper and Apache Module tasks #100

Closed
7 of 12 tasks
jptosso opened this issue Nov 9, 2021 · 0 comments
Closed
7 of 12 tasks

C Wrapper and Apache Module tasks #100

jptosso opened this issue Nov 9, 2021 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@jptosso
Copy link
Member

jptosso commented Nov 9, 2021

Coraza WAF can be exported to C using CGO exports. We are going to build an Apache module that makes uses of this features. The project will be considered ready once it is fully executing the OWASP CRS test suite using go-ftw and the Coraza Apache module.

  • Export tx.Request|ResponseBodyBuffer.Write and a write from file function
  • Export the 5 phase processing functions (ProcessRequestHeaders, ProcessRequestBody, ProcessResponseHeaders, ProcessResponseBody, ProcessLogging)
  • Export a function to get the interruption from a transaction
  • Create additional export functions to create waf instances, transactions, evaluate directives and import directives file
  • Create a Interruption interface in C compatible with coraza, it shall hold the disruptive action, status and additional parameters like redirect url or proxy address
  • The functions are compatible with libmodsecurity, so we must use the official libmodsecurity apache module
  • Immitate the logging callback system from libmodsecurity and make it compatible with each logging level
  • Create freeing functions for coraza transactions and waf instances, also check how to reconnect the garbage collector with the CGO pointers or manually delete everything
  • Create tests for the CGO functions and C exported functions
  • Create a whole test suite for the apache wrapper
  • Create benchmarks for the wrapper and the apache module
  • Compare the results with Modsecurity v2/v3 and Apache

I have created some tests under https://github.com/jptosso/coraza-cexport, apxs is required to compile the module

@jptosso jptosso added the help wanted Extra attention is needed label Nov 9, 2021
@jptosso jptosso closed this as completed Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant