RDF4J security nor working as expected #3158
-
Dear RDF4J! Currently I am working on an open source Python RDF4J Connector, utilizing the REST_API to bring RDF4J to the Python world. Writing tests to check for security issues I stumbled over the following. I am not a Java developer and therefore a bloody beginner with tomcat security. I am sure I did a configuration error. I added the following security constraints to the web.xml file of the RDF4J server:
With these constraints I expected for instance that a user with the rdf4j-viewer role cannot drop a repository. The drop operation has to use the HTTP-Delete Method, which is only allowed for the rdf4j-admin role. But nevertheless the viewer with role rdf4j-viewer is able to drop a repository. Is there a way to introspect/audit the security constraints in tomcat? Any help appreciated Volker |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Not a Tomcat expert either, but perhaps
should have another url-pattern:
And perhaps also check if the endpoint really is I assume there is also a login-config somewhere in the web.xml ? Hope this helps Bart |
Beta Was this translation helpful? Give feedback.
-
@barthanssens At first I facepalmed myself. Sure the URL-Patterns are starting at /repositories and not at /rdf4j-server/repositories.
If I intentionally damage a tag in the security specification I am rewarded with an error message in the log, so I am quite sure that the web.xml I am using is the one which is loaded by tomcat. BTW I see the following stacktrace concerning lockback in the logfile. But I do not expect a logging problem to interfere with HTTP-Security. So I am not the wiser. Any further Ideas? Or may someone please be so kind and try to reproduce my findings. Maybe it really is a bug. For completeness I attach my complete web.xml Cheers,
|
Beta Was this translation helpful? Give feedback.
@barthanssens
Thank you for the fast answers!
At first I facepalmed myself. Sure the URL-Patterns are starting at /repositories and not at /rdf4j-server/repositories.
So I changed the patterns. But my initial config was correct.
From this log message
Suspicious URL pattern: [/repositories/datenadler_*] in context [/rdf4j-server], see sections 12.1 and 12.2 of the Servlet specification
I can conclude that the current context is /rdf4j-server and therefore my initial config is indeed not complete bullshit.
If I intentionally damage a tag in the security specification I am rewarded with an error message in the log, so I am quite sure that the web.xml I am using is the one which is loaded by…