You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux kernel 5.13 adds support for Landlock Linux Security Module (LSM).
This allows unprivileged processes to create safe security sandboxes
that can securely restrict the ambient rights (e.g. global filesystem
access) for themselves.
#1110
Co-authored-by: Zheao Li <me@manjusaka.me>
Signed-off-by: Kailun Qin <kailun.qin@intel.com>
Copy file name to clipboardExpand all lines: config.md
+121-1Lines changed: 121 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -340,6 +340,52 @@ For Linux-based systems, the `process` object supports the following process-spe
340
340
341
341
***`class`** (string, REQUIRED) specifies the I/O scheduling class. Possible values are `IOPRIO_CLASS_RT`, `IOPRIO_CLASS_BE`, and `IOPRIO_CLASS_IDLE`.
342
342
***`priority`** (int, REQUIRED) specifies the priority level within the class. The value should be an integer ranging from 0 (highest) to 7 (lowest).
343
+
***`landlock`** (object, OPTIONAL) specifies the Landlock unprivileged access control settings for the container process.
344
+
Note that `noNewPrivileges` must be set to true to use this feature.
345
+
For more information about Landlock, see [Landlock documentation][landlock].
346
+
`landlock` contains the following properties:
347
+
348
+
***`ruleset`** (object, OPTIONAL) the `ruleset` field identifies a set of rules (i.e., actions on objects) that need to be handled (i.e., restricted).
349
+
The `ruleset` currently contains the following types:
350
+
* **`handledAccessFS`** (array of strings, OPTIONAL) is an array of FS typed actions that are handled by a ruleset.
351
+
If no rule explicitly allow them, they should then be forbidden.
352
+
* **`handledAssessNetwork`** (array of strings, OPTIONAL) is an array of NETWORK typed actions that are handled by a ruleset. (The NETWORK typed actions are avaliable when the ABI version >= 4. the behavior of the NETWORK typed actions is not used when the ABI version is less than 4 will depend on the **`disableBestEffort`**)
353
+
***`rules`** (object, OPTIONAL) the `rules` field specifies the security policies (i.e., actions allowed on objects) to be added to an existing ruleset.
354
+
The `rules` currently contains the following types:
355
+
* **`pathBeneath`** (array of objects, OPTIONAL) is an array of the file-hierarchy typed rules.
356
+
Entries in the array contain the following properties:
357
+
* **`allowedAccess`** (array of strings, OPTIONAL) is an array of FS typed actions that are allowed by a rule. The actions are grouped by the ABI version in the following description:
358
+
1. ABI version >= 1:
359
+
1. exectute
360
+
2. write_file
361
+
3. read_file
362
+
4. read_dir
363
+
5. remove_dir
364
+
6. remove_file
365
+
7. make_char
366
+
8. make_dir
367
+
9. make_reg
368
+
10. make_sock
369
+
11. make_fifo
370
+
12. make_block
371
+
13. make_sym
372
+
2. ABI version >= 2:
373
+
1. refer
374
+
3. ABI version >= 3:
375
+
1. truncate
376
+
* **`paths`** (array of strings, OPTIONAL) is an array of files or parent directories of the file hierarchies to restrict.
377
+
* **`portBeneath`** (array of objects, OPTIONAL) is an array of the network-hierarchy typed rules.
378
+
Entries in the array contain the following properties:
379
+
* **`allowedAccess`** (array of strings, OPTIONAL) is an array of NETWORK typed actions that are allowed by a rule. The actions are grouped by the ABI version in the following description:
380
+
1. ABI version >= 4:
381
+
1. bind
382
+
2. connect
383
+
* **`ports`** (array of strings, OPTIONAL) is an array of network ports to restrict.
384
+
***`disableBestEffort`** (bool, OPTIONAL) the `disableBestEffort` field disables the best-effort security approach for Landlock access rights.
385
+
This is for conditions when the Landlock access rights explicitly configured by the container are not supported or available in the running kernel.
386
+
If the best-effort security approach is enabled (`false`), the runtime SHOULD enforce the strongest rules configured up to the current kernel support, and only be [logged as a warning](runtime.md#warnings) for those not supported.
387
+
If disabled (`true`), the runtime MUST [generate an error](runtime.md#errors) if one or more rules specified by the container is not supported.
388
+
Default is `false`, i.e., following a best-effort security approach.
343
389
344
390
### <aname="configUser" />User
345
391
@@ -385,6 +431,79 @@ _Note: symbolic name for uid and gid, such as uname and gname respectively, are
385
431
"class": "IOPRIO_CLASS_IDLE",
386
432
"priority": 4
387
433
},
434
+
"landlock": {
435
+
"ruleset": {
436
+
"handledAccessFS": [
437
+
"execute",
438
+
"write_file",
439
+
"read_file",
440
+
"read_dir",
441
+
"remove_dir",
442
+
"remove_file",
443
+
"make_char",
444
+
"make_dir",
445
+
"make_reg",
446
+
"make_sock",
447
+
"make_fifo",
448
+
"make_block",
449
+
"make_sym",
450
+
"refer",
451
+
"truncate"
452
+
],
453
+
"handledAssessNetwork": [
454
+
"bind",
455
+
"connect"
456
+
]
457
+
},
458
+
"rules": {
459
+
"pathBeneath": [
460
+
{
461
+
"allowedAccess": [
462
+
"execute",
463
+
"read_file",
464
+
"read_dir"
465
+
],
466
+
"paths": [
467
+
"/usr",
468
+
"/bin"
469
+
]
470
+
},
471
+
{
472
+
"allowedAccess": [
473
+
"execute",
474
+
"write_file",
475
+
"read_file",
476
+
"read_dir",
477
+
"remove_dir",
478
+
"remove_file",
479
+
"make_char",
480
+
"make_dir",
481
+
"make_reg",
482
+
"make_sock",
483
+
"make_fifo",
484
+
"make_block",
485
+
"make_sym"
486
+
],
487
+
"paths": [
488
+
"/tmp"
489
+
]
490
+
}
491
+
],
492
+
"portBeneath": [
493
+
{
494
+
"allowedAccess": [
495
+
"bind",
496
+
"connect"
497
+
],
498
+
"ports": [
499
+
80,
500
+
443
501
+
]
502
+
}
503
+
]
504
+
},
505
+
"disableBestEffort": false
506
+
},
388
507
"noNewPrivileges": true,
389
508
"capabilities": {
390
509
"bounding": [
@@ -1135,7 +1254,8 @@ Here is a full example `config.json` for reference.
0 commit comments