# First rule - delete all -D # Increase the buffers to survive stress events. # Make this bigger for busy systems -b 8192 ##### ### Don't audit rules - explicit exclusios for more generic rules after # Don't audit Qemu read/writes to necessary devices -a exit,never -F path=/dev/kvm -F perm=rw -F subj_type=qemu_t -a exit,never -F path=/dev/ksm -F perm=rw -F subj_type=qemu_t -a exit,never -F path=/dev/ptmx -F perm=rw -F subj_type=qemu_t -a exit,never -F dir=/dev/pts -F perm=rw -F subj_type=qemu_t # Don't audit dnsmasq writing to libvirt network runtime data -a exit,never -F dir=/var/run/libvirt/network -F perm=wa -F subj_type=dnsmasq_t # Don't audit logrotate writing to logs -a exit,never -F dir=/var/log/libvirt/ -F perm=wa -F subj_type=logrotate_t # Don't audit initrc_t domain writing to temporary storage data -a exit,never -F dir=/var/cache/libvirt/ -F perm=wa -F subj_type=initrc_t ##### ### Audit access attempts to TLS private keys -a exit,always -F path=/etc/pki/libvirt/private/serverkey.pem -F subj_type!=virtd_t -k virt_tls_privkey -a exit,always -F path=/etc/pki/libvirt-vnc/server-key.pem -F subj_type!=qemu_t -k virt_tls_privkey ##### ### Audit attempts at changing libvirt and Qemu certificates (both server and CA) -a exit,always -F path=/etc/pki/CA/cacert.pem -F perm=wa -k virt_tls_cert -a exit,always -F path=/etc/pki/libvirt/servercert.pem -F perm=wa -k virt_tls_cert -a exit,always -F path=/etc/pki/libvirt-vnc/ca-cert.pem -F perm=wa -k virt_tls_cert -a exit,always -F path=/etc/pki/libvirt-vnc/server-cert.pem -F perm=wa -k virt_tls_cert ###### ### Audit any changes to libvirt configuration -a exit,always -F dir=/etc/libvirt/ -F perm=wa -k virt_libvirt_cfg -a exit,always -F path=/etc/sysconfig/libvirtd -F perm=wa -k virt_libvirt_cfg -a exit,always -F path=/etc/sasl2/libvirt.conf -F perm=wa -k virt_libvirt_cfg ###### ### Audit every attempt of qemu_t interaction with another domain, unless not ### explicitly excluded above -a exit,always -F arch=b32 -S all -F perm=wax -F subj_type=qemu_t -F obj_type!=qemu_t -k virt_qemu_crossdomain -a exit,always -F arch=b64 -S all -F perm=wax -F subj_type=qemu_t -F obj_type!=qemu_t -k virt_qemu_crossdomain ###### ### Audit changes to virtual images from outside qemu_t domain -a exit,always -F dir=/var/lib/libvirt/images/ -F perm=wa -F subj_type!=qemu_t -k virt_image_change -a exit,always -F obj_type=virt_image_t -F perm=wa -F subj_type!=qemu_t -k virt_image_change ###### ### Audit changes to qemu/libvirt runtime data (exceptions above) -a exit,always -F dir=/var/run/libvirt/ -F perm=wa -F subj_type!=virtd_t -k virt_runtime_change -a exit,always -F dir=/var/lib/libvirt/ -F perm=wa -F subj_type!=virtd_t -k virt_runtime_change -a exit,always -F dir=/var/cache/libvirt/ -F perm=wa -F subj_type!=qemu_t -k virt_runtime_change ###### ### Audit changes to qemu/libvirt logs (exceptions above) -a exit,always -F dir=/var/log/libvirt/ -F perm=wa -F subj_type!=virtd_t -k virt_log_change ###### ### Audit every libvirtd execution -a exit,always -F path=/usr/sbin/libvirtd -F perm=x -k virt_libvirtd_exec ###### ### Audit every libvirtd executable change -a exit,always -F path=/usr/sbin/libvirtd -F perm=wa -k virt_libvirtd_change ###### ### Audit every Qemu execution -a exit,always -F path=/usr/libexec/qemu-kvm -F perm=x -k virt_qemu_exec ###### ### Audit every Qemu executable change -a exit,always -F path=/usr/libexec/qemu-kvm -F perm=wa -k virt_qemu_change