1 |
-----BEGIN PGP SIGNED MESSAGE----- |
2 |
Hash: SHA1 |
3 |
|
4 |
On 05/11/2014 05:42 PM, Micha³ Górny wrote: |
5 |
> Hi, everyone. |
6 |
> |
7 |
> Almost 9 months ago I've committed three new FEATURES for portage: |
8 |
> cgroup, ipc-sandbox and network-sandbox. Today I'd like to propose |
9 |
> enabling at least the latter two by default. |
10 |
> |
11 |
> |
12 |
> Firstly, I'd like to shortly remind you what they do: |
13 |
> |
14 |
> 1. cgroup -- puts all processes spawned by ebuild to cgroup, and kills |
15 |
> all of them once phase exits (prevents leaving orphans), |
16 |
> |
17 |
> 2. ipc-sandbox -- puts all processes spawned by ebuild to a separate |
18 |
> IPC namespace, preventing them from interfacing other system services |
19 |
> via IPC (message queues, semaphores, shared memory), |
20 |
> |
21 |
> 3. network-sandbox -- puts all processes spawned by ebuild to |
22 |
> a separate network namespace with a private loopback interface, |
23 |
> preventing them from interfacing other system services, local network |
24 |
> and the Internet. |
25 |
> |
26 |
> |
27 |
> Secondly, the benefits of using the latter two include: |
28 |
> |
29 |
> 1. improved tree quality through more complete testing |
30 |
> |
31 |
> In the past, usually users with no or shoddy Internet access were |
32 |
> the first to notice ebuilds breaking with no Internet access. With |
33 |
> network-sandbox, the ebuilds fail consistently for everyone including |
34 |
> developers. They can notice the issues first hand and fix them before |
35 |
> committing the ebuild to the tree. |
36 |
> |
37 |
> 2. protection of user privacy (and security) |
38 |
> |
39 |
> Currently, programs spawned by ebuilds can submit any data |
40 |
> to the Internet, often unnoticed. While committing ebuild performing |
41 |
> malicious activity is unlikely, such uses as test suites sending |
42 |
> pre-defined data and possibly some system-specific data to remote |
43 |
> services happen. This affects user's privacy and we should prevent |
44 |
> ebuilds from doing that without user's approval. |
45 |
> |
46 |
> 3. preventing unsolicited (and possibly costly) Internet access |
47 |
> |
48 |
> Bear that Gentoo can be run on a machine with byte-paid or otherwise |
49 |
> shoddy Internet access (possibly with local distfile host or alike). |
50 |
> Ebuilds using network unwisely can reduce throughput of other local |
51 |
> services or even cause higher Internet bill. |
52 |
> |
53 |
> 4. improving security through preventing unsolicited access |
54 |
> |
55 |
> The build process (and especially tests) can spawn daemons and bind |
56 |
> them to network interfaces. Without network sandbox, other processes |
57 |
> (or systems if 0.0.0.0/:: is used) can access the spawned services |
58 |
> and possibly perform malicious operations. With network-sandbox, even |
59 |
> local users can't access the spawned daemons (due to private loopback |
60 |
> interface). |
61 |
> |
62 |
> 5. preventing data loss through thoughtless access to local services |
63 |
> |
64 |
> I have seen test suites that used production database servers running |
65 |
> on the host. You can imagine how much damage such a test suite could |
66 |
> cause by mistake. network-sandbox prevents the ebuild from accessing |
67 |
> local services, requiring it to run a safe, separate instance. |
68 |
> |
69 |
> |
70 |
> What do you think? |
71 |
> |
72 |
I love these new features, with one minor question: |
73 |
|
74 |
What about talking to local network resources? In my metasploit ebuild |
75 |
it has tests available which talk to a local database and are perfectly |
76 |
safe, however, if postgresql is started on the system the tests don't |
77 |
work, the ebuild needs to start it's own postgresql to run the tests. |
78 |
This seems a bit needless in my package, but likely saves others from |
79 |
poorly written tests. Do we want to allow access to system network |
80 |
services or block them? Right now they are blocked, and that's going to |
81 |
make the src_test function on my ebuild expand into near insanity to fix. |
82 |
|
83 |
- -Zero |
84 |
-----BEGIN PGP SIGNATURE----- |
85 |
Version: GnuPG v2.0.22 (GNU/Linux) |
86 |
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ |
87 |
|
88 |
iQIcBAEBAgAGBQJTcPGvAAoJEKXdFCfdEflKTRsQALVP4yDmT+KIbd5ZnEj0TlUf |
89 |
6eiG2pVJ1XHun3cuil4Sm5AqbuehvhzCLzM8uLEZuTus8YIZqfO4XhiXjY70WyMM |
90 |
N1SdUMFucmokOvNG2RmTVt30VETAn2fOQakbpYu7KyR2N9lDtAi/UXfJJTGRe+m3 |
91 |
iilVZ8rRyQG903VRwJZoQsYPjv7qYwxC7I345u3jDpwwObnbvs9An5lE5A4gVSa/ |
92 |
oLHI636lkdO7e2egitewGEo96Xaa65CCVTt9w5BeT2Ovv3IwgxjD6UgO6hbYIHvg |
93 |
CsdnCUTd1o3BTasZgAwaJJv8FcJWdrpJsEk8Kowb42Mpy6kaz7ymaxbOye3i07jf |
94 |
MIdh+nbRUS3VRuUf14+8sda1/rCpgnOKIbGfNpfAuKFf/FNfTbLQET7cIv5oNAJE |
95 |
Kis0nfLCSdZTxV9qlLC/7cxC8MNSjYu1x/ynRQYmK1qUTGfiWUqMwdk3HBveVAI8 |
96 |
bfYTtoXbbuyGHU2hOxRPgYl/ynVoWRw65jYZR5gLekXlVJtbU3H76NpbKqkYXWtF |
97 |
l+u8ddJCGD3ghVUm8Sknk8E8uSGOxgHaRaIfj8HpVSKrn/BZkB8dnmTa15SvQYUf |
98 |
yBvuJTAMlSDkLXCvqJZJVK61iDc6eFPXXcsrOkrYNOpz3425AI4iuXHvtfpDJnGP |
99 |
UgnWgSfIJ9iN0jHz7n0e |
100 |
=uAgr |
101 |
-----END PGP SIGNATURE----- |