Expected Behavior
dbms.security.procedures.default_allowed & dbms.security.procedures.roles provide procedure level user access control for custom procedures defined via "CALL apoc.custom.asProcedure()" and for the dbms.cluster.routing.getRoutingTable procedure necessary for neo4j:// bolt+routing calls.
Actual Behavior
dbms.security.procedures.default_allowed & dbms.security.procedures.roles provide procedure level user access control for some procedures, but not for custom procedures or for the dbms.cluster.routing.* family.
How to Reproduce the Problem
wget https://cdn.graphfoundation.org/ongdb/dist/ongdb-enterprise-3.6.0-unix.tar.gz
tar -xzf ongdb-enterprise-3.6.0-unix.tar.g
wget https://cdn.graphfoundation.org/apoc/dist/org/neo4j/procedure/apoc/3.5.0.12/apoc-3.5.0.12-all.jar
mv apoc-3.5.0.12-all.jar plugins/apoc-3.5.0.12-all.jar
- Create a new role and assign a user to that role
"CALL dbms.security.createRole('lowlife')"
"CALL dbms.security.createUser('user','password')"
"CALL dbms.security.addRoleToUser('lowlife','user')"
- Define a custom procedure such as
"CALL apoc.custom.asProcedure('listcity','MATCH (n:city {stateabr:$stateabr}) RETURN n LIMIT 10','read',[['n','NODE']],[['stateabr','STRING']]);"
- Add the following lines to neo4j.conf
dbms.directories.plugins=/db/plugins
dbms.security.procedures.default_allowed=admin
dbms.security.procedures.roles=custom.*:lowlife;dbms.cluster.routing.getRoutingTable:lowlife
dbms.security.procedures.unrestricted=*
dbms.security.procedures.whitelist=*
-
Start Neo4j
/bin/neo4j start
-
Call the custom procedure
"CALL custom.listcity('WA');"
Example of how dbms.security.procedures.roles works for some procedures but not others
"CALL custom.listcity('WA');" leads to this error message if you use neo4j:// and the configuration above

Or to this error message if you use bolt://

Furthermore, when I ran
"CALL dbms.procedures() YIELD name, roles WITH * WHERE name contains 'custom.listcity' RETURN *"
I received this output which illustrates that dbms.security.procedures.roles was not effective at allowing the lowlife role to use the custom.listcity procedure :

On the other hand, after editing the dbms.security.procedures.roles neo4j.conf line like this:
dbms.security.procedures.roles=apoc.broker.receive:lowlife
I ran
"CALL dbms.procedures() YIELD name, roles WITH * WHERE name contains 'apoc' RETURN *"
Which returned the following output illustrating that dbms.security.procedures.roles=apoc.broker.receive:lowlife worked properly in allowing the lowlife role to use the apoc.broker.receive procedure.:

Based on these results and other tests I did, it appears that there are a range of default procedures such as dbms.cluster.routing.getRoutingTable and custom procedures which dbms.security.procedures.roles is not capable of giving a role access to, but that there are other procedures such as apoc.broker.receive which roles can be given access to.
Versions
- OS: Ubuntu 20.4
- ONgDB 3.6.0
- apoc 3.5.0.12
Any updates or assistance is greatly appreciated. You guys are doing great work, and I can't tell you how much I appreciate it.
Expected Behavior
dbms.security.procedures.default_allowed&dbms.security.procedures.rolesprovide procedure level user access control for custom procedures defined via"CALL apoc.custom.asProcedure()"and for thedbms.cluster.routing.getRoutingTableprocedure necessary forneo4j://bolt+routing calls.Actual Behavior
dbms.security.procedures.default_allowed&dbms.security.procedures.rolesprovide procedure level user access control for some procedures, but not for custom procedures or for thedbms.cluster.routing.*family.How to Reproduce the Problem
Start Neo4j
/bin/neo4j startCall the custom procedure
Example of how
dbms.security.procedures.rolesworks for some procedures but not others"CALL custom.listcity('WA');"leads to this error message if you useneo4j://and the configuration aboveOr to this error message if you use
bolt://Furthermore, when I ran
I received this output which illustrates that
dbms.security.procedures.roleswas not effective at allowing thelowliferole to use thecustom.listcityprocedure :On the other hand, after editing the
dbms.security.procedures.rolesneo4j.conf line like this:I ran
Which returned the following output illustrating that
dbms.security.procedures.roles=apoc.broker.receive:lowlifeworked properly in allowing thelowliferole to use theapoc.broker.receiveprocedure.:Based on these results and other tests I did, it appears that there are a range of default procedures such as
dbms.cluster.routing.getRoutingTableand custom procedures whichdbms.security.procedures.rolesis not capable of giving a role access to, but that there are other procedures such asapoc.broker.receivewhich roles can be given access to.Versions
Any updates or assistance is greatly appreciated. You guys are doing great work, and I can't tell you how much I appreciate it.