Please excuse me if this is too basic and you're tempted to throw an RTFM at me. I want to prevent users from copying certain files while granting them read access to the same files. I thought this was impossible until I came across this example in the SELinux Wiki:
allow firefox_t user_home_t : file { read write };
So I was thinking, is it possible to give the files in question a mode of 0700 for instance, and use SELinux to grant read access only to the application that the users will normally be using to read the files?
Again, I'm sorry if this is too basic, it's just that I'm on a tight schedule and I want to give an answer to my boss one way or the other (if it's possible or not) as soon as possible and I know nothing about SELinux so I'm afraid reading on my own to determine whether it's possible or not would take me too much time. Please note that I'm not averse to reading per se and would hugely appreciate pointers to the relevant documentation if it exists.
So basically, my question is, is there a way to do this in SELinux or am I wasting my time pursuing such an alternative?
P.S. I'm aware that granting read access can allow users who are really intent on copying the files to copy and paste them from within the application they'll read them with; I'm just looking for a first line of defense.
EDIT
To better explain my use case:
- The files in question are a mixture of text and binaries.
- They need to be read by proprietary commercial software: they are simulation models for an electronics simulation software.
- These models are themselves proprietary and we don't want the users simulating with them leaking them out for unauthorized use.
- The software only needs to read the models and run a few scripts from these files; it will not write their contents anywhere.
- In short, I want only the simulation software to have read and execute access to these files while preventing read access for the users.
cat file | ssh otherserver 'cat > stolenfile'
still work? Are you using rbash or some sort of restricted environment?rbash
before. Seems interesting, but it's too restrictive for my requirements, unfortunately. I know that you cancat
the file if you can read it. That's exactly my point. I want to disable all read access to the files so they can't be copied. From my skimming about SELinux, I came away with the impression that it aims to separate the users from the applications they're using; so I was wondering if I can enable read permissions only for the application that needs them. So the users can still use that application without having direct read permission to the files.