How to set SELinux boolean using custom policy?

us flag

I know that SElinux booleans can be set via setsebool like this:

setsebool -P virt_qemu_ga_read_nonsecurity_files 1

But I want to set this boolean virt_qemu_ga_read_nonsecurity_files using custom SELinux policy.

Is it even possible? How can I do this?

bq flag

A SELinux boolean is a switch to dynamically enable/disable a set of policies at runtime. If you want to enable the policies that this boolean enables without setting the boolean, you can implement the policies behind the boolean as a custom SELinux module and add it to your local policies.


  1. Create a file test.te:
policy_module(test, 1.0)
    type virt_qemu_ga_t ;
  1. yum -y install policycoreutils-devel
  2. make -f /usr/share/selinux/devel/Makefile test.pp
  3. semodule -i test.pp

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.