Skip to Content
Red Hat Enterprise Linux Server Cookbook
book

Red Hat Enterprise Linux Server Cookbook

by William Leemans
December 2015
Intermediate to advanced
250 pages
4h 41m
English
Packt Publishing
Content preview from Red Hat Enterprise Linux Server Cookbook

Applying SELinux policies

We've learned how to create SELinux policies in the previous recipe. This recipe will show you how to apply your newly created SELinux policies.

Getting ready

In order to apply a policy, we need a policy package file (pp). This can be obtained by parsing AVC denials to audit2allow or compiling your own policy package file, as explained in the Create SELinux policies recipe.

How to do it...

Follow these steps:

  1. Activate the policy (this can take quite a while, depending on the number of policies applied to your system) by running the following command:
    ~# semodule -i example_policy.pp
    ~#
    
  2. Next, verify that the policy is actually activated via these commands:
    ~# semodule -l |grep example_policy
    example_policy  1.0
    ~#
    

How it works… ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

CentOS 7 Server Deployment Cookbook

CentOS 7 Server Deployment Cookbook

Timothy Boronczyk

Publisher Resources

ISBN: 9781784392017