Selinux Facts

selinux.FileContext

host.get_fact(FileContext, path)

rns structured SELinux file context data for a specified file None` if the file does not exist.

ode:: python

{

“user”: “system_u”, “role”: “object_r”, “type”: “default_t”, “level”: “s0”,

}

selinux.FileContextMapping

host.get_fact(FileContextMapping, target)

rns structured SELinux file context data for the specified target path prefix g the same format as selinux.FileContext. here is no mapping, it returns {} : This fact requires root privileges.

selinux.SEBoolean

host.get_fact(SEBoolean, boolean)

rns the status of a SELinux Boolean as a string (on or off). boolean` does not exist, SEBoolean returns the empty string.

selinux.SEPort

host.get_fact(SEPort, protocol, port)

rns the SELinux ‘type’ for the specified protocol (tcp|udp|dccp|sctp) and port number. o type has been set, SEPort returns the empty string. : policycoreutils-dev must be installed for this to work.

selinux.SEPorts

host.get_fact(SEPorts, )

rns the SELinux ‘type’ definitions for (tcp|udp|dccp|sctp) ports. : This fact requires root privileges.

ode:: python

{

“tcp”: { 22: “ssh_port_t”, …}, “udp”: { …}

}