Cookbooks
selinux
documentation
Selinux Login

Back to resource list

selinux_login

The selinux_login resource is used to manage Linux user to SELinux user mappings on the system.

Actions

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

Properties

NameTypeDefaultDescription
loginStringResource nameThe OS user login.
userStringThe SELinux user.
rangeStringMLS/MCS security range for the user.

Examples

# Manage myuser OS user mapping with a range of s0 and associated SELinux user myuser_u
selinux_login 'myuser' do
  user 'myuser_u'
  range 's0'
end
 
# Manage myuser OS user mapping using the default system range and associated SELinux user myuser_u
selinux_login 'myuser' do
  user 'myuser_u'
end