![Keepalived Linux Bridge Keepalived Linux Bridge](/uploads/1/2/5/4/125404817/305575269.jpg)
Keepalived is a service that can monitor servers or processes in order to implement high availability on your infrastructure. In this guide, we will use the keepalived daemon to monitor two web servers. The secondary server will take over the web traf.
PROCESS TYPESSELinux defines process types (domains) for each process running on the systemYou can see the context of a process using the -Z option to psPolicy governs the access confined processes have to files. SELinux keepalived policy is very flexible allowing users to setup theirkeepalived processes in as secure a method as possible.The following process types are defined for keepalived:keepalivedtNote: semanagepermissive -akeepalivedt can be used to make the process type keepalivedt permissive. SELinux does not deny access topermissive process types, but the AVC (SELinux denials) messages are still generated. BOOLEANSSELinux policy is customizable based on least access required. Keepalived policy is extremely flexible and has several booleans that allowyou to manipulate the policy and run keepalived with the tightest access possible.If you want to allow users to resolve user passwd entries directly from ldap rather then using a sssd server, you must turn on the authlo-ginnsswitchuseldap boolean. Disabled by default.setsebool -P authloginnsswitchuseldap 1If you want to allow all daemons to write corefiles to /, you must turn on the daemonsdumpcore boolean.
![Keepalived Linux Bridge Keepalived Linux Bridge](http://www.programmersought.com/images/803/e32961285469d826db1df4ce0b034dab.png)
Disabled by default.setsebool -P daemonsdumpcore 1If you want to enable cluster mode for daemons, you must turn on the daemonsenableclustermode boolean. Enabled by default.setsebool -P daemonsenableclustermode 1If you want to allow all daemons to use tcp wrappers, you must turn on the daemonsusetcpwrapper boolean. Disabled by default.setsebool -P daemonsusetcpwrapper 1If you want to allow all daemons the ability to read/write terminals, you must turn on the daemonsusetty boolean. Disabled by default.setsebool -P daemonsusetty 1If you want to deny any process from ptracing or debugging any other processes, you must turn on thedenyptrace boolean. Enabledbydefault.setsebool -P denyptrace 1If you want to allow all domains to use other domains file descriptors, you must turn on the domainfduse boolean.
Enabled by default.setsebool -P domainfduse 1If youwant to allow all domains to have the kernel load modules, you must turn on the domainkernelloadmodules boolean. Disabled bydefault.setsebool -P domainkernelloadmodules 1If you want to allow all domains to execute in fipsmode, you must turn on the fipsmode boolean. Enabled by default.setsebool -P fipsmode 1If you want to enable reading of urandom for all domains, you must turn on the globalssp boolean. Disabled by default.setsebool -P globalssp 1If you want to allow confined applications to run with kerberos, you must turn on the kerberosenabled boolean. Enabled by default.setsebool -P kerberosenabled 1If you want to allow system to run with NIS, you must turn on the nisenabled boolean. Disabled by default.setsebool -P nisenabled 1If you want to allow confined applications to use nscd shared memory, you must turn on the nscduseshm boolean.
Enabled by default.setsebool -P nscduseshm 1. MANAGED FILESThe SELinux process type keepalivedt can manage files labeled with the following file types.The paths listed are the default paths forthese file types. Note the processes UID still need to have DAC permissions.clusterconft/etc/cluster(/.)?clustervarlibt/var/lib/pcsd(/.)?/var/lib/cluster(/.)?/var/lib/openais(/.)?/var/lib/pengine(/.)?/var/lib/corosync(/.)?/usr/lib/heartbeat(/.)?/var/lib/heartbeat(/.)?/var/lib/pacemaker(/.)?clustervarrunt/var/run/crm(/.)?/var/run/cman./var/run/rsctmp(/.)?/var/run/aisexec./var/run/heartbeat(/.)?/var/run/cpglockd.pid/var/run/corosync.pid/var/run/rgmanager.pid/var/run/cluster/rgmanager.skkeepalivedvarrunt/var/run/keepalived.roott//initrd.
FILE CONTEXTSSELinux requires files to have an extended attribute to define the file type.You can see the context of a file using the -Z option to lsPolicy governs the access confined processes have to these files. SELinux keepalived policy is very flexible allowing users to setup theirkeepalived processes in as secure a method as possible.STANDARD FILE CONTEXTSELinuxdefines the file context types for the keepalived, if you wanted to store files with these types in a diffent paths, you need toexecute the semanage command to sepecify alternate labeling and then use restorecon to put the labels on disk.semanage fcontext -a -t keepalivedexect '/srv/keepalived/content(/.)?'