After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730037 - drop privileges for HTTP fetches
drop privileges for HTTP fetches
Status: RESOLVED WONTFIX
Product: ostree
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: OSTree maintainer(s)
OSTree maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-05-12 22:23 UTC by Colin Walters
Modified: 2018-08-17 19:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Colin Walters 2014-05-12 22:23:10 UTC
Doing HTTP as root brings lots of code like libsoup into the TCB.  We should at least do something like do the HTTP requests as "nobody" or so, with a pipe out to the privileged process.
Comment 1 Colin Walters 2014-05-23 02:42:51 UTC
Changing uid is pretty annoying though; we'd have to allocate a new one.

Another approach is to do a combination of:

1) Drop all capabilities
2) seccomp filters
3) SELinux policy
Comment 2 Jasper St. Pierre (not reading bugmail) 2014-05-23 02:53:34 UTC
Is there a reason you can't simply download in a separate process? Root process forks off something to find the latest tree on the server, which sends it back to the root process, and then the root process forks off another process to download the tree.

  $ ostree-get-latest-tree http://my.server/repo/
  de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3

  $ ostree-fetch-tree-from-remote http://my.server/repo/de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3
  ...
Comment 3 Colin Walters 2014-05-23 03:09:56 UTC
Any privilege dropping would require forking, yes - the question is what constraints are applied and how the communication works.
Comment 4 Jasper St. Pierre (not reading bugmail) 2014-05-23 03:15:15 UTC
I don't think there needs to be any communication other than one hash -- the hash of the tree that needs to be downloaded, and that can simply be done by writing to stdout and having the root process read it. Progress information can be shown to the user by simply leaking the stdout FD through to ostree-fetch-tree-from-remote.

Are there any other constraints I'm unaware of?
Comment 5 André Klapper 2018-08-17 19:00:22 UTC
OSTree has moved to Github a while ago.
Furthermore, GNOME Bugzilla will be shut down and replaced by gitlab.gnome.org.

If the problem reported in this Bugzilla ticket is still valid, please report it to https://github.com/ostreedev/ostree/issues instead. Thank you!

Closing this report as WONTFIX as part of Bugzilla Housekeeping.