> > +## Allow all daemons to write corefiles to /
> > +##
> > +##
> > +gen_tunable(allow_daemons_dump_core, false)
>
> I'd prefer to have new tunables to be prefixed with the module name, so
> init_daemons_dump_core, etc.
OK
> > # slapd needs to read cert files from its initscript
> >
> > -miscfiles_read_generic_certs(initrc_t)
> > +miscfiles_manage_generic_cert_files(initrc_t)
> > +
> > +optional_policy(`
> > + init_get_system_status(initrc_t)
> > +')
>
> Making this optional should have no effect as all the types are in the
> same module.
ok
> The below should have a new section header for "Rules applied to all
> daemons." and also moving the initrc_t stuff up with the other initrc_t
> rules.
OK.
> However, I'm also very concerned about how many rules are a being
> blanketed onto all daemons. It seems extremely excessive.
Well there's not much change really and the biggest change is one that
defaults to off.
> > +optional_policy(`
> > + unconfined_dontaudit_rw_pipes(daemon)
> > + unconfined_dontaudit_rw_stream(daemon)
> > + userdom_dontaudit_read_user_tmp_files(daemon)
> > + userdom_dontaudit_write_user_tmp_files(daemon)
> > +')
>
> This looks like it should be split up into separate optionals
ok
> There is already an init_systemd block for these to be put in.
>
> > +ifdef(`init_systemd',`
> > + allow init_t self:system { status reboot halt reload };
> > +
> > + allow init_t self:unix_dgram_socket { create_socket_perms sendto };
OK.
> > +ifdef(`init_systemd', `
> > + dev_read_kmsg(syslogd_t)
> > + dev_write_kmsg(syslogd_t)
> > + allow syslogd_t self:capability sys_ptrace;
>
> These should be moved down into the existing init_systemd
ok
> > ########################################
> > #
> > # Auditctl local policy
> >
> > @@ -230,6 +250,9 @@ optional_policy(`
> >
> > udev_read_db(auditd_t)
> >
> > ')
> >
> > +# for systemd but can not be conditional
> > +filetrans_pattern(syslogd_t, var_run_t, syslogd_tmp_t, dir, "log")
>
> Neeeds to use interfaces and move down with the syslogd_t->syslogd_tmp_t
> rules.
ok
> > +## Append to all log files.
> > +##
> > +##
> > +##
> > +## Domain allowed access.
> > +##
> > +##
> > +#
> > +interface(`logging_inherit_append_all_logs',`
>
> logging_append_all_inherited_logs()
ok
> > +
> > +########################################
> > +##
> > +## Read and write a lvm unnamed pipe.
> > +##
> > +##
> > +##
> > +## Domain allowed access.
> > +##
> > +##
> > +#
> > +interface(`lvm_rw_pipes',`
> > + gen_require(`
> > + type lvm_var_run_t;
> > + ')
> > +
> > + allow $1 lvm_var_run_t:fifo_file rw_inherited_fifo_file_perms;
> > +')
>
> lvm_rw_inherited_runtime_pipes()
ok
> > +interface(`files_manage_root_files',`
> > + gen_require(`
> > + type root_t;
> > + ')
> > +
> > + manage_files_pattern($1, root_t, root_t)
> > +')
>
> I'm wondering if it makes sense to have a new type, so root_t can stay
> for / only.
I've deleted it from my policy.
The kernel has had the ability to support dumping core in other directories
for a long time. So you could create a mode 1733 directory somewhere to store
core files. Also systemd now manages them.
I was dubious about this policy all along and have now decided that it's
generally a bad idea. It just makes audit2allow prompt users to allowing this
whenever a daemon tries to do something inappropriate.
> > --- refpolicy-2.20170220.orig/policy/modules/system/systemd.if
> > +++ refpolicy-2.20170220/policy/modules/system/systemd.if
> > @@ -35,7 +35,8 @@ interface(`systemd_read_logind_pids',`
> >
> > ')
> >
> > files_search_pids($1)
> >
> > - read_files_pattern($1, systemd_logind_var_run_t,
> > systemd_logind_var_run_t) + allow $1 systemd_logind_var_run_t:dir
> > list_dir_perms;
> > + allow $1 systemd_logind_var_run_t:file read_file_perms;
>
> This second rule is redundant.
Not when you remove the read_files_pattern line.
> > +#######################################
> > +##
> > +## Allow systemd_tmpfiles_t to manage filesystem objects
> > +##
> > +##
> > +##
> > +## type of object to manage
> > +##
> > +##
> > +##
> > +##
> > +## object class to manage
> > +##
> > +##
> > +#
> > +interface(`systemd_tmpfiles_manage_object',`
>
> systemd_tmpfilesd_managed()
ok
> > +## allow systemd_passwd_agent to inherit fds
> > +##
> > +##
> > +##
> > +## Domain that owns the fds
> > +##
> > +##
> > +#
> > +interface(`systemd_passwd_agent_inherits_fd',`
>
> systemd_use_passwd_agent_fds
ok
> > +########################################
> > +##
> > +## Transition to systemd named content
> > +## need a better name for this
> > +##
> > +##
> > +##
> > +## Domain allowed access.
> > +##
> > +##
> > +#
> > +interface(`systemd_filetrans_named_content',`
>
> I'm struggling on the naming for this too, though I don't think
> named_content fits, but something like systemd_passd_pid_dirs or
> systemd_passwd_runtime_dirs
I've changed it to the latter.
> > +########################################
> > +##
> > +## manage systemd unit dirs and the files in them
> > +##
> > +##
> > +##
> > +## Domain allowed access.
> > +##
> > +##
> > +#
> > +interface(`systemd_manage_unit_dirs_files',`
>
> systemd_manage_all_units
ok
> > +########################################
> > +##
> > +## Do not audit attempts to read and write
> > +## unconfined domain stream.
> > +##
> > +##
> > +##
> > +## Domain to not audit.
> > +##
> > +##
> > +#
> > +interface(`unconfined_dontaudit_rw_stream',`
>
> unconfined_dontaudit_rw_stream_sockets()
ok
I'll send you a new patch shortly.
--
My Main Blog http://etbe.coker.com.au/
My Documents Blog http://doc.coker.com.au/