Hi,
in this mail I would like to discuss implementing a way to limit file system access
to workspace administrators (and maybe also more in general, to administrators).
Currently, one can browse the entire file system using the file source browsers for
coverage sources and file based data stores. The idea is to pose some limits so that
workspace admins are limited inside a well known sub-tree of the file system during
their GUI or REST administrative operations.
To keep things simple, I would propose, configuration wise, a simple template that
the (main) administrator would configure, e.g.:
/opt/data/{workspace}
When setting up a new store, the implementation would check if the current request
is an admin request (flag set by both GUI and REST API), and subject to validation
the path parameters in coverage and data stores.
The GUI would also be limited, so that areas that are not supposed to be accessible
are not showing up.
As a twist to help hosting, we might have the checks be performed also for the full
administrator, if the path template has been set by the system administrator through
an environment variable: while the best practice for production systems
is never to put data in the “data directory”, one is unlikely to like having a paying
customer freely wander over the entire file system.
Also, implementation wise, this does not seem neither a URLCheck (they are not
contextual to the type of request, nor related to admin usage) nor a
ResourceAccessManager related activity (which deals catalog access for all users
and all requests), and I don’t think we’d like to have these checks get disabled the moment
alternative resource access managers are installed.
Maybe a new FileAdminAccessManager interface?
public interface FileAdminAccessManager {
public boolean checkAccess(Autentication auth, File file);
}
The caller should be checking if the current request is an administrative request and the
current user is a workspace admin.
Thoughts?