Book Image

SELinux Cookbook

By : Sven Vermeulen
Book Image

SELinux Cookbook

By: Sven Vermeulen

Overview of this book

Table of Contents (17 chapters)
SELinux Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Granting privileges to all clients


The approach of using interfaces to aggregate privileges not only benefits domains that have the same functional purpose, but also clients. By combining the privileges for the set of clients, it is possible to enhance client privileges by only updating the interface rather than having to update all the clients' policy modules.

How to do it…

Create a client interface that can be assigned to all clients of a particular functional purpose. The following steps extend an example policy with antimalware support:

  1. In the antimalware generic policy, create an avcheck_client attribute:

    attribute avcheck_client;
  2. Create the interface that assigns the attribute to a client domain:

    interface(`av_check_client',`
      gen_require(`
        attribute avcheck_client;
      ')
      typeattribute $1 avcheck_client;
    ')
  3. Create the interface that assigns the common privileges for client domains:

    interface(`av_check_client_privs',`
      …
    ')
  4. In the created interface, add the privileges that need to be...