Gentoo Archives: gentoo-dev

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

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies