Skip to content

Commit

Permalink
Merge pull request #831 from dsugar100/main
Browse files Browse the repository at this point in the history
Setup sudo log file type
  • Loading branch information
pebenito authored Nov 13, 2024
2 parents 7718b32 + bff76ff commit cc6ce5d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions policy/modules/admin/sudo.if
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ template(`sudo_role_template',`

gen_require(`
type sudo_exec_t;
type sudo_log_t;
attribute sudodomain;
')

Expand Down Expand Up @@ -74,6 +75,10 @@ template(`sudo_role_template',`
allow $1_sudo_t self:key manage_key_perms;
dontaudit $1_sudo_t self:capability { dac_read_search sys_ptrace };

allow $1_sudo_t sudo_log_t:dir add_entry_dir_perms;
allow $1_sudo_t sudo_log_t:file { append_file_perms create_file_perms };
logging_log_filetrans($1_sudo_t, sudo_log_t, file)

# allow getting the process group of the parent process
allow $1_sudo_t $2:process getpgid;
allow $1_sudo_t $2:unix_stream_socket rw_socket_perms;
Expand Down
3 changes: 3 additions & 0 deletions policy/modules/admin/sudo.te
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ attribute sudodomain;
type sudo_exec_t;
application_executable_file(sudo_exec_t)

type sudo_log_t;
logging_log_file(sudo_log_t)

tunable_policy(`sudo_all_tcp_connect_http_port',`
corenet_tcp_connect_http_port(sudodomain)
')

0 comments on commit cc6ce5d

Please sign in to comment.