libselinux is a free and open source library software designed as part of the NSA's Security-Enhanced Linux software, also known as SELinux, for Linux kernel-based operating systems.
What is SELinux?
SELinux (also known as SELinux Policy Editor) is an open source software project, a module for the Linux kernel, providing various security functions and a mechanism for supporting several access control security policies, including the MAC (Mandatory Access Controls) or the United States Department of Defense.
The userland utilities and libraries provided in the SELinux (Security Enhanced Linux) project offer a wide range of capabilities, including policy compilation, policy management, policy development, SELinux services, SELinux utilities.
It is part of the SELinux services component
libselinux is part of the "SELinux services" component, designed to be used for applications that must be aware of SELinux. It can also be used to enforce access control decisions using SELinux, such as Dbus.
Besides the libselinux library reviewed here, several other utilities and libraries are part of the SELinux project, including checkpolicy, libsemanage, libsepol, policycoreutils, as well as sepolgen.
Getting started with libselinux
End users don’t need the libselinux library, but some developers who want to integrate SELinux functionality in their programs, might find it useful. To install the libselinux library software on your GNU/Linux operating system, simply download the latest stable release from Softpedia.
Save the archive somewhere on your computer, preferably your Home directory, uncompress it using your favorite archive manager utility, open a terminal emulator application and go to the location where you’ve extracted the archive file (e.g. cd /home/softpedia/libselinux-2.3).
Run the ‘make’ command to compile the library. After a successful compilation process, run either of the ‘sudo make install’ or ‘make install’ commands (depending if you’re a user with privileges or root) to install the libselinux library system wide.