forked from cri-o/cri-o
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For containers/container-selinux#274. Signed-off-by: Kir Kolyshkin <[email protected]>
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
set -euxo pipefail | ||
|
||
cat <<EOF >local.te | ||
module local 1.0; | ||
require { | ||
type container_runtime_tmpfs_t; | ||
type container_t; | ||
class file { entrypoint execute map read }; | ||
} | ||
#============= container_t ============== | ||
allow container_t container_runtime_tmpfs_t:file entrypoint; | ||
allow container_t container_runtime_tmpfs_t:file map; | ||
allow container_t container_runtime_tmpfs_t:file { execute read }; | ||
EOF | ||
|
||
# Compile the module. | ||
checkmodule -M -m -o local.mod local.te | ||
|
||
# Create the package. | ||
semodule_package -o local.pp -m local.mod | ||
|
||
# Load the module into the kernel. | ||
sudo semodule -i local.pp |