Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restrict bootstrap container user data #1496

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/os/bootstrap-containers-tmpfiles.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
d /etc/bootstrap-containers 0750 root root -
bcressey marked this conversation as resolved.
Show resolved Hide resolved
d /local/bootstrap-containers 0700 root root -
T /local/bootstrap-containers - - - - security.selinux=system_u:object_r:state_t:s0
T /local/bootstrap-containers - - - - security.selinux=system_u:object_r:secret_t:s0
2 changes: 2 additions & 0 deletions packages/selinux-policy/fs.cil
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
; Label local state directories.
(filecon "/local/host-containers" any secret)
(filecon "/local/host-containers/.*" any secret)
(filecon "/local/bootstrap-containers" any secret)
(filecon "/local/bootstrap-containers/.*" any secret)
(filecon "/var/lib/chrony" any measure)
(filecon "/var/lib/chrony/.*" any measure)
(filecon "/var/lib/systemd" any state)
Expand Down
5 changes: 3 additions & 2 deletions packages/selinux-policy/rules.cil
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@
; ... docker's image layers
(typetransition runtime_t local_t dir "overlay2" cache_t)

; If a system process creates a directory for host container state, it
; receives the "secret_t" label.
; If a system process creates a directory for host or bootstrap container
; state, it receives the "secret_t" label.
(typetransition system_t local_t dir "host-containers" secret_t)
(typetransition system_t local_t dir "bootstrap-containers" secret_t)

; The socket for the API server gets the "api_socket_t" label.
(typetransition api_t any_t sock_file "api.sock" api_socket_t)
Expand Down