Skip to content

Commit

Permalink
Allow local login to read /run/motd
Browse files Browse the repository at this point in the history
node=localhost type=AVC msg=audit(1689384764.155:53945): avc:  denied  { getattr } for  pid=5125 comm="login" path="/run/motd" dev="tmpfs" ino=1574 scontext=system_u:system_r:local_login_t:s0 tcontext=system_u:object_r:pam_motd_runtime_t:s0 tclass=file permissive=1
node=localhost type=AVC msg=audit(1689384764.155:53946): avc:  denied  { read } for  pid=5125 comm="login" name="motd" dev="tmpfs" ino=1574 scontext=system_u:system_r:local_login_t:s0 tcontext=system_u:object_r:pam_motd_runtime_t:s0 tclass=file permissive=1
node=localhost type=AVC msg=audit(1689384764.155:53946): avc:  denied  { open } for  pid=5125 comm="login" path="/run/motd" dev="tmpfs" ino=1574 scontext=system_u:system_r:local_login_t:s0 tcontext=system_u:object_r:pam_motd_runtime_t:s0 tclass=file permissive=1

Signed-off-by: Dave Sugar <dsugar100@gmail.com>
  • Loading branch information
dsugar100 committed Jul 18, 2023
1 parent bee1bcb commit a120ea8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions policy/modules/system/authlogin.if
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,25 @@ interface(`auth_use_pam_motd_dynamic',`
files_runtime_filetrans($1, pam_motd_runtime_t, file, "motd.dynamic.new")
')

########################################
## <summary>
## Read the pam module motd with dynamic support during authentication.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`auth_read_pam_motd_dynamic',`
gen_require(`
type pam_motd_runtime_t;
')

files_search_runtime($1)
allow $1 pam_motd_runtime_t:file read_file_perms;
')

########################################
## <summary>
## Make the specified domain used for a login program.
Expand Down
1 change: 1 addition & 0 deletions policy/modules/system/locallogin.te
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ auth_manage_pam_runtime_dirs(local_login_t)
auth_manage_pam_runtime_files(local_login_t)
auth_manage_pam_console_data(local_login_t)
auth_domtrans_pam_console(local_login_t)
auth_read_pam_motd_dynamic(local_login_t)

init_dontaudit_use_fds(local_login_t)

Expand Down

0 comments on commit a120ea8

Please sign in to comment.