Skip to content

Commit 308d2e5

Browse files
ctalledorodnymolina
authored andcommitted
[docs] Improve Sysbox security related docs.
Add a chapter to the Sysbox user-guide describing security vulnerabilities and CVEs that may affect Sysbox. Signed-off-by: Cesar Talledo <[email protected]>
1 parent 4e588d0 commit 308d2e5

File tree

4 files changed

+134
-23
lines changed

4 files changed

+134
-23
lines changed

README.md

+23-22
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,13 @@
1212

1313
***
1414

15-
**Security Note (01/21/22)**:
16-
17-
A vulnerability ([CVE 2022-0185](https://ubuntu.com/security/CVE-2022-0185)) was
18-
recently found in the Linux kernel, permitting a "User Namespace" escape (i.e.,
19-
an unprivileged user inside a user-namespace may gain root access to the
20-
host). This vulnerability affects containers deployed with Sysbox as they always
21-
use the Linux user-namespace for extra isolation. To mitigate it, check if your
22-
kernel distro carries the fix. For Ubuntu, the fix has been released and requires
23-
a [kernel update](https://ubuntu.com/security/notices/USN-5240-1). Reach out to the
24-
[Sysbox Slack channel][slack] for further questions.
15+
**Security Note (03/03/11)**:
2516

17+
A few vulnerabilities have recently been found in the Linux kernel that
18+
in some cases reduce or negate the enhanced isolation provided by
19+
Sysbox containers. Fortunately they are all fixed in recent Linux kernels.
20+
See the Sysbox User Guide's [Vulnerabilities & CVEs chapter](docs/user-guide/security-cve.md)
21+
for more info, and reach out on the [Sysbox Slack channel][slack] for further questions.
2622
***
2723

2824
## Introduction
@@ -290,10 +286,11 @@ spec:
290286
You can choose whatever container image you want, Sysbox places no requirements
291287
on the image.
292288
293-
The [Sysbox User Guide](docs/user-guide/deploy.md) has more info on this, and
294-
the [Sysbox Quickstart Guide](docs/quickstart/README.md) and has many usage examples.
295-
296-
You should start there to get familiarized with the use cases enabled by Sysbox.
289+
Nestybox makes several reference images available in its [Dockerhub](https://hub.docker.com/u/nestybox)
290+
and [GitHub Container Registry](https://github.com/orgs/nestybox/packages) repos. These are
291+
images that typically include systemd, Docker, Kubernetes, and more inside the containers.
292+
The Dockerfiles are [here](https://github.com/nestybox/dockerfiles/tree/master). Feel free
293+
to use and modify per your needs.
297294
298295
## Documentation
299296
@@ -302,17 +299,18 @@ We strive to provide good documentation; it's a key component of the Sysbox proj
302299
We have several documents to help you get started and get the best out of
303300
Sysbox.
304301
302+
* [Sysbox Distro Compatibility Doc](docs/distro-compat.md)
303+
304+
* Distro compatibility requirements. Check this out before installing Sysbox.
305+
305306
* [Sysbox Quick Start Guide](docs/quickstart/README.md)
306307
307308
* Provides many examples for using Sysbox. New users should start here.
308309
309310
* [Sysbox User Guide](docs/user-guide/README.md)
310311
311-
* Provides more detailed information on Sysbox installation, features and design.
312-
313-
* [Sysbox Distro Compatibility Doc](docs/distro-compat.md)
314-
315-
* Distro compatibility requirements.
312+
* Provides more detailed information on Sysbox installation,
313+
configuration, features and design.
316314
317315
* [Nestybox blog site](https://blog.nestybox.com/)
318316
@@ -377,9 +375,12 @@ and [developer's guide](docs/developers-guide/README.md) for more info.
377375
378376
## Security
379377
380-
Security issues that may expose a Sysbox vulnerability should be reported
381-
by sending an email to [email protected]. Please do not open security
382-
issues here.
378+
See the User Guide's [Security Chapter](docs/user-guide/security.md) for
379+
info on how Sysbox secures containers.
380+
381+
If you find bugs or issues that may expose a Sysbox vulnerability, please report
382+
these by sending an email to [email protected]. Please do not open security
383+
issues in this repo. Thanks!
383384
384385
## Troubleshooting & Support
385386

docs/user-guide/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ functionality.
2525

2626
[Systemd-in-Docker](systemd.md)
2727

28+
[Mounting and Sharing Host Storage](storage.md)
29+
2830
[System Container Images](images.md)
2931

3032
[Preloading System Containers with Inner Container Images](images.md#preloading-inner-container-images-into-a-system-container--v012-)
3133

3234
[Enhanced Container Isolation & Security](security.md)
3335

34-
[Mounting and Sharing Host Storage](storage.md)
36+
[Security Vulnerabilities & CVEs](security-cve.md)
3537

3638
[System Container Limitations](limitations.md)
3739

docs/user-guide/security-cve.md

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Sysbox User Guide: Security Vulnerabilities & CVEs
2+
3+
This document describes security vulnerabilities / CVEs associated that may
4+
impact the security of Sysbox containers.
5+
6+
These may be vulnerabilities in Sysbox itself (which are remediated fixed
7+
quickly) or in the Linux kernel features that Sysbox uses to isolate containers.
8+
9+
## Summary
10+
11+
| CVE | Date | Severity | Affects Sysbox | Details |
12+
| ------------ | -------- | -------- | -------------- | ------- |
13+
| 2022-0185 | 01/21/22 | High | Yes | [CVE 2022-0185 (User-Namespace Escape)](#cve-2022-0185-user-namespace-escape) |
14+
| 2022-0492 | 02/06/22 | Medium | No | [CVE 2022-0492 (Privilege Escalation via Cgroups v1)](#cve-2022-0492-privilege-escalation-via-cgroups-v1) |
15+
| 2022-0847 | 03/03/22 | High | Yes | [CVE-2022-0847 (Privilege Escalation via Pipes (aka Dirty Pipe))](#cve-2022-0847-privilege-escalation-via-pipes-aka-dirty-pipe) |
16+
17+
The sections below describe each of these in more detail.
18+
19+
## CVE 2022-0185 (User-Namespace Escape)
20+
21+
**Date:** 01/21/22
22+
23+
**Severity:** High
24+
25+
**Problem:**
26+
27+
[CVE 2022-0185](https://ubuntu.com/security/CVE-2022-0185) is a vulnerability
28+
in the Linux kernel which permits a "User Namespace" escape (i.e., an
29+
unprivileged user inside a user-namespace may gain root access on the host).
30+
31+
**Effect on Sysbox:**
32+
33+
This vulnerability can negate the extra isolation of containers deployed with
34+
Sysbox as they always use the Linux user-namespace.
35+
36+
**Fix:**
37+
38+
The fix has been [committed][cve-2022-0185-commit] to the Linux kernel on
39+
01/18/22 and picked up by several distros shortly after. For Ubuntu, the fix has
40+
been released and requires a [kernel update](https://ubuntu.com/security/notices/USN-5240-1).
41+
42+
We recommend you upgrade your kernel (i.e., check if your kernel distro carries
43+
the fix and if so, apply it).
44+
45+
## CVE 2022-0492 (Privilege Escalation via Cgroups v1)
46+
47+
**Date:** 02/06/22
48+
49+
**Severity:** Medium
50+
51+
**Problem:**
52+
53+
[CVE 2022-0492](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-0492) is
54+
a flaw in the Linux kernel's cgroups mechanism that under some circumstances
55+
allows the use of the cgroups v1 release_agent feature to escalate privileges.
56+
It affects containers in some cases, as described in this [excellent article](https://unit42.paloaltonetworks.com/cve-2022-0492-cgroups/)
57+
by Unit 42 at Palo Alto Networks.
58+
59+
**Effect on Sysbox:**
60+
61+
Sysbox is NOT vulnerable to the security flaw exposed by this CVE. The reason is
62+
that inside a Sysbox container the cgroups v1 release_agent can't be written
63+
to (by virtue of Sysbox setting up the container with the Linux user-namespace).
64+
Even if you create privileged containers inside a Sysbox container, they won't
65+
be vulnerable due to the Sysbox container's usage of the Linux user-namespace.
66+
67+
**Fix:**
68+
69+
[CVE-2022-0492 is fixed][cve-2022-0492-commit] on the latest Linux release.
70+
Even though this CVE does not affect Sysbox containers, it does affect regular
71+
containers under some scenarios. Therefore we recommend that you check when your
72+
Linux distro picks up the fix and apply it.
73+
74+
## CVE-2022-0847 (Privilege Escalation via Pipes (aka Dirty Pipe))
75+
76+
**Date:** 03/03/22
77+
78+
**Severity:** High
79+
80+
**Problem:**
81+
82+
A flaw in the Linux pipes mechanism allows privilege escalation. Even a process
83+
whose user-ID is "nobody" can elevate its privileges.
84+
85+
**Effect on Sysbox:**
86+
87+
This vulnerability affects containers deployed with Sysbox as it voids
88+
the protection provided by the Linux user-namespace (where processes
89+
in the container run as "nobody:nogroup" at host level).
90+
91+
**Fix:**
92+
93+
The vulnerability first appeared in Linux kernel version 5.8, which was released
94+
in 08/2020. The vulnerability was fixed on 02/21/22 via [this commit][cve-2022-0847-commit]
95+
and available in kernel versions 5.16.11, 5.15.25, and 5.10.102.
96+
97+
We recommend you check when your Linux distro picks up the fix and apply it.
98+
99+
100+
101+
102+
[cve-2022-0185-commit]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=722d94847de29310e8aa03fcbdb41fc92c521756
103+
[cve-2022-0492-commit]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=24f6008564183aa120d07c03d9289519c2fe02af
104+
[cve-2022-0847-commit]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9d2231c5d74e13b2a0546fee6737ee4446017903
105+
[slack]: https://nestybox-support.slack.com/join/shared_invite/enQtOTA0NDQwMTkzMjg2LTAxNGJjYTU2ZmJkYTZjNDMwNmM4Y2YxNzZiZGJlZDM4OTc1NGUzZDFiNTM4NzM1ZTA2NDE3NzQ1ODg1YzhmNDQ#/

docs/user-guide/security.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
This document describes security aspects of Sysbox system containers.
44

5+
See also the [security vulnerabilities & CVEs](security-cve.md) documentation
6+
for more on security.
7+
58
## Contents
69

710
- [Root Filesystem Jail](#root-filesystem-jail)

0 commit comments

Comments
 (0)