# Copyright 2018, Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. module osa-nova 1.0; require { type nova_var_lib_t; type virtd_t; type svirt_tcg_t; type virtlogd_t; class capability dac_override; class file { append create getattr open read unlink }; class dir { add_name remove_name search write }; } # NOTE(mhayden): These policies give non-KVM qemu instances the ability to use # the execmem() syscall and perform other actions. This affects deployers who # do not have native KVM capabilities on the hypervisor (such as the # OpenStack) gate jobs. #============= svirt_tcg_t ============== allow svirt_tcg_t virtd_t:dir search; allow svirt_tcg_t virtd_t:file read; allow svirt_tcg_t virtd_t:file { getattr open }; # NOTE(mhayden): This set of policies allows virtlogd (the daemon that # handles console logs for KVM instances) to take various actions under # /var/log/nova. #============= virtlogd_t ============== allow virtlogd_t nova_var_lib_t:dir { add_name remove_name search write }; allow virtlogd_t nova_var_lib_t:file { append create getattr open unlink }; allow virtlogd_t self:capability dac_override;