revise MCS constraints to use only MCS-specific attributes.
This commit is contained in:
parent
4be8dd10b9
commit
808341bb9b
25
policy/mcs
25
policy/mcs
@ -64,24 +64,27 @@ gen_levels(1,mcs_num_cats)
|
|||||||
# the high range of the file. We use the high range of the process so
|
# the high range of the file. We use the high range of the process so
|
||||||
# that processes can always simply run at s0.
|
# that processes can always simply run at s0.
|
||||||
#
|
#
|
||||||
# Note that getattr on files is always permitted.
|
# Note:
|
||||||
#
|
# - getattr on dirs/files is not constrained.
|
||||||
mlsconstrain file { write setattr append unlink link rename ioctl lock execute relabelfrom }
|
# - /proc/pid operations are not constrained.
|
||||||
( h1 dom h2 );
|
|
||||||
|
|
||||||
mlsconstrain dir { create getattr setattr read write link unlink rename search add_name remove_name reparent rmdir lock ioctl }
|
mlsconstrain file { read ioctl lock execute execute_no_trans }
|
||||||
(( h1 dom h2 ) or ( t2 == domain ) or ( t1 == mlsfileread ));
|
(( h1 dom h2 ) or ( t1 == mcsreadall ) or ( t2 == domain ));
|
||||||
|
|
||||||
|
mlsconstrain file { write setattr append unlink link rename }
|
||||||
|
(( h1 dom h2 ) or ( t1 == mcswriteall ) or ( t2 == domain ));
|
||||||
|
|
||||||
|
mlsconstrain dir { search read ioctl lock }
|
||||||
|
(( h1 dom h2 ) or ( t1 == mcsreadall ) or ( t2 == domain ));
|
||||||
|
|
||||||
|
mlsconstrain dir { write setattr append unlink link rename add_name remove_name }
|
||||||
|
(( h1 dom h2 ) or ( t1 == mcswriteall ) or ( t2 == domain ));
|
||||||
|
|
||||||
# New filesystem object labels must be dominated by the relabeling subject
|
# New filesystem object labels must be dominated by the relabeling subject
|
||||||
# clearance, also the objects are single-level.
|
# clearance, also the objects are single-level.
|
||||||
mlsconstrain file { create relabelto }
|
mlsconstrain file { create relabelto }
|
||||||
(( h1 dom h2 ) and ( l2 eq h2 ));
|
(( h1 dom h2 ) and ( l2 eq h2 ));
|
||||||
|
|
||||||
# At this time we do not restrict "ps" type operations via MCS. This
|
|
||||||
# will probably change in future.
|
|
||||||
mlsconstrain file { read }
|
|
||||||
(( h1 dom h2 ) or ( t2 == domain ) or ( t1 == mlsfileread ));
|
|
||||||
|
|
||||||
# new file labels must be dominated by the relabeling subject clearance
|
# new file labels must be dominated by the relabeling subject clearance
|
||||||
mlsconstrain { dir lnk_file chr_file blk_file sock_file fifo_file } { relabelfrom }
|
mlsconstrain { dir lnk_file chr_file blk_file sock_file fifo_file } { relabelfrom }
|
||||||
( h1 dom h2 );
|
( h1 dom h2 );
|
||||||
|
@ -3,6 +3,46 @@
|
|||||||
## Contains attributes used in MCS policy.
|
## Contains attributes used in MCS policy.
|
||||||
## </required>
|
## </required>
|
||||||
|
|
||||||
|
########################################
|
||||||
|
## <summary>
|
||||||
|
## This domain is allowed to read files and directories
|
||||||
|
## regardless of their MCS category set.
|
||||||
|
## </summary>
|
||||||
|
## <param name="domain">
|
||||||
|
## <summary>
|
||||||
|
## Domain target for user exemption.
|
||||||
|
## </summary>
|
||||||
|
## </param>
|
||||||
|
## <rolecap/>
|
||||||
|
#
|
||||||
|
interface(`mcs_file_read_all',`
|
||||||
|
gen_require(`
|
||||||
|
attribute mcsreadall;
|
||||||
|
')
|
||||||
|
|
||||||
|
typeattribute $1 mcsreadall;
|
||||||
|
')
|
||||||
|
|
||||||
|
########################################
|
||||||
|
## <summary>
|
||||||
|
## This domain is allowed to write files and directories
|
||||||
|
## regardless of their MCS category set.
|
||||||
|
## </summary>
|
||||||
|
## <param name="domain">
|
||||||
|
## <summary>
|
||||||
|
## Domain target for user exemption.
|
||||||
|
## </summary>
|
||||||
|
## </param>
|
||||||
|
## <rolecap/>
|
||||||
|
#
|
||||||
|
interface(`mcs_file_write_all',`
|
||||||
|
gen_require(`
|
||||||
|
attribute mcswriteall;
|
||||||
|
')
|
||||||
|
|
||||||
|
typeattribute $1 mcswriteall;
|
||||||
|
')
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
## <summary>
|
## <summary>
|
||||||
## This domain is allowed to sigkill and sigstop
|
## This domain is allowed to sigkill and sigstop
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
policy_module(mcs, 1.1.0)
|
policy_module(mcs, 1.1.1)
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
#
|
#
|
||||||
@ -9,3 +9,5 @@ policy_module(mcs, 1.1.0)
|
|||||||
attribute mcskillall;
|
attribute mcskillall;
|
||||||
attribute mcsptraceall;
|
attribute mcsptraceall;
|
||||||
attribute mcssetcats;
|
attribute mcssetcats;
|
||||||
|
attribute mcswriteall;
|
||||||
|
attribute mcsreadall;
|
||||||
|
Loading…
Reference in New Issue
Block a user