Cookbooks
selinux
documentation
Selinux User

Back to resource list

selinux_user

The selinux_user resource is used to manage SELinux users on the system.

Actions

ActionDescription
:manage(Default) Sets the SELinux user to the desired settings regardless of previous state.
:addCreates the SELinux user if not created.(-a)
:modifyUpdates the SELinux user if previously created.(-m)
:deleteRemoves the SELinux user if previously created. (-d)

Properties

NameTypeDefaultDescription
userStringResource nameThe SELinux user.
levelStringMLS/MCS security level for the user.
rangeStringMLS/MCS security range for the user.
rolesArraySELinux roles for the user (required for creation).

Examples

# Manage myuser_u SELinux user with a level and range of s0 and roles sysadm_r and staff_r
selinux_user 'myuser_u' do
  level 's0'
  range 's0'
  roles %w(sysadm_r staff_r)
end
 
# Manage myuser_u SELinux user using the default system level and range and roles sysadm_r and staff_r
selinux_user 'myuser_u' do
  roles %w(sysadm_r staff_r)
end