SELinux Script python reference¶
LMI SELinux Provider client library.
- lmi.scripts.selinux.get_file_label(ns, target)[source]¶
Get label of an SELinux file.
Parameters: target – An SELinux file.
- lmi.scripts.selinux.get_service(ns)[source]¶
Get instance of SELinux service.
Return type: LMIInstance/LMI_SELinuxService
- lmi.scripts.selinux.list_elements(ns, kind)[source]¶
List SELinux elements (booleans and ports).
Parameters: kind – Elements to be listed.
- lmi.scripts.selinux.restore(ns, target, action, recursively)[source]¶
Restore default SELinux security contexts on files.
Parameters: - target – SELinux file to change.
- action – Action to take on mislabeled files.
- recursively – Restore labels recursively in case Target is a directory.
- lmi.scripts.selinux.set_boolean(ns, target, value, default)[source]¶
Set a new value of an SELinux boolean.
Parameters: - target – An SELinux boolean to change.
- value – New value.
- default (bool) – If True, makes the new state persistent.
- lmi.scripts.selinux.set_file_label(ns, target, label)[source]¶
Set label on an SELinux file.
Parameters: - target – An SELinux file to change.
- label – New label.