Skip to contentSkip to conversation

Policy for exim and/ or tiger?

DISCUSSION Torsten Knodt 3 participants 5 messages May 15, 2003 – May 21, 2003 SELinux security module

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
has someone a policy for the exim mta and/ or the tiger script?

Thanks in advance
Torsten Knodt

- --
Domain in provider transition, hope for smoothness.
pub 1024D/4CD29A2C 2001-01-12 Torsten Knodt <[email protected]>
Schl.-Fingerabdruck = A2B1 C626 F819 7C58 B2F9 4F4C BF16 64B6 4CD2 9A2C
uid Torsten Knodt (Account for communication about SE Linux) <[email protected]>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE+xAtmvxZktkzSmiwRAjg2AJ9l9uFUfKzhF2GDU9gPhZuFiBGwTgCdGV4K P0yXSmGY3UCfLicrIIWznqA=
=PzQz
-----END PGP SIGNATURE-----

--
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.

#1 lore raw

Hello,

Quoted 1 line · Torsten Knodt

has someone a policy for the exim mta and/ or the tiger script?

I have a still evolving exim policy at

http://narya.grin.hu/selinux/policy/

as selinux0516.tgz and selinux/ (they're the same). Unfortunately some of the very useful advices and modifications Russel did tell me I was not able to use without severe side effects, probably mta.te and exim.te still needs a definite amount of polishment.

In the current state it works for me(tm), and I have practised wishful thinking about it being secure. :-)

Still I'd be glad to hear comments and advices and I try to merge them up to the point when they make it not to work, when I have to stop merging. :-/

I have policy for pine, I mean, it's something like a policy but looks like a horrible rape on selinux for me, since it contains plenty of horrible permissions granted. I wonder whether it can be made working without these...

I changed the dovecot and maradns policies a bit, but I'm still not satisfied. Due to the time constraints I won't promise The Perfect Versions available too soon.

Peter

--
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.

#2 lore raw
Quoted 11 lines · Peter Gervai

Hello,

Quoted 1 line · Torsten Knodt

has someone a policy for the exim mta and/ or the tiger script?

I have a still evolving exim policy at

http://narya.grin.hu/selinux/policy/

# not strictly required
#file_type_auto_trans(exim_t, etc_t, etc_exim_t)

I would change that comment to "not desired for normal operation". Allowing the mail server to create arbitary files in /etc allows it to prevent password changes by using the temporary file names that /bin/passwd uses. Allowing it to write to it's own config files means that if someone breaks it then they can make sure that whatever they do survives a reboot.

Quoted 1 line

# Write to /var/spool/mail and /var/spool/mqueue.

Either the above comment is wrong or you are missing a file contexts entry for /var/spool/mqueue. If exim does use /var/spool/mqueue then I recommend that you use type mqueue_spool_t for it so that you can convert a Sendmail system to Exim without too much pain.

Quoted 2 lines

allow exim_t exim_var_run_t:dir rw_dir_perms;
allow exim_t exim_var_run_t:file rw_file_perms;

The above should be taken care of by daemon_domain().

Quoted 4 lines

I have policy for pine, I mean, it's something like a policy but looks like a horrible rape on selinux for me, since it contains plenty of horrible permissions granted. I wonder whether it can be made working without these...

For the "fd use" rules in the pine policy, you should probably use "privfd" instead of listing getty_t and sshd_t separately. Otherwise you'll find that your policy breaks on rlogin or other services you didn't plan on.

The pine policy has references to user_home_t and user_home_dir_t, these prevent it from being used on systems with multiple user roles.

Having a single domain for a program that is run from multiple user domains is OK for a domain such as ifconfig_t that is only run from privileged domains. It's usable for pppd_t (but even then it becomes painful). For something like pine it just becomes a really bad idea and results in pine having more privs not less!

If you add support for multiple user roles into the pine policy then you will grant pine the ability to write to different types of file that the calling program would not be permitted to write to. Doing this properly would best be done through macros to give a user_pine_t, a staff_pine_t, etc.

What is the aim of the pine policy anyway? To grant pine some access that user_t is not given? Or to lock down pine because it's got a bad history?

Signature · 10 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page


--
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.
#3 lore raw
Quoted 6 lines · Russell Coker
Quoted 2 lines · Peter Gervai
# not strictly required
#file_type_auto_trans(exim_t, etc_t, etc_exim_t)

I would change that comment to "not desired for normal operation". Allowing

[...]

Since these are draft versions (as you may notice from the large amounts of commented parts) the comments often contain unnecessary or undesired parts of the policy. If things seem not to break I going to remove all these comments from the files. Apologies for the inconveniece reading these.

Quoted 6 lines
Quoted 1 line

# Write to /var/spool/mail and /var/spool/mqueue.

Either the above comment is wrong or you are missing a file contexts entry for /var/spool/mqueue. If exim does use /var/spool/mqueue then I recommend that you use type mqueue_spool_t for it so that you can convert a Sendmail system to Exim without too much pain.

Comment is misleading since exim does not use mqueue but /var/spool/exim/*/*, but the actual policy reflects reality. I'll change this comment which is the remains of the sendmail policy I started editing from.

Quoted 4 lines
Quoted 2 lines

allow exim_t exim_var_run_t:dir rw_dir_perms;
allow exim_t exim_var_run_t:file rw_file_perms;

The above should be taken care of by daemon_domain().

Weird. I started inserting policy lines at the end when getting deny entries in the syslog. I'll check this, but I can't tell why were they required (I don't recall inserting the daemon_domain later...)

Quoted 4 lines
Quoted 4 lines

I have policy for pine, I mean, it's something like a policy but looks like a horrible rape on selinux for me, since it contains plenty of horrible permissions granted. I wonder whether it can be made working without these...

[...]

Quoted 2 lines

What is the aim of the pine policy anyway? To grant pine some access that user_t is not given? Or to lock down pine because it's got a bad history?

One reason is its bad history, other is the amount of weird permissions it requires, I do not know any other way to make it work. Is there any other way to make it fully functioning? It wants to rw ~mail, send mail by smtp and connect to local mail daemons, and some stuff I can't even tell the reason of.

Could it work without any special policy, is this what you mean?

Peter

--
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.

#4 lore raw
Quoted 8 lines · Peter Gervai
Quoted 4 lines
Quoted 2 lines

allow exim_t exim_var_run_t:dir rw_dir_perms;
allow exim_t exim_var_run_t:file rw_file_perms;

The above should be taken care of by daemon_domain().

Weird. I started inserting policy lines at the end when getting deny entries in the syslog. I'll check this, but I can't tell why were they required (I don't recall inserting the daemon_domain later...)

I've made some changes to the policy regarding /var/run recently. Probably you created the exim policy with an older version.

Quoted 5 lines
Quoted 3 lines

What is the aim of the pine policy anyway? To grant pine some access that user_t is not given? Or to lock down pine because it's got a bad history?

One reason is its bad history, other is the amount of weird permissions it

The problem with pine is that you almost certainly want it to run gpg for signing and decrypting mail. If you give a program access to your mail spool and your gpg secret key then you have little possibility of preventing it from doing damage.

However the gpg thing could probably be solved by having an external program prompt for the passphrase and call gpg so that pine never gets the pass-phrase.

Quoted 4 lines

requires, I do not know any other way to make it work. Is there any other way to make it fully functioning? It wants to rw ~mail, send mail by smtp and connect to local mail daemons, and some stuff I can't even tell the reason of.

I think that the best thing to do is store mail under the home directory and then just have pine run in user_t at the moment.

For sending mail by smtp, postfix allows any domain, the Qmail policy is setup for running the smtpd from inetd (which allows userdomain), and the sendmail policy does not appear to allow anyone to connect.

I will change the postfix policy to allow only userdomain.

Quoted 1 line

Could it work without any special policy, is this what you mean?

It should. I always use user_t for reading mail.

Signature · 10 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page


--
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.