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

[owasp-modsecurity compatibility] validateSchema action #1279

Open
cognitivegears opened this issue Jan 9, 2025 · 2 comments
Open

[owasp-modsecurity compatibility] validateSchema action #1279

cognitivegears opened this issue Jan 9, 2025 · 2 comments

Comments

@cognitivegears
Copy link
Contributor

cognitivegears commented Jan 9, 2025

Summary

coraza doesn't implement the validateSchema action
owasp-modsecurity has this action

Besides the existing Modsecurity support for XML schema validation, this should be extended to JSON validation using JSON Schema as well.

Basic example

https://github.com/owasp-modsecurity/ModSecurity/wiki/Reference-Manual-(v3.x)#validateschema

Motivation

I'm working on implementing schema validation as part of the OAShield project - OAShield Github Repository

Specifically, this would be used to Support Complex Data Types. I am currently working through using the existing Coraza body processors, but for complex schemas this is starting to look like it may be not very performant to create that many rules to validate every field, especially for searching for invalid parameters (anything that doesn't fit in the schema). A dedicated schema validator is likely to be much more optimized at doing this processing and would satisfy a compatibility item besides.

I would be interested in doing this work to make a PR for this, but wanted to raise this first to judge the interest before proceeding.

@jcchavezs
Copy link
Member

jcchavezs commented Jan 9, 2025 via email

@cognitivegears
Copy link
Contributor Author

Nice catch. Do you feel like opening a PR for this? I am 100% agree this should support JSON schema aswell.

Sure - let me take a shot at it, I'll follow up if I run into any issues.

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

2 participants