-
Notifications
You must be signed in to change notification settings - Fork 532
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
modsecurity-crs-docker integration #222
Comments
coreruleset/modsecurity-crs-docker#117 Adding a similar thing, that I wrote in modsec-crs github page. If you two could collab it would be awesome. |
I can’t dive deep in that tooling right now, but cool to see it all. Either an earlier compile step or that link phase is not using the SSL installation these images create. So check some |
I see another potential issue -- OpenResty uses PCRE 1, not PCRE2. So there might be linking issues related to that which pop up after this is resolved. |
Do you know, if the lua-nginx-module needs to use PCRE 1 ? With newer versions coming out, do you think openresty will move to PCRE2? |
See this issue: openresty/lua-nginx-module#1984 That seems to show it is an Nginx version limitation. I think there's gonna be an OpenResty release sometime supporting newer versions -- I don't work on that, but I see there's been dependency upgrade commits lately. If |
I did find an Openresty reference in modsecurity documentation: https://github.com/SpiderLabs/ModSecurity/wiki/Compilation-recipes-for-v3.x#nginx-connector-openresty-1 |
I spent some time understanding this. As you are pointing with those, you need to build the module against the OpenResty tree instead of the nginx tree. To progress from where you are might be as simple as this diff?
I'm building it, but won't be able to check it for a while. EDIT: fixed to match the style of that Dockerfile |
I figured this out aswell. I am also trying to build it in a similar way. |
So that didn't work out well for me. Another option would be to build it in the build-from-source image process. You would build the Nginx Connector by using environment variables. This issue discusses it #79. You'd want to do like Then you would use that image in the |
I have pushed the latest testing version here. As you can see I have
Seems straight forward, but my build fails because it cant find LuaJIT. Maybe I added some env variable 'wrong'?
|
I have gotten it to build. But I seem to be facing the same issue as in the initial post. I will try to look at the build logs and the one similar issue from a few years ago. |
My build options. that come from the Openresty Dockerfile version of openresty using EDIT: My --with-ld-opt does not contain /usr/lib |
Hmm... to implement this flow
|
I guess the bigger problem is that Nginx base image uses docker-entrypoint.sh scripting... |
I found the issue. It was similar to the linked issue before. The modsec-crs uses this ENV variable: https://github.com/coreruleset/modsecurity-crs-docker/blob/develop/nginx/Dockerfile-alpine#L158 I will now try to docker-entrypointify all of this. |
Great progress! And yep, that line would mess things up at runtime for sure! It's telling the dynamic library loader to use a whole different set of libraries. Using a different entrypoint system should be OK. In the end, the normal installation just runs the
|
It seems to be working. I pushed the modifications to my fork of modsec-docker-crs and added a "new" webserver openresty. I also modified your openresty setup to use docker-entrypoint like the official Nginx docker image. I will write a longer post soon. |
I am trying to create a superduper all-in-one package, that has:
I have found out that nginx-plus supports oidc, but its nginx-plus.
So I found lots of guides how to use Openresty with its luarocks-oidc plugin.
https://developers.redhat.com/blog/2018/10/08/configuring-nginx-keycloak-oauth-oidc#installation_instructions
https://kevalnagda.github.io/configure-nginx-and-keycloak-to-enable-sso-for-proxied-applications
I am using https://github.com/coreruleset/modsecurity-crs-docker and I have forked it: https://github.com/TafkaMax/modsecurity-crs-docker
I have tried to combine the OpenResty and ModsecCRS docker builds, but in the end I get this weird error after docker build is finished and i launch the container:
Error relocating /usr/local/openresty/bin/openresty: SSL_magic_pending_session_ptr: symbol not found
Any thoughts?
The text was updated successfully, but these errors were encountered: