-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change adds new BPF programs which restrict the filesystem access (open) inside containers based on configurable allow and deny BPF maps. Allow/deny lists of directories are available in the usespace in lockc configuration. Fixes: #48 Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
- Loading branch information
1 parent
1ca0aef
commit 3ee31d4
Showing
9 changed files
with
679 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
## File access | ||
|
||
lockc comes with policies about file access which is based on allow- and | ||
deny-listing. **Baseline** and **restricted** policies have their own pairs of | ||
lists. All those lists should contain path prefixes. All the children of listed | ||
paths/directories are included, since the decision is made by prefix matching. | ||
|
||
The deny list has precedence over allow list. That's because main purpose of | ||
the deny list is specifying exceptions whose prefixes are specified in the | ||
allow list, but we don't want to allow them. | ||
|
||
To sum it up, when any process in the container tries to access a file, lockc: | ||
|
||
1. Checks whether the given path's prefix is in the deny list. If yes, denies | ||
the access. | ||
2. Checks whether the given path's prefix is in the allow list. If yes, allows | ||
the access. | ||
3. In case of no matches, denies the access. | ||
|
||
By default, the contents of lists are: | ||
|
||
* **baseline** | ||
* allow list | ||
* */bin* | ||
* */dev/console* | ||
* */dev/full* | ||
* */dev/null* | ||
* */dev/pts* | ||
* */dev/tty* | ||
* */dev/urandom* | ||
* */dev/zero* | ||
* */etc* | ||
* */home* | ||
* */lib* | ||
* */proc* | ||
* */sys/fs/cgroup* | ||
* */tmp* | ||
* */usr* | ||
* */var* | ||
* deny list | ||
* */proc/acpi* | ||
* **restricted** | ||
* allow list | ||
* */bin* | ||
* */dev/console* | ||
* */dev/full* | ||
* */dev/null* | ||
* */dev/pts* | ||
* */dev/tty* | ||
* */dev/urandom* | ||
* */dev/zero* | ||
* */etc* | ||
* */home* | ||
* */lib* | ||
* */proc* | ||
* */sys/fs/cgroup* | ||
* */tmp* | ||
* */usr* | ||
* */var* | ||
* deny list | ||
* */proc/acpi* | ||
* */proc/sys* |
Oops, something went wrong.