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

Setup sudo log file type #831

Merged
merged 1 commit into from
Nov 13, 2024
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
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)
')
Loading