1

I've created an SELinux module that works great for a specific context. What I would like to know is, is it possible to restrict this module to only function for specific files with that context?

For example:

  • The context that the module handles is 'system_u:object_r:my_content_t'
  • The files that have this context are:
    • file1.txt
    • file2.txt
    • file3.txt
  • I only want the module to work with 'file2.txt', even though all 3 have the same context.

Is that sort of thing possible without resorting to changing the context of that file to something specific and altering the module specifically for it (eg. my_content_file2_t)? Maybe a parameter in the .te file that applies only to the file, or having semodule only install for that file (which would probably be best).

Thanks!

1
  • 1
    Your assertion that you would need to change the file affected to a specific context is correct. It is not possible to make the policy differ between access from one object with the same type to the next object with the same type when both objects are the same class (in this case, files). Jul 15, 2014 at 8:00

0

You must log in to answer this question.

Browse other questions tagged .