7

I want GeoServer rest security setup so that only a specific role can access everything under a specific workspace. This is what my /datadir/security/rest.properties file looks like:

/**;GET=ADMIN
/**;POST,DELETE,PUT=ADMIN
/rest/workspaces/myworkspace/*;GET,POST,PUT,DELETE=myrole

But I get a 403 error with this:

curl "http://mygeoserver/geoserver/rest/workspaces/myworkspace/layers" -u "userinmyrole:password" -v

How can I secure a workspace in REST?

2 Answers 2

2

If someone is still looking for answer to this problem. Solution is to place you desired non root security restriction on top of the default admin restrictions. Therefore, the solution for the question is to place the last row on top of the two ones like this:

/rest/workspaces/myworkspace/*;GET,POST,PUT,DELETE=myrole
/**;GET=ADMIN
/**;POST,DELETE,PUT=ADMIN

The reason for this is that the last two security restrictions override the more specific one.

0

I tried to run Petteri's configuration, but there is one star missing. Putting an additional star in the first line (in front of the ";GET") solved it for me:

/rest/workspaces/myworkspace/**;GET,POST,PUT,DELETE=myrole
/**;GET=ADMIN
/**;POST,DELETE,PUT=ADMIN

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.