Skip to content
Merged
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
19 changes: 19 additions & 0 deletions container.if
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,25 @@ interface(`container_read_state',`
ps_process_pattern($1, container_runtime_t)
')

########################################
## <summary>
## Write to /proc/PID of container runtime.
## This is needed e.g. to set uid_map or gid_map
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`container_write_proc_files',`
gen_require(`
type container_runtime_t;
')

allow $1 container_runtime_t:file { open write };
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the description seems to imply that this account-utils needs to run inside the container, but I'd xpect container_runtime_t to be used by an oci runtime tosetup for the container. can you explain the case a bit more to make sure we're targeting the right type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, account-utils runs outside of the containers on the host and newidmapd is used to write to the /proc/<pid_of_container_runtime>/uid_map of the container runtime on the host for UID mapping between host and containers. and the /proc of the container runtime is labelled as container_runtime_t

see: https://www.thkukuk.de/blog/no_new_privs/

')

########################################
## <summary>
## Search container lib directories.
Expand Down