On Tue, Jan 15, 2013 at 11:43 AM, Kevin Chadwick <ma1l1i...@yahoo.co.uk> wrote:
>> > Unless sudo has some config setting that allows access only when
>> > logged in via console it isn't really a solution.
>> >
>> > Rich
>> >
>
> man sudoers -> /requiretty
>
>>
>> I manage 'thousands' of desktops at Google and we generally like
>> polkit.
>
> I never meant it is rubbish as such but I saw it as rediculously
> inferior to sudo before I even read this.
>
> http://drfav.wordpress.com/2012/05/11/the-quest-towards-trusted-client-applications-a-rambling/

Perhaps I'm misunderstanding, but that is talking about a specific set
of problems that I don't think polkit was actually designed to
address. Polkit is basically for authenticating applications via
users, not the applications themselves. If I am running app foo, and
app foo wants to inhibit hibernation; polkit is there to ask 'hey is
antarus allowed to inhibit hibernation? Does antarus need to auth to
do so? Is antarus already authenticated? Now one may say 'hey but I
only want certain applications to hibernate' and while that may be an
interesting problem...I don't think the existing polkit intends to
solve it.

>
>
>> It is however, designed for graphical UI single-seat systems.
>> Its command line support sucks (they only added a CLI auth agent in
>> May) and it is not well adopted. Multi-user systems do not work well
>> with polkit. Certainly with polkit and dbus you can allow users to
>> take more specific action without complex wrappers, setuid scripts, or
>> sudo.
>
> Except you can't, it only encourages more coarse grained approaches,
> less useful commands available and devs to learn an api rather than C
> and simply moves code into a far less secure mechanism and increases the
> chance that the code will not be well designed to the task at hand and
> running as root. It can be a real pain to work out exactly what polkit
> allows and you cannot just edit it to suit your application and it
> completely ignores the existing unix security technologies with
> brilliant track records.

One could say that 'a discrete set of APIs will be no match for
the..fined grain control that is the command line!' I would agree. I
don't agree that this is a one-size fits all deal though. There can be
a command line AND an API. I'd rather grant my users 'access to the
install authenticated packages action' than have to own a complex sudo
rule.

I don't understand 'the APIs that coders will learn instead of C.' Can
you elaborate? Polkit has a C api...

I don't understand how the code will 'not be well designed to the
application at hand.' I mean ideally the API and the CLI are
essentially just wrappers around the same library of functions.

Its unclear how polkit is 'hard'. Now it *is* new, and I will concede
you will have to read some manpages. However i don't think the
concepts are difficult. There are plenty of helpers (pkcheck springs
to mind) that assist the user in figuring out what is 'allowed'. The
configuration for polkit is all in /usr/share and /etc. The configs
are configurable..again in /etc. This is not something I would term
'challenging.'

>
> You could try to argue that many eyes will look at a central piece of
> code but in fact less implementations will likely mean less eyes and
> just assumption that a guy who got JS through as a config language has
> everything covered. Granted, unmaintained code running as root may be
> higher with sudo but if it needs maintaining, should it be running as
> root at all or is it actually simply doing too much.

Its not a matter of many-eyes. It is a matter of 'some other guy is in
charge of maintaining that component.' It means I can focus on stuff
that matters, and not focus on 'wrappers to make random things work.'
Is the polkit maintain any less 'trustworthy' than the gnome
maintainers? the kde maintainers? the kernel maintainers? At the end
of the day my machines are running software from thousands of
contributors.

>
>> My package manager can have a polkit action like 'install a
>> signed package' and I can grant the user access to do that, but not
>> access to install unsigned packages (root exploit there...) or run
>> other dangerous apt commands. It comes built into apt, so I don't have
>> to write extra wrappers.
>
> That would be the default and wouldn't even need the command line
> argument control of sudo. Just allowing updates is apt-get update.

Er, apt-get update downloads new Packages files, it doesn't install
any additional software. apt-get *upgrade* will. These are separate
*actions*.

>
> In fact I have a debian system where experimental iceweasel is
> installable but nothing else. I have an Arch system where the only
> kernel updateable is a signed by me when offline kernel and polkit is
> disabled as I don't have the time to keep track of what it is
> permitting and code comments weren't helpful there.

Look if you don't trust polkit, or you dislike it, or you just don't
have time to understand how it works; that is cool. 18 months ago I
was in the same camp. Polkit is not strictly required. But don't go
spouting about how much it sucks unless you have actually *used* it.

In some cases (like most places where multiple users are present) it
is in fact terrible. We wanted to do some 'unique' things with
mounting of USB hardware with polkit (and udisks) and found it
basically impossible to make work over ssh. I ended up going with the
'sudo make me a sandwich' route. Sometimes that is necessary.

>
> Sudo even supports regex!
>
> p.s. apt should be downloading as an _apt user, simply as best
> practice before adding polkit support ;-)

Feel free to file a bug against apt. I don't maintain it (I am not
even a Debian developer.)

>
> --
> _______________________________________________________________________
>
> 'Write programs that do one thing and do it well. Write programs to work
> together. Write programs to handle text streams, because that is a
> universal interface'
>
> (Doug McIlroy)
> _______________________________________________________________________
>

Reply via email to