-
Notifications
You must be signed in to change notification settings - Fork 287
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
How to add new parameter and generate parser for new code #347
Comments
I figured it out. Sorry for bothering you. |
no worries, feel free to ask here, we are happy to help. And sorry for the late reply. Just to clarify: do you want to use this modification only for yourself, or you want to add it into repository? An other remark: why do you want to change/modify the library's parser? It seems you want to add a specific directive to the Nginx, not to the library. And finally, may be that's not a solution what you are looking for, but you should take a look at SecWebAppId. That works out of box. |
hi @airween , thank you so much for your quick answer!
I'd like to use this modification only by myself (to be clear, for our project). As far as I understand, there is no need to add DOMAIN_ID to github modsec project because the domain_id is the directive we only use in our nginx, with several modules, and ngx_http_modsecurity_module module as example. The main puprose is to identify vhost, and see it in modsec logs. Also it would be great to work with DOMAIN_ID as a variable (say, IF domain_id eq some_number THAN some_action). So we need ngx_http_modsecurity_module to have the opportunity to work with domain_id although this directive is the ngx_http_core directive. We get it from http core module, and pass to msc_add_domain_id(Transaction *transaction, int domain_id) within ngx_http_modsecurity_module, after that we can see the corresponding domain_id in modsec logs, and can work with DOMAIN_ID as the variable.
yes, we want to:
thanks, I didn't know about that. I will ask about our devops guys if we can use it (and also I have a hunch that we could use the setvar for our purposes.) |
Hello, I have encountered issues in understanding how the parser generator works in the project.
Task:
Example usage:
this->m_domainId = domain_id;
m_variableDomainId.set(std::to_string(this->m_domainId), m_variableOffset);
return true;
}
Problem:
I don’t understand how to generate the code in such a way that the appropriate code appears in the necessary files. It seems that bison, lex, and yacc are needed for this.
Searching for a solution:
I searched for similar PRs, and this one has something similar to what I need:
owasp-modsecurity/ModSecurity@fa6e418
But I don't fully understand:
Could you please help me understand what the entire process of adding a new parameter looks like?
For example, my domain_id.
If needed, and if it is relevant, I will later write a part of the documentation that describes the process of adding a new parameter, based on our dialogue, and make a PR.
The text was updated successfully, but these errors were encountered: