Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • SELinux policies and rpm distribution best practice

    Posted on

    Apologies in advance if this has been answered or there is an obvious reference I can use, but I have been digging through piles of SELinux documentation dating back (up to) several years and I am yet to find a Red Hat 'best practice' for packaging SELinux policy files for custom deployed applications via rpm.

    The documentation I have found appears to be on one of two topics (but I can't find much else):

    1. SELinux introduction, -> explain how it works, why it isn't scary and why you shouldn't turn it off.
    2. How to write an SELinux policy -> run your app, run audit2allow, update policy, repeat

    The document I am interested in (if it exists) is:

    How to include a custom SELinux module in your rpm for your custom application, including:
    - Where the module should be deployed (directory structure), in which format and how the SELinux system should be notified of its addition (rpm post scripts?)
    - How file contexts for files should be defined / deployed (ie. in a file defining file contexts, calling semanage?)
    - How other resources should be defined
    - What clean up tasks should be carried out when removing the rpm to ensure unnecessary defined types/policies don't 'hang around' on the system

    I think an example rpm that does the above 'the Red Hat way' would be a great start if anyone can suggest an example package to reference. I would also be interested in any rpm 'boiler plate' code specifically related to SELinux that people can provide (ie. installation/cleanup scripts for pre/post).

    Also interested to know where the SELinux training course went (RH429/EX429/RHCSS) and will it be returning? Is there any chance of the lab material from this course being opened up for wider consumption if the course has been cancelled for good?

    Thanks!

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2026 Red Hat