Bug 8000 - msec ignores custom rules
Summary: msec ignores custom rules
Status: RESOLVED OLD
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 2
Hardware: x86_64 Linux
Priority: Normal major
Target Milestone: ---
Assignee: Sandro CAZZANIGA
QA Contact:
URL:
Whiteboard: NEEDHELP
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-06 19:31 CET by rh hn
Modified: 2013-11-23 16:15 CET (History)
0 users

See Also:
Source RPM: msec-0.80.10-10.mga2.src.rpm
CVE:
Status comment:


Attachments

Description rh hn 2012-11-06 19:31:35 CET
Description of problem:
msec in "secure" setting ignores custom rules added for files and directories
Adding a file permission rule using msec GUI doesn't change msec daily check behaviour. Changing /etc/security/msec/perms.conf doesn't seem to affect msec checks. Appending the rule manually to /etc/security/msed/perm.secure changes the behaviour.
Rule in question:
/var/log/munin/ root.root       750

"force" doesn't matter, as well as user/group spec.

msec.daily doesn't seem to complain about /mnt after adding this rule manually (could be due to other effects):
/mnt/   root.adm        755

Version-Release number of selected component (if applicable):
msec-0.80.10-10.mga2.src.rpm

How reproducible:
Always

Steps to Reproduce:
1. Set msec to "secure"
2. Add abovementioned munin permissions rule
3. Change permissions on /var/log/munin manually
4. Observe 700 permissions forced at msecperms -e run
Manuel Hiebel 2012-11-11 00:23:21 CET

Assignee: bugsquad => cazzaniga.sandro

Comment 1 Sandro CAZZANIGA 2012-11-11 11:31:23 CET
Go on my todo list, I'll take a look as soon as possible and let you know the progression.
Comment 2 Sandro CAZZANIGA 2012-11-14 07:47:49 CET
Did you try to edit /etc/security/msec/perm.local to add your customs permissions?

Status: NEW => ASSIGNED

Comment 3 rh hn 2012-11-14 13:42:29 CET
I moved the munin rule from /etc/security/msec/perms.conf to /etc/security/msec/perm/local.

Here's what happened:

[root@gateway msec]# msecperms -e
INFO: Modified system files: /usr/bin/who /var/log/munin /mnt
WARNING: Enforcing permissions on /usr/bin/who to 751
WARNING: Enforcing permissions on /var/log/munin to 750
WARNING: Enforcing permissions on /mnt to 755
[root@gateway msec]# msecperms -e
INFO: Modified system files: /var/log/munin
WARNING: Enforcing permissions on /var/log/munin to 700

During the first run the munin rule was appended to perms.conf all perms.conf rules were applied.
During the second and following runs the contents of perms.conf were not changed.
Comment 4 Sandro CAZZANIGA 2012-11-14 14:06:00 CET
(In reply to comment #3)
> I moved the munin rule from /etc/security/msec/perms.conf to
> /etc/security/msec/perm/local.
> 

I hope you want to say /etc/security/msec/perm.local?  :)
Comment 5 rh hn 2012-11-14 14:34:47 CET
Yes, this is a typo :)
Comment 6 Sandro CAZZANIGA 2012-11-14 19:56:24 CET
So the permissions didn't stay to your local setting?
Comment 7 rh hn 2012-11-25 09:00:23 CET
Permissions on who and /mnt stayed, but /var/log/munin didn't.
Comment 8 Sandro CAZZANIGA 2012-11-27 10:29:02 CET
Did you have something in msec log?
Comment 9 rh hn 2013-01-07 09:52:26 CET
I can't find anything relevant in the logs.
Comment 10 Sandro CAZZANIGA 2013-01-07 10:08:23 CET
Can someone help? I don't see anything in the code (class Config) that can make this behavior happened.
Comment 11 Sandro CAZZANIGA 2013-01-07 15:20:39 CET
(In reply to comment #10)
> Can someone help? I don't see anything in the code (class Config) that can make
> this behavior happened.

Oops, in fact the file is config.py, specially class MsecConfig.
Comment 12 rh hn 2013-01-07 22:07:48 CET
I didn't know msec was not written in perl... Can you point me to the file? I'll fix this when I find a while.
Comment 13 Sandro CAZZANIGA 2013-01-08 10:52:31 CET
The file is msec/trunk/src/msec/config.py 

Thanks! :)
Comment 14 rh hn 2013-01-09 21:19:12 CET
Here are my findings:
The files that get loaded are:
/etc/security/msec/perms.conf
/etc/security/msec/perm.secure
/etc/security/msec/perm.local

My perm.local is empty, so I will ignore it.

I found that PermConfig instance holding perms.conf gets updated with perm.secure
This is all fine, but perm.secure rules are appended *after* perms.conf.
The result:

[...]
custom rule for /var/log/munin from perms.conf
[...]
builtin rule for /var/log/* from perm.secure
[...]

I didn't look farther than that, but it appears that the applying part of msec applies rules in that order - judging from debug info. My rule would get applied, but the overwritten anyway.

I think that rules added using the GUI should override builtin rules, but I'm not sure what the general idea was.
Comment 15 Sandro CAZZANIGA 2013-04-11 14:15:47 CEST
(In reply to rh hn from comment #14)
> I think that rules added using the GUI should override builtin rules, but
> I'm not sure what the general idea was.

I don't know... Maybe a msec developper can help on this question?
Sandro CAZZANIGA 2013-05-21 07:28:01 CEST

Whiteboard: (none) => NEEDHELP

Comment 16 Manuel Hiebel 2013-10-22 12:18:40 CEST
This message is a reminder that Mageia 2 is nearing its end of life.
Approximately one month from now Mageia will stop maintaining and issuing updates for Mageia 2. At that time this bug will be closed as WONTFIX (EOL) if it remains open with a Mageia 'version' of '2'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Mageia version prior to Mageia 2's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Mageia 2 is end of life.  If you would still like to see this bug fixed and are able to reproduce it against a later version of Mageia, you are encouraged to click on "Version" and change it against that version of Mageia.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Mageia release includes newer upstream software that fixes bugs or makes them obsolete.

-- 
The Mageia Bugsquad
Comment 17 Manuel Hiebel 2013-11-23 16:15:24 CET
Mageia 2 changed to end-of-life (EOL) status on ''22 November''. Mageia 2 is no
longer maintained, which means that it will not receive any further security or
bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of Mageia
please feel free to click on "Version" change it against that version of Mageia
and reopen this bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

--
The Mageia Bugsquad

Status: ASSIGNED => RESOLVED
Resolution: (none) => OLD


Note You need to log in before you can comment on or make changes to this bug.