Controlling files execution
Posted: Thu Jan 02, 2014 12:33 pm
Hello,
on our systems we sometime need to install system-wide application that is less trusted and should be used just by few users that really need it. As well we have some dedicated users (e.g. who run servers) and we would like to ensure they should execute only given one/two programs (+ several standard programs).
This is partially possible with grsecurity, but perhaps heaving a clear list of who can run what would be easier to configure, and more flexible if instead a constant list we would call a program that will permit/deny (and can take other factors into account like current time, resources, or even ask for special authorization and await confirmation by admin e.g. via email)
We want to propose a two major ways to control files execution:
1. Set for user
User can execute specified files only.
or
2. Set for file
File can be executed by specified user only. That will apply for example to any server applications with separate user created only for this application.
This restrictions have their purpose if there is set of finite trusted files needed by user to perform daily actions.
All this can be done with chmod command and groups but it fails in some cases (for example command 'aptitude upgrade' will rewrite the permissions to binary), so we want something more basic and more elastic.
That functionality can be provided by grsecurity configuration file, or by application that controls all files execution. Application cotrolling execution of files has advantages over configuration file:
- Control: logging all files executions
- Information and feedback to user
The closest option to this idea that we have found is Trusted Path Execution (GRKERNSEC_TPE):
"If you say Y here, you will be able to choose a gid to add to the
supplementary groups of users you want to mark as "untrusted."
These users will not be able to execute any files that are not in
root-owned directories writable only by root. If the sysctl option
is enabled, a sysctl option with name "tpe" is created."
So there is lack of a handy tool for setting permisions for execution per file/user. We think that this is a good idea to discuss. What do you think?
on our systems we sometime need to install system-wide application that is less trusted and should be used just by few users that really need it. As well we have some dedicated users (e.g. who run servers) and we would like to ensure they should execute only given one/two programs (+ several standard programs).
This is partially possible with grsecurity, but perhaps heaving a clear list of who can run what would be easier to configure, and more flexible if instead a constant list we would call a program that will permit/deny (and can take other factors into account like current time, resources, or even ask for special authorization and await confirmation by admin e.g. via email)
We want to propose a two major ways to control files execution:
1. Set for user
User can execute specified files only.
or
2. Set for file
File can be executed by specified user only. That will apply for example to any server applications with separate user created only for this application.
This restrictions have their purpose if there is set of finite trusted files needed by user to perform daily actions.
All this can be done with chmod command and groups but it fails in some cases (for example command 'aptitude upgrade' will rewrite the permissions to binary), so we want something more basic and more elastic.
That functionality can be provided by grsecurity configuration file, or by application that controls all files execution. Application cotrolling execution of files has advantages over configuration file:
- Control: logging all files executions
- Information and feedback to user
The closest option to this idea that we have found is Trusted Path Execution (GRKERNSEC_TPE):
"If you say Y here, you will be able to choose a gid to add to the
supplementary groups of users you want to mark as "untrusted."
These users will not be able to execute any files that are not in
root-owned directories writable only by root. If the sysctl option
is enabled, a sysctl option with name "tpe" is created."
So there is lack of a handy tool for setting permisions for execution per file/user. We think that this is a good idea to discuss. What do you think?