0

I want to monitor processes and give permission for accessing a directory. I have some processes which I want to give permission access as read,write and to rest of all process deny the access to that directory.

I have a appliction in which there are multiple processess. So i want that only these processes can access a specific directory. No other processes should be able to access this directory even if running as root.

Klas Lindbäck
  • 33,105
  • 5
  • 57
  • 82
vikas_saini
  • 159
  • 1
  • 10
  • What you have tried so far..? – smali Aug 17 '15 at 06:05
  • Hi Vikas. Why don't you add what you have tried so far and where you are having trouble? – Abhishek Aug 17 '15 at 06:06
  • 1
    [chmod](http://linux.die.net/man/1/chmod)? If you are looking for something else or a more specific answer then you'll need to improve your question to describe what you have tried and make it clearer what the constraints of your desired solution are. – kaylum Aug 17 '15 at 06:09
  • i have a appliction in which there are mutiple processess .so i want that only these processes can aceess a specific directory. and no other process can not access this directory event that they have capability of root user. – vikas_saini Aug 17 '15 at 06:39
  • Look at @CoreyHenderson's answer [here](http://stackoverflow.com/a/8607443/2706918), he has worked on a kernel module which does similar job. – Nitinkumar Ambekar Aug 24 '15 at 11:07

1 Answers1

2

SELinux can do this. Simply give the directory and its contents a distinct file context, only allow access to the file context from a specific domain, and run the single process within this domain.

Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358