dynamic firewall configuration & program access control to ports
Hi,
I would like to write a GUI tool, and I'd like to know if selinux can solve the low-level issues.
Here it is what I want to do:
- It starts with an existing firewall/selinux config
- I want to authorize access to ports on an individual program basis
- If at runtime a program tries to listen/send on a port, that it is not (yet) allowed to, then it would ask the user if it wants to allow it, if yes, then:
- if the firewall is blocking the port, create an appropriate rule,
and open the port
- creates the appropriate selinux rule, and updates it
- When the program stops using the port:
- if the user wanted to allow it for this session only, then it
rolls back the selinux config, otherwise it saves the config
- if nobody else is using the port, update the firewall (iptables)
to block the port
My question is:
- is selinux able to control access to ports selectively by program?
- the program access control should be something secure like, not
only by the path of the program, but also by checking its hash (stored in a secure place, and accessible only by selinux), if the hash doesn't match, then it doesn't have any rights
- is it possible to notify my program when a program tries to access a port it doesn't have the right to, or when the hash of the program doesn't match
- how can I update the selinux policies from my program, without interfering with custom user configuration (I don't want my GUI to manage the whole configuration)
- how can I make my program run as non-root user, and still have the right to modify the selinux config, but without opening potential security holes?
- if I make a daemon that changes the config files, and that
communicates with my user program, what means does selinux provide me to secure this communication:
- the GUI and daemon will run on the same machine
- the client can use certificates to authenticate
- how can I use selinux to further secure this, because a
security hole is found in this communication the entire system will be easily compromised
- does using selinux have potential security impacts?
- does one have to recompile its kernel, or is it enough if it loads selinux as a module?(so for example I could distribute the selinux module for different kernels precompiled, so the users don't have to recompile the kernel to use selinux and my program)
I appreciate any suggestions, comments, criticism about what I said above. Thank you for taking the time to read this message.P.S.: I am new to selinux, so I would appreciate if you could point me at *must read* documentation related to what I want to do above. If somebody knows about an app that has similar intentions as mine, then please tell me, so that we don't duplicate efforts.
--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.