Skip to content

Commit

Permalink
Merge pull request SELinuxProject#807 from dsugar100/main
Browse files Browse the repository at this point in the history
Additional permissions when fapolicyd.conf more strict
  • Loading branch information
pebenito authored Sep 13, 2024
2 parents 351a5a7 + 70b06f1 commit a0f8bd4
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
4 changes: 3 additions & 1 deletion policy/modules/admin/fapolicyd.te
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,16 @@ kernel_read_kernel_sysctls(fapolicyd_t)

domain_read_all_domains_state(fapolicyd_t)

files_read_all_files(fapolicyd_t)
files_mmap_read_all_files(fapolicyd_t)
files_read_all_symlinks(fapolicyd_t)
files_runtime_filetrans(fapolicyd_t, fapolicyd_runtime_t, { file fifo_file })
files_map_usr_files(fapolicyd_t)
files_watch_all_mountpoints(fapolicyd_t)
files_watch_all_mount_perm(fapolicyd_t)
files_watch_all_mount_sb(fapolicyd_t)

fs_getattr_xattr_fs(fapolicyd_t)
fs_watch_all_fs(fapolicyd_t)

logging_log_filetrans(fapolicyd_t, fapolicyd_log_t, file)
logging_send_syslog_msg(fapolicyd_t)
Expand Down
42 changes: 42 additions & 0 deletions policy/modules/kernel/files.if
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,30 @@ interface(`files_read_all_files',`
')
')

########################################
## <summary>
## Read and memory map all files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`files_mmap_read_all_files',`
gen_require(`
attribute file_type;
')

allow $1 file_type:dir list_dir_perms;
mmap_read_files_pattern($1, file_type, file_type)

optional_policy(`
auth_read_shadow($1)
auth_map_shadow($1)
')
')

########################################
## <summary>
## Allow shared library text relocations in all files.
Expand Down Expand Up @@ -1950,6 +1974,24 @@ interface(`files_watch_all_mount_perm',`
allow $1 mountpoint:dir watch_with_perm;
')

########################################
## <summary>
## Watch all mount superblock changes
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`files_watch_all_mount_sb',`
gen_require(`
attribute mountpoint;
')

allow $1 mountpoint:dir watch_sb;
')

########################################
## <summary>
## Check if all mountpoints are writable.
Expand Down
19 changes: 19 additions & 0 deletions policy/modules/kernel/filesystem.if
Original file line number Diff line number Diff line change
Expand Up @@ -6674,6 +6674,25 @@ interface(`fs_relabelfrom_all_fs',`
allow $1 filesystem_type:filesystem relabelfrom;
')

########################################
## <summary>
## Watch all filesystems.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`fs_watch_all_fs',`
gen_require(`
attribute filesystem_type;
')

allow $1 filesystem_type:filesystem watch;
')

########################################
## <summary>
## Get the attributes of all directories
Expand Down

0 comments on commit a0f8bd4

Please sign in to comment.