I have some polkit questions that I have not been able to find good answers
for after reading the docs and googling around.

We are hoping to use polkit in several backend daemons running on an
embedded linux box. We have a web interface as well as ssh access. From our
webserver we need to make dbus calls to the backend services. From ssh
access we have cli apps that would make the same backend service calls.

It's fairly clear how we can set up polkit rules to authorize the cli
applications to make calls.

What is less clear is how we can use polkit to authorize the calls from the
webservice. Any help would be appreciated!

The webserver would be running as an unprivileged process in a
container/namespace such that it has access to dbus socket and nothing
else. We'll be using PAM for authentication of incoming user requests and
session creation.

It seems like we could create our own authentication agent and have the
webserver use a connection to the authentication agent to validate the
user. Just reading docs in preparation for a prototype now, so have not
tried any code, but it looks like it may be difficult to correlate incoming
requests, backend dbus calls, and authentication requests. Also, we allow
oauth and openid connect for authentication/authorization, so there may not
be local user accounts for each request. It looks like a local NSS module
may be a way to resolve that.

So far, it's pretty confusing as there doesnt seem to be much in the way of
documentation or examples for how this should work.

I'd like to protect against the threat of webserver attacks being used to
call backend dbus calls that should not be allowed, as well as unify our
security model between local console access and remote access.

Any advice or direction would be greatly appreciated.

Reply via email to