Skip to content

Commit 35b7d5e

Browse files
committed
capabilities
1 parent 14be95f commit 35b7d5e

File tree

4 files changed

+63
-0
lines changed

4 files changed

+63
-0
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ Includes Linux concepts and utilities that work on Linux, not necessarily in the
334334
1. [anacron](anacron)
335335
1. [logrotate](logrotate.md)
336336
1. [xargs](xargs.md)
337+
1. Security
338+
1. [SELinux](selinux.md)
339+
1. [Capabilities](capabilities.md)
337340
1. [Bibliography](bibliography.md)
338341

339342
## WIP

capabilities.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Capabilities
2+
3+
man capabilities
4+
5+
Splits sudo into multiple permissions, similar to Android app permissions. TODO what system do Android app permissions use?
6+
7+
Implemented on the Linux kernel, and modified with the `capset` and `capget` system calls.
8+
9+
CLI programs are confusingly named `setcap` and `getcap`.
10+
11+
`CAP_SYS_ADMIN` grants all capabilities, and is equivalent to the old root.
12+
13+
`setcap` and `getcap` work on executables, e.g.:
14+
15+
sudo setcap cap_sys_admin+ep virt_to_phys_user.out
16+
17+
now allows `virt_to_phys_user.out` to access `/proc/<pid>/pagemap`.
18+
19+
It can be retrieved with:
20+
21+
getcap virt_to_phys_user.out

qemu.md

+2
Original file line numberDiff line numberDiff line change
@@ -614,3 +614,5 @@ Then the heart of execution is:
614614
- `hw/i386/`: x86 machines, notably the huge `pc.c`
615615
- `hw/arm/`: ARM machines, e.g. `versatilepb.c`
616616
- `-device` devices. Most directories.
617+
618+
IRQ: final point seems to be: `arm_cpu_set_irq`

selinux.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# SELinux
2+
3+
TODO.
4+
5+
Superset of capabilities: <https://lwn.net/Articles/79553/>
6+
7+
<https://en.wikipedia.org/wiki/Security-Enhanced_Linux>
8+
9+
sudo apt-get install attr setools selinux-utils
10+
11+
man capabilities
12+
13+
Disabled by default on Ubuntu: <https://askubuntu.com/questions/481293/selinux-implementation-in-ubuntu>
14+
15+
## sesearch
16+
17+
TODO.
18+
19+
## getenforce
20+
21+
## setenforce
22+
23+
Check if enabled:
24+
25+
getenforce
26+
27+
Enable:
28+
29+
sudo setenforce 1
30+
31+
TODO: goes through which kernel interface?
32+
33+
## getcap
34+
35+
## getfattr
36+
37+
TODO.

0 commit comments

Comments
 (0)