[GTALUG] Adding all users to the "disk" group: bad idea, or terrible idea?

Dave Collier-Brown Dave.Collier-Brown at indexexchange.com
Fri Feb 21 07:22:10 EST 2020


A helpful addition would be to bracket the part of the program that does disk IO with setgid(), just like one brackets setuid code. --dave

On 2020-02-20 4:11 p.m., Chris Tyler via talk wrote:
Stewart, I'm having troubles understanding the author's reply to the SGID suggestion. What I was proposing was to set things up with a command like this (executed just once):

  BINARY=/path/to/binary ; sudo chmod 02711 $BINARY ; sudo chown root:disk $BINARY

...Which would mean that the user would have their effective group ID changed to 'disk' only while the binary was running. This means that, during program execution, it would be have the same level of access as if the user belonged to the 'disk' group; however, this would drop back to their previous group membership when the binary exited. As a bonus, you don't have to change the system group memberships. (The program in question should, of course, guard against writing to the wrong device while it's running, and prevent shell-outs).

-Chris


On Tue, Feb 18, 2020 at 8:27 AM Stewart C. Russell via talk <talk at gtalug.org<mailto:talk at gtalug.org>> wrote:
Hey, thanks to all who responded. I'm sticking with merely "bad idea",
as it would also give the user block-level access to everyone's secret
files. I know sudo already does this, but one has to manually clunk into
that mode. Though there are still plenty of Raspberry Pi users who 'sudo
ls', for some reason.

On 2020-02-17 7:23 p.m., Chris Tyler wrote:
> Wouldn't it be better to use SGID to enable access to disk devices only
> for the duration of that program's execution?

Author claims it's not possible. The program was written as a reaction
to finding out that balenaEtcher (https://www.balena.io/etcher/) "phones
home" with usage data. If true, this is unfortunate, because Etcher
fixes all the fiddliness of using dd as root, it's truly cross platform,
and avoids the Windows unzip bug. No-one's yet identified what exactly
Etcher phones home yet, but that hasn't stopped the heat, light and fury
of a Free Software Cause in the making …

The new program's quite usable for now (even if you have to run it sudo)
and appears to be cross-platform too. It's also a lot smaller than
Etcher, which is an Electron app.

Source repo is here: https://gitlab.com/bztsrc/usbimager
---
Post to this mailing list talk at gtalug.org<mailto:talk at gtalug.org>
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk



---
Post to this mailing list talk at gtalug.org<mailto:talk at gtalug.org>
Unsubscribe from this mailing list https://gtalug.org/mailman/listinfo/talk


--
David Collier-Brown,         | Always do right. This will gratify
System Programmer and Author | some people and astonish the rest
dave.collier-brown at indexexchange.com<mailto:dave.collier-brown at indexexchange.com> |              -- Mark Twain



CONFIDENTIALITY NOTICE AND DISCLAIMER : This telecommunication, including any and all attachments, contains confidential information intended only for the person(s) to whom it is addressed. Any dissemination, distribution, copying or disclosure is strictly prohibited and is not a waiver of confidentiality. If you have received this telecommunication in error, please notify the sender immediately by return electronic mail and delete the message from your inbox and deleted items folders. This telecommunication does not constitute an express or implied agreement to conduct transactions by electronic means, nor does it constitute a contract offer, a contract amendment or an acceptance of a contract offer. Contract terms contained in this telecommunication are subject to legal review and the completion of formal documentation and are not binding until same is confirmed in writing and has been signed by an authorized signatory.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gtalug.org/pipermail/talk/attachments/20200221/b049f70b/attachment.html>


More information about the talk mailing list