MSEC I
Summary:- Introduction
- What Does msec Do?
- Configurable Variables
Introduction
The Mandrake-Security package, more commonly known as msec, has been one of the base packages in Mandrake Linux since it was first introduced in version 7.0. Since that time, msec has undergone a lot of changes, most notably the transformation from being a series of shell scripts in 8.1 to the python-based system it is currently in 8.2. Please note that this paper describes msec 0.19 and will be modified to reflect changes in newer versions as they appear. There are some differences between this version of msec and earlier versions so while much of the information provided is applicable to previous versions of msec, it may not be exact. The basic functionality of msec has, however, remained the same. Every user, consciously or not, has used msec to some degree. ~DrakX, the Mandrake Linux GUI installer, when asking what security level you wish to have on your system (Low, Medium, High) is calling msec to secure your system. section indexWhat Does msec Do?
However, one source of confusion with msec is what exactly it does. It's nice to know you can select a low security setting for next to no system security, or a high security setting for a paranoid system, but what exactly does msec do to differentiate a low setting from a high setting, or any of those in between? The following table illustrates the basic differences between the six security levels available:| Actions List/Security Levels | Level 0 | Level 1 | Level 2 | Level 3 | Level 4 | Level 5 |
|---|---|---|---|---|---|---|
| root umask | 002 | 002 | 022 | 022 | 022 | 077 |
| User umask | 002 | 002 | 022 | 022 | 077 | 077 |
| Shell timeout | 0 | 0 | 0 | 0 | 3600 | 900 |
| Deny Services | none | none | none | none | local | all |
| su Only For wheel Group | no | no | no | no | no | yes |
| Shell History Size | default | default | default | default | 10 | 10 |
| Direct root Login | yes | yes | yes | yes | no | no |
| sulogin For Single User | no | no | no | no | yes | yes |
| User List in {kg}dm | yes | yes | yes | yes | no | no |
| Ignore ICMP Echo | no | no | no | no | yes | yes |
| Ignore Bogus Error Responses | no | no | no | no | yes | yes |
| Allow Reboot by User | yes | yes | yes | yes | no | no |
| Allow crontab/at | yes | yes | yes | yes | no | no |
| Password Aging | no | no | no | no | 60 days | 30 days |
| Password Required | no | yes | yes | yes | yes | yes |
| Allow Autologin | yes | yes | yes | no | no | no |
| Console Log | no | no | no | yes | yes | yes |
| Warnings in syslog | no | no | yes | yes | yes | yes |
| Warnings in security.log | no | yes | yes | yes | yes | yes |
| Issues | yes | yes | yes | local | local | no |
| IP Spoofing Protection | no | no | no | yes | yes | yes |
| Log Strange IP Packets | no | no | no | yes | yes | yes |
| Periodic Security Check | no | yes | yes | yes | yes | yes |
| Allow X TCP Connections | yes | local | local | local | no | no |
| Connect to X Display | all | localhost | localhost | localhost | localhost | no |
| "." in $PATH | yes | yes | no | no | no | no |
| Run msec tests via cron | no | no | no | some | yes | yes |
| Periodic Checks/Security Levels | Level 0 | Level 1 | Level 2 | Level 3 | Level 4 | Level 5 |
|---|---|---|---|---|---|---|
| CHECK_SECURITY | no | yes | yes | yes | yes | yes |
| CHECK_PERMS | no | no | no | yes | yes | yes |
| CHECK_SUID_ROOT | no | no | yes | yes | yes | yes |
| CHECK_SUID_MD5 | no | no | yes | yes | yes | yes |
| CHECK_SUID_GROUP | no | no | no | yes | yes | yes |
| CHECK_WRITEABLE | no | no | yes | yes | yes | yes |
| CHECK_UNOWNED | no | no | no | yes | yes | yes |
| CHECK_PROMISC | no | no | no | yes | yes | yes |
| CHECK_OPEN_PORT | no | no | no | yes | yes | yes |
| CHECK_PASSWD | no | no | no | yes | yes | yes |
| CHECK_SHADOW | no | no | no | yes | yes | yes |
| TTY_WARN | no | no | no | no | yes | yes |
| MAIL_WARN | no | no | no | yes | yes | yes |
| SYSLOG_WARN | no | no | yes | yes | yes | yes |
| RPM_CHECK | no | no | no | yes | yes | yes |
| CHKROOTKIT_CHECK | no | no | no | yes | yes | yes |
Configurable Variables
There are at least three additional variables that may be configured by the user (in /etc/security/msec/security.conf): MAIL_USER, PERM_LEVEL and EXCLUDE_REGEXP. Let's take a look at what each configurable variable actually does: MAIL_USER: this is the user to send the daily reports to. If this is not set, the email is sent to the root user (which, hopefully, is being forwarded to another user since root should not really receive mail). PERM_LEVEL: This is used to determine the file to use in order to fix permissions, owners, and groups. If set, it will use the file /etc/security/msec/perm.$PERM_LEVEL. If it is not set, it will use the SECURE_LEVEL variable instead (which is your current msec security level). Additionally, for extra system-specific configuration, the file /etc/security/msec/perm.local is used also, if it exists. EXCLUDE_REGEXP: This is used to exclude files from consideration by msec, for example because they are always world writable and you don't want to be told about them. An example configuration:EXCLUDE_REGEXP='^/tmp/\\\..*-unix'
EXCLUDE_REGEXP=${EXCLUDE_REGEXP}'\\\|^/var/lib/texmf'
EXCLUDE_REGEXP=${EXCLUDE_REGEXP}'\\\|^/var/run/acpid.socket'
EXCLUDE_REGEXP=${EXCLUDE_REGEXP}'\\\|^/var/run/dbus/system_dbus_socket'
EXCLUDE_REGEXP=${EXCLUDE_REGEXP}'\\\|^/var/run/sdp'
EXCLUDE_REGEXP=${EXCLUDE_REGEXP}'\\\|^/var/run/xdmctl/dmctl.*/socket'
EXCLUDE_REGEXP=${EXCLUDE_REGEXP}'\\\|^/var/spool/postfix'find / -maxdepth 4 | grep $EXCLUDE_REGEXP
- Check if any NFS filesystems are globally exported (without restrictions for who may mount them)
- Check if NFS mounts are missing the "nosuid" option
- Check if host trusting files containing the "+" character which allows hosts to connect without proper authentication (the files checked are /etc/hosts.equiv, /etc/shosts.equiv, and /etc/hosts.lpd)
- Check if executables are found in the /etc/aliases or /etc/postfix/aliases files and reports the found executable
- Files that should not be owned by someone other than the home directory owner, or readable: .netrc, .rhosts, .shosts, .Xauthority, .gnupg/secring.gpg, .pgp/secring.pgp, .ssh/identity, .ssh/id_dsa, .ssh/id_rsa, .ssh/random_seed
- Files that should not be owned by someone other than the home directory owner, or writeable: .bashrc, .bash_profile, .bash_login, .bash_logout, .cshrc, .emacs, .exrc, .forward, .klogin, .login, .logout, .profile, .tcshrc, .fvwmrc, .inputrc, .kshrc, .nexrc, .screenrc, .ssh, .ssh/config, .ssh/authorized_keys, .ssh/environment, .ssh/known_hosts, .ssh/rc, .twmrc, .xsession, .xinitrc, .Xdefaults
- Checks home directories; directories should not be owned by someone else or writeable
{root@mdk82}# cd /var/log<br> {root@mdk82}# grep " msec" messages
Related Resources:
Original article on ~MandrakeSecureOfficial Mandrake Linux msec Documentation
Files in '/usr/share/doc/msec-{...} Revision / Modified: May 14, 2002
Author: Vincent Danen Legal: This page is covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB and Mandrakesoft.
Document data
- Lost account?
- Join the community, be part of the Club: it's free!
- Get the PWP Download Subscription!
Mandriva.com
Store
Club




Comments (3)