Gentoo Archives: gentoo-dev

From: Andrew Savchenko <bircoph@×××××.com>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: Re: [gentoo-dev] RFC: enabling ipc-sandbox & network-sandbox by default
Date: Tue, 13 May 2014 05:29:18
Message-Id: 20140513092849.a3e93849b0c9a63aa7e5803a@gmail.com
In Reply to: [gentoo-dev] RFC: enabling ipc-sandbox & network-sandbox by default by "Michał Górny"
1 Hello,
2
3 On Sun, 11 May 2014 23:42:38 +0200 Michał Górny wrote:
4 > Hi, everyone.
5 >
6 > Almost 9 months ago I've committed three new FEATURES for portage:
7 > cgroup, ipc-sandbox and network-sandbox. Today I'd like to propose
8 > enabling at least the latter two by default.
9 >
10 >
11 > Firstly, I'd like to shortly remind you what they do:
12 >
13 > 1. cgroup -- puts all processes spawned by ebuild to cgroup, and kills
14 > all of them once phase exits (prevents leaving orphans),
15 >
16 > 2. ipc-sandbox -- puts all processes spawned by ebuild to a separate
17 > IPC namespace, preventing them from interfacing other system services
18 > via IPC (message queues, semaphores, shared memory),
19 >
20 > 3. network-sandbox -- puts all processes spawned by ebuild to
21 > a separate network namespace with a private loopback interface,
22 > preventing them from interfacing other system services, local network
23 > and the Internet.
24 >
25 >
26 > Secondly, the benefits of using the latter two include:
27 >
28 > 1. improved tree quality through more complete testing
29 >
30 > In the past, usually users with no or shoddy Internet access were
31 > the first to notice ebuilds breaking with no Internet access. With
32 > network-sandbox, the ebuilds fail consistently for everyone including
33 > developers. They can notice the issues first hand and fix them before
34 > committing the ebuild to the tree.
35 >
36 > 2. protection of user privacy (and security)
37 >
38 > Currently, programs spawned by ebuilds can submit any data
39 > to the Internet, often unnoticed. While committing ebuild performing
40 > malicious activity is unlikely, such uses as test suites sending
41 > pre-defined data and possibly some system-specific data to remote
42 > services happen. This affects user's privacy and we should prevent
43 > ebuilds from doing that without user's approval.
44 >
45 > 3. preventing unsolicited (and possibly costly) Internet access
46 >
47 > Bear that Gentoo can be run on a machine with byte-paid or otherwise
48 > shoddy Internet access (possibly with local distfile host or alike).
49 > Ebuilds using network unwisely can reduce throughput of other local
50 > services or even cause higher Internet bill.
51 >
52 > 4. improving security through preventing unsolicited access
53 >
54 > The build process (and especially tests) can spawn daemons and bind
55 > them to network interfaces. Without network sandbox, other processes
56 > (or systems if 0.0.0.0/:: is used) can access the spawned services
57 > and possibly perform malicious operations. With network-sandbox, even
58 > local users can't access the spawned daemons (due to private loopback
59 > interface).
60 >
61 > 5. preventing data loss through thoughtless access to local services
62 >
63 > I have seen test suites that used production database servers running
64 > on the host. You can imagine how much damage such a test suite could
65 > cause by mistake. network-sandbox prevents the ebuild from accessing
66 > local services, requiring it to run a safe, separate instance.
67 >
68 >
69 > What do you think?
70
71 Please do not enable them prior rigorous testing.
72
73 I tried network-sandbox — this is a disaster. It brokes distcc
74 completely since distcc client can't connect to remote servers (and
75 even to a local one if any).
76
77 Best regards,
78 Andrew Savchenko

Replies