Changeset 218
- Timestamp:
- 07/24/08 08:53:37
(4 months ago)
- Author:
- slawrence
- Message:
Backport 5.2 stig/ks changes to 5.1, including:
- Use different audit rules for 32-bit and 64-bit archs
- Fix installation of audit.rules
- Specify audit dispatcher in auditd.conf
- Specifiy dispatcher in auditd.conf
- Use pam_passwdqc instead of pam_cracklib
- Update password minimum length and max days
- Use different audit rules for 32 and 64 bit archs
- Permission updates to meet stigs
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r133 |
r218 |
|
| 2 | 2 | Name: clip |
|---|
| 3 | 3 | Version: 2.0 |
|---|
| 4 | | Release: 1 |
|---|
| | 4 | Release: 2 |
|---|
| 5 | 5 | License: GPL |
|---|
| 6 | 6 | Group: System Environment/Base |
|---|
| … | … | |
| 37 | 37 | %defattr(-,root,root,-) |
|---|
| 38 | 38 | /usr/share/clip/conf/audit/auditd.conf |
|---|
| 39 | | /usr/share/clip/conf/audit/audit.rules |
|---|
| | 39 | /usr/share/clip/conf/audit/audit-i386.rules |
|---|
| | 40 | /usr/share/clip/conf/audit/audit-x86_64.rules |
|---|
| 40 | 41 | /usr/share/clip/conf/pam/login.pam |
|---|
| 41 | 42 | /usr/share/clip/conf/pam/newrole.pam |
|---|
| r1 |
r218 |
|
| 9 | 9 | freq = 20 |
|---|
| 10 | 10 | num_logs = 4 |
|---|
| 11 | | #dispatcher = /root/src/skeleton |
|---|
| | 11 | dispatcher = /sbin/audispd |
|---|
| 12 | 12 | max_log_file = 5 |
|---|
| 13 | 13 | max_log_file_action = ROTATE |
|---|
| r154 |
r218 |
|
| 10 | 10 | account required pam_unix.so |
|---|
| 11 | 11 | account required pam_tally3.so |
|---|
| 12 | | password required pam_cracklib.so try_first_pass retry=3 minlen=12 difok=3 dcredit=-2 ucredit=-2 ocredit=-2 lcredit=-2 |
|---|
| | 12 | password required pam_passwdqc.so min=disabled,disabled,disabled,disabled,14 max=40 passphrase=0 match=0 similar=deny random=0 enforce=everyone retry=3 |
|---|
| 13 | 13 | password required pam_unix.so md5 shadow nullok try_first_pass use_authtok remember=12 |
|---|
| 14 | 14 | |
|---|
| r192 |
r218 |
|
| 344 | 344 | encryption or biometric access controls provide security for the benefit of |
|---|
| 345 | 345 | the USG. These protections are not provided for your benefit or privacy and |
|---|
| 346 | | may be modified or elimiated at the USG's discretion. |
|---|
| | 346 | may be modified or eliminated at the USG's discretion. |
|---|
| 347 | 347 | |
|---|
| 348 | 348 | EOF |
|---|
| … | … | |
| 359 | 359 | cat <<-EOF > /etc/pam.d/system-auth |
|---|
| 360 | 360 | #%PAM-1.0 |
|---|
| 361 | | auth required pam_tally.so deny=3 onerr=fail unlock_time=900 quiet |
|---|
| | 361 | auth required pam_tally.so deny=3 onerr=fail unlock_time=900 |
|---|
| 362 | 362 | |
|---|
| 363 | 363 | auth required pam_env.so |
|---|
| … | … | |
| 366 | 366 | account required pam_unix.so |
|---|
| 367 | 367 | account required pam_tally.so |
|---|
| 368 | | password required pam_cracklib.so try_first_pass retry=3 minlen=12 difok=3 dcredit=-2 ucredit=-2 ocredit=-2 lcredit=-2 |
|---|
| | 368 | password required pam_passwdqc.so min=disabled,disabled,disabled,disabled,14 max=40 passphrase=0 match=0 similar=deny random=0 enforce=everyone retry=3 |
|---|
| 369 | 369 | password required pam_unix.so md5 shadow nullok try_first_pass use_authtok remember=12 |
|---|
| 370 | 370 | |
|---|
| … | … | |
| 384 | 384 | ## mechanism is used and is set to lock the screen after 15 minutes of |
|---|
| 385 | 385 | ## inactivity. |
|---|
| 386 | | echo "TMOUT=900" >> /etc/profile |
|---|
| | 386 | echo "readonly TMOUT=900" >> /etc/profile |
|---|
| 387 | 387 | |
|---|
| 388 | 388 | ## (GEN000540: CAT II) (Previously â G004) The SA will ensure passwords are |
|---|
| … | … | |
| 403 | 403 | ## (GEN000580: CAT II) (Previously â G019) The IAO will ensure all passwords contain a |
|---|
| 404 | 404 | ## minimum of eight characters. |
|---|
| 405 | | sed -i "s/PASS_MIN_LEN[ \t]*[0-9]*/PASS_MIN_LEN\t8/" /etc/login.defs |
|---|
| | 405 | sed -i "s/PASS_MIN_LEN[ \t]*[0-9]*/PASS_MIN_LEN\t14/" /etc/login.defs |
|---|
| 406 | 406 | |
|---|
| 407 | 407 | ## (GEN000600: CAT II) (Previously â G019) The IAO will ensure passwords include at |
|---|
| … | … | |
| 411 | 411 | ## (GEN000700: CAT II) (Previously â G020) The SA will ensure passwords are |
|---|
| 412 | 412 | ## changed at least every 90 days. |
|---|
| 413 | | sed -i '/^PASS_MAX_DAYS/ c\PASS_MAX_DAYS\t90' /etc/login.defs |
|---|
| | 413 | sed -i '/^PASS_MAX_DAYS/ c\PASS_MAX_DAYS\t60' /etc/login.defs |
|---|
| 414 | 414 | |
|---|
| 415 | 415 | ## (GEN000800: CAT II) (Previously â G606) The SA will ensure passwords will not be |
|---|
| … | … | |
| 516 | 516 | ## (GEN001780: CAT III) (Previously â G112) The SA will ensure global |
|---|
| 517 | 517 | ## initialization files contain the command mesg ân. |
|---|
| 518 | | for FILE in /etc/{profile,bashrc,environment}; do |
|---|
| | 518 | for FILE in /etc/{profile,bashrc}; do |
|---|
| 519 | 519 | echo "mesg n" >> $FILE |
|---|
| 520 | 520 | done; |
|---|
| … | … | |
| 623 | 623 | ## (GEN002560: CAT II) (Previously â G089) The SA will ensure the system and |
|---|
| 624 | 624 | ## user umask is 077. |
|---|
| 625 | | echo "umask 077" >> /etc/bashrc |
|---|
| | 625 | sed -i "/umask/ c\umask 077" /etc/bashrc |
|---|
| | 626 | sed -i "/umask/ c\umask 077" /etc/csh.cshrc |
|---|
| | 627 | |
|---|
| 626 | 628 | |
|---|
| 627 | 629 | ## (GEN002640: CAT II) (Previously â G092) The SA will ensure logon capability |
|---|
| … | … | |
| 655 | 657 | EOF |
|---|
| 656 | 658 | |
|---|
| | 659 | cat <<-EOF > /etc/audit/auditd.conf |
|---|
| | 660 | log_file = /var/log/audit/audit.log |
|---|
| | 661 | log_format = RAW |
|---|
| | 662 | priority_boost = 3 |
|---|
| | 663 | flush = INCREMENTAL |
|---|
| | 664 | freq = 20 |
|---|
| | 665 | num_logs = 4 |
|---|
| | 666 | dispatcher = /sbin/audispd |
|---|
| | 667 | max_log_file = 5 |
|---|
| | 668 | max_log_file_action = ROTATE |
|---|
| | 669 | space_left = 75 |
|---|
| | 670 | space_left_action = SYSLOG |
|---|
| | 671 | action_mail_acct = root |
|---|
| | 672 | admin_space_left = 50 |
|---|
| | 673 | admin_space_left_action = HALT |
|---|
| | 674 | disk_full_action = HALT |
|---|
| | 675 | disk_error_action = HALT |
|---|
| | 676 | EOF |
|---|
| | 677 | |
|---|
| 657 | 678 | ## (GEN002680: CAT II) (Previously â G094) The SA will ensure audit data files |
|---|
| 658 | 679 | ## and directories will be readable only by personnel authorized by the IAO. |
|---|
| … | … | |
| 678 | 699 | cat <<-EOF >> /etc/audit/audit.rules |
|---|
| 679 | 700 | # DAC permission changes |
|---|
| 680 | | -a exit,always -S chmod -S chown -S chown32 -S fchmod -S fchown -S fchown32 -S lchown -S lchown32 |
|---|
| 681 | | |
|---|
| 682 | 701 | EOF |
|---|
| | 702 | echo -n "-a exit,always -S chmod -S chown -S fchmod -S fchown -S lchown" >> /etc/audit/audit.rules |
|---|
| | 703 | if [ "$(uname -i)" != "x86_64" ] |
|---|
| | 704 | then |
|---|
| | 705 | echo -n " -S chown32 -S fchown32 -S lchown32" >> /etc/audit/audit.rules |
|---|
| | 706 | fi |
|---|
| | 707 | echo -e "\n" >> /etc/audit/audit.rules |
|---|
| 683 | 708 | |
|---|
| 684 | 709 | ## (GEN002760: CAT II) The SA will configure the auditing system to audit |
|---|
| … | … | |
| 686 | 711 | cat <<-EOF >> /etc/audit/audit.rules |
|---|
| 687 | 712 | # unauthorized file access attempts |
|---|
| 688 | | -a exit,always -F success=0 -S open -S mknod -S pipe -S mkdir -S creat -S truncate -S truncate64 -S ftruncate -S ftruncate64 |
|---|
| 689 | | |
|---|
| 690 | 713 | EOF |
|---|
| | 714 | echo "-a exit,always -S open -F success=0" >> /etc/audit/audit.rules |
|---|
| | 715 | echo -n "-a exit,always -F success=0 -S mknod -S pipe -S mkdir -S creat -S truncate -S ftruncate" >> /etc/audit/audit.rules |
|---|
| | 716 | if [ "$(uname -i)" != "x86_64" ] |
|---|
| | 717 | then |
|---|
| | 718 | echo -n " -S truncate64 -S ftruncate64" >> /etc/audit/audit.rules |
|---|
| | 719 | fi |
|---|
| | 720 | echo -e "\n" >> /etc/audit/audit.rules |
|---|
| 691 | 721 | |
|---|
| 692 | 722 | ## (GEN002780: CAT II) The SA will configure the auditing system to audit |
|---|
| … | … | |
| 694 | 724 | cat <<-EOF >> /etc/audit/audit.rules |
|---|
| 695 | 725 | # privileged commands |
|---|
| 696 | | -a exit,always -S chroot -S mount -S umount -S umount2 -S adjtimex -S kill |
|---|
| 697 | 726 | -w /usr/sbin/pwck |
|---|
| 698 | 727 | -w /bin/chgrp |
|---|
| … | … | |
| 707 | 736 | -w /usr/bin/setfacl |
|---|
| 708 | 737 | -w /usr/bin/chacl |
|---|
| 709 | | |
|---|
| 710 | 738 | EOF |
|---|
| | 739 | echo -n "-a exit,always -S chroot -S mount -S umount2 -S adjtimex -S kill" >> /etc/audit/audit.rules |
|---|
| | 740 | if [ "$(uname -i)" != "x86_64" ] |
|---|
| | 741 | then |
|---|
| | 742 | echo -n " -S umount" >> /etc/audit/audit.rules |
|---|
| | 743 | fi |
|---|
| | 744 | echo -e "\n" >> /etc/audit/audit.rules |
|---|
| 711 | 745 | |
|---|
| 712 | 746 | ## (GEN002800: CAT II) The SA will configure the auditing system to audit |
|---|
| … | … | |
| 722 | 756 | cat <<-EOF >> /etc/audit/audit.rules |
|---|
| 723 | 757 | # system administration actions |
|---|
| 724 | | # these two lines could be the cause of problems with filling audit logs and preventing system usage after installation |
|---|
| 725 | 758 | -w /var/log/audit/audit.log |
|---|
| 726 | 759 | -w /var/log/audit/audit[1-4].log |
|---|
| … | … | |
| 741 | 774 | -w /var/run/utmp |
|---|
| 742 | 775 | -w /var/run/wtmp |
|---|
| 743 | | -a exit,always -S acct -S reboot -S sched_setparam -S sched_setscheduler -S setdomainname -S setrlimit -S settimeofday -S stime -S swapon |
|---|
| 744 | | |
|---|
| 745 | 776 | EOF |
|---|
| | 777 | echo -n "-a exit,always -S acct -S reboot -S sched_setparam -S sched_setscheduler -S setdomainname -S setrlimit -S settimeofday -S swapon" >> /etc/audit/audit.rules |
|---|
| | 778 | if [ "$(uname -i)" != "x86_64" ] |
|---|
| | 779 | then |
|---|
| | 780 | echo -n " -S stime" >> /etc/audit/audit.rules |
|---|
| | 781 | fi |
|---|
| | 782 | echo -e "\n" >> /etc/audit/audit.rules |
|---|
| 746 | 783 | |
|---|
| 747 | 784 | ## (GEN002840: CAT II) The SA will configure the auditing system to audit |
|---|
| … | … | |
| 771 | 808 | ## file has permissions of 600, or more restrictive. |
|---|
| 772 | 809 | chmod 600 /etc/cron.allow |
|---|
| | 810 | # see bottom of file |
|---|
| 773 | 811 | |
|---|
| 774 | 812 | ## (GEN003040: CAT II) The SA will ensure the owner of crontabs is root or the |
|---|
| … | … | |
| 964 | 1002 | ## (GEN004500: CAT II) (Previously â G136) The SA will ensure the critical |
|---|
| 965 | 1003 | ## sendmail log file has permissions of 644, or more restrictive. |
|---|
| 966 | | chmod 644 /var/log/maillog |
|---|
| | 1004 | chmod 640 /var/log/maillog |
|---|
| 967 | 1005 | |
|---|
| 968 | 1006 | ## (GEN004540: CAT II) The SA will ensure the help sendmail command is |
|---|
| … | … | |
| 970 | 1008 | mv /etc/mail/helpfile /etc/mail/helpfile.bak |
|---|
| 971 | 1009 | echo "" > /etc/mail/helpfile |
|---|
| | 1010 | sed -i '/HelpFile/s/^/#/' /etc/mail/sendmail.cf |
|---|
| 972 | 1011 | |
|---|
| 973 | 1012 | ## (GEN004560: CAT II) (Previously â G646) To help mask the e-mail version, |
|---|
| … | … | |
| 1127 | 1166 | /usr/sbin/userdel halt |
|---|
| 1128 | 1167 | /usr/sbin/userdel sync |
|---|
| | 1168 | /usr/sbin/userdel ftp |
|---|
| 1129 | 1169 | |
|---|
| 1130 | 1170 | ## (LNX00340: CAT II) (Previously â L142) The SA will delete accounts that |
|---|
| … | … | |
| 1188 | 1228 | chmod 640 /etc/securetty |
|---|
| 1189 | 1229 | |
|---|
| | 1230 | |
|---|
| | 1231 | #check numbers of chvt |
|---|
| | 1232 | chvt 3 |
|---|
| | 1233 | clear |
|---|
| | 1234 | echo "Please choose a root password" |
|---|
| | 1235 | passwd root |
|---|
| | 1236 | echo "Please choose a password for clipuser" |
|---|
| | 1237 | passwd clipuser |
|---|
| | 1238 | clear |
|---|
| | 1239 | chvt 7 |
|---|
| 1190 | 1240 | |
|---|
| 1191 | 1241 | |
|---|
| … | … | |
| 3644 | 3694 | # Kickstart Actions: None - PROCEDURAL REQUIREMENT |
|---|
| 3645 | 3695 | |
|---|
| | 3696 | # see GEN002980 |
|---|
| | 3697 | # something above is changing cron.allow to 644 |
|---|
| | 3698 | # putting this here deals with that until I can figure out what is doing it |
|---|
| | 3699 | chmod 600 /etc/cron.allow |
|---|
| | 3700 | |
|---|
| 3646 | 3701 | eject |
|---|
| 3647 | 3702 | |
|---|
| r174 |
r218 |
|
| 2 | 2 | |
|---|
| 3 | 3 | VERSION="2.0" |
|---|
| 4 | | RELEASE="1" |
|---|
| | 4 | RELEASE="2" |
|---|
| 5 | 5 | ARCH=$(uname -i) |
|---|
| 6 | 6 | OS="RHEL5" |
|---|
| r193 |
r218 |
|
| 38 | 38 | |
|---|
| 39 | 39 | InstallAudit() { |
|---|
| | 40 | |
|---|
| 40 | 41 | Copy $AUDITDIR/auditd.conf /etc/audit/auditd.conf |
|---|
| 41 | | Copy $AUDITDIR/audit.rules /etc/audit/audit.rules |
|---|
| | 42 | if [ "$(uname -i)" == "x86_64" ] |
|---|
| | 43 | then |
|---|
| | 44 | Copy $AUDITDIR/audit-x86_64.rules /etc/audit/audit.rules |
|---|
| | 45 | else |
|---|
| | 46 | Copy $AUDITDIR/audit-i386.rules /etc/audit/audit.rules |
|---|
| | 47 | fi |
|---|
| | 48 | |
|---|
| 42 | 49 | auditctl -R /etc/audit/audit.rules |
|---|
| 43 | 50 | } |
|---|
| … | … | |
| 53 | 60 | for f in $MANDIR/*.8; do |
|---|
| 54 | 61 | Copy $f /usr/share/man/man8/$(basename $f) |
|---|
| 55 | | done |
|---|
| 56 | | } |
|---|
| 57 | | |
|---|
| 58 | | # Install a collection of scripts to make CLIP |
|---|
| 59 | | # STIG-compliant. |
|---|
| 60 | | # Since these scripts are not likely to be found on the system, |
|---|
| 61 | | # cp and not Copy() is used to install these files. |
|---|
| 62 | | InstallStig() { |
|---|
| 63 | | for d in $(ls -R $STIGFIXDIR); do |
|---|
| 64 | | cp -r $d /usr/share/clip/scripts/stig-fix &2>/dev/null |
|---|
| 65 | 62 | done |
|---|
| 66 | 63 | } |
|---|
| … | … | |
| 92 | 89 | InstallPam |
|---|
| 93 | 90 | InstallMan |
|---|
| 94 | | InstallStig |
|---|
| 95 | 91 | #RunStigFixes |
|---|
| r146 |
r218 |
|
| 28 | 28 | encryption or biometric access controls provide security for the benefit of |
|---|
| 29 | 29 | the USG. These protections are not provided for your benefit or privacy and |
|---|
| 30 | | may be modified or elimiated at the USG's discretion. |
|---|
| | 30 | may be modified or eliminated at the USG's discretion. |
|---|
| 31 | 31 | |
|---|
| 32 | 32 | EOF |
|---|
| r154 |
r218 |
|
| 10 | 10 | cat <<-EOF > /etc/pam.d/system-auth |
|---|
| 11 | 11 | #%PAM-1.0 |
|---|
| 12 | | auth required pam_tally.so deny=3 onerr=fail unlock_time=900 quiet |
|---|
| | 12 | auth required pam_tally.so deny=3 onerr=fail unlock_time=900 |
|---|
| 13 | 13 | |
|---|
| 14 | 14 | auth required pam_env.so |
|---|
| … | … | |
| 17 | 17 | account required pam_unix.so |
|---|
| 18 | 18 | account required pam_tally.so |
|---|
| 19 | | password required pam_cracklib.so try_first_pass retry=3 minlen=12 difok=3 dcredit=-2 ucredit=-2 ocredit=-2 lcredit=-2 |
|---|
| | 19 | password required pam_passwdqc.so min=disabled,disabled,disabled,disabled,14 max=40 passphrase=0 match=0 similar=deny random=0 enforce=everyone retry=3 |
|---|
| 20 | 20 | password required pam_unix.so md5 shadow nullok try_first_pass use_authtok remember=12 |
|---|
| 21 | 21 | |
|---|
| r113 |
r218 |
|
| 9 | 9 | echo 'Patching GEN000500: Set inactive shell timeout' |
|---|
| 10 | 10 | echo '===================================================' |
|---|
| 11 | | echo "TMOUT=900" >> /etc/profile |
|---|
| | 11 | echo "readonly TMOUT=900" >> /etc/profile |
|---|
| r115 |
r218 |
|
| 6 | 6 | echo ' Patching GEN000580: Set minimum Password length.' |
|---|
| 7 | 7 | echo '===================================================' |
|---|
| 8 | | sed --in-place "s/PASS_MIN_LEN[ \t]*[0-9]*/PASS_MIN_LEN\t8/" /etc/login.defs |
|---|
| | 8 | sed --in-place "s/PASS_MIN_LEN[ \t]*[0-9]*/PASS_MIN_LEN\t14/" /etc/login.defs |
|---|
| r144 |
r218 |
|
| 7 | 7 | echo ' between password changes' |
|---|
| 8 | 8 | echo '===================================================' |
|---|
| 9 | | sed -i '/^PASS_MAX_DAYS/ c\PASS_MAX_DAYS\t90' /etc/login.defs |
|---|
| | 9 | sed -i '/^PASS_MAX_DAYS/ c\PASS_MAX_DAYS\t60' /etc/login.defs |
|---|
| r115 |
r218 |
|
| 6 | 6 | echo ' Patching GEN002560: Set default umask.' |
|---|
| 7 | 7 | echo '===================================================' |
|---|
| 8 | | echo " |
|---|
| 9 | | # New files are only accessible to their owner by default. |
|---|
| 10 | | umask 077" >> /etc/bashrc |
|---|
| | 8 | sed -i "/umask/ c\umask 077" /etc/bashrc |
|---|
| | 9 | sed -i "/umask/ c\umask 077" /etc/csh.cshrc |
|---|
| r192 |
r218 |
|
| 22 | 22 | EOF |
|---|
| 23 | 23 | |
|---|
| | 24 | cat <<-EOF > /etc/audit/auditd.conf |
|---|
| | 25 | log_file = /var/log/audit/audit.log |
|---|
| | 26 | log_format = RAW |
|---|
| | 27 | priority_boost = 3 |
|---|
| | 28 | flush = INCREMENTAL |
|---|
| | 29 | freq = 20 |
|---|
| | 30 | num_logs = 4 |
|---|
| | 31 | dispatcher = /sbin/audispd |
|---|
| | 32 | max_log_file = 5 |
|---|
| | 33 | max_log_file_action = ROTATE |
|---|
| | 34 | space_left = 75 |
|---|
| | 35 | space_left_action = SYSLOG |
|---|
| | 36 | action_mail_acct = root |
|---|
| | 37 | admin_space_left = 50 |
|---|
| | 38 | admin_space_left_action = HALT |
|---|
| | 39 | disk_full_action = HALT |
|---|
| | 40 | disk_error_action = HALT |
|---|
| | 41 | EOF |
|---|
| | 42 | |
|---|
| r192 |
r218 |
|
| 8 | 8 | echo '===================================================' |
|---|
| 9 | 9 | cat <<-EOF >> /etc/audit/audit.rules |
|---|
| 10 | | # DAC permission changes |
|---|
| 11 | | -a exit,always -S chmod -S chown -S chown32 -S fchmod -S fchown -S fchown32 -S lchown -S lchown32 |
|---|
| 12 | | |
|---|
| | 10 | # DAC permission changes |
|---|
| 13 | 11 | EOF |
|---|
| | 12 | echo -n "-a exit,always -S chmod -S chown -S fchmod -S fchown -S lchown" >> /etc/audit/audit.rules |
|---|
| | 13 | if [ "$(uname -i)" != "x86_64" ] |
|---|
| | 14 | then |
|---|
| | 15 | echo -n " -S chown32 -S fchown32 -S lchown32" >> /etc/audit/audit.rules |
|---|
| | 16 | fi |
|---|
| | 17 | echo -e "\n" >> /etc/audit/audit.rules |
|---|
| r192 |
r218 |
|
| 7 | 7 | echo '===================================================' |
|---|
| 8 | 8 | cat <<-EOF >> /etc/audit/audit.rules |
|---|
| 9 | | # unauthorized file access attempts |
|---|
| 10 | | -a exit,always -F success=0 -S open -S mknod -S pipe -S mkdir -S creat -S truncate -S truncate64 -S ftruncate -S ftruncate64 |
|---|
| 11 | | |
|---|
| | 9 | # unauthorized file access attempts |
|---|
| 12 | 10 | EOF |
|---|
| | 11 | echo "-a exit,always -S open -F success=0" >> /etc/audit/audit.rules |
|---|
| | 12 | echo -n "-a exit,always -F success=0 -S mknod -S pipe -S mkdir -S creat -S truncate -S ftruncate" >> /etc/audit/audit.rules |
|---|
| | 13 | if [ "$(uname -i)" != "x86_64" ] |
|---|
| | 14 | then |
|---|
| | 15 | echo -n " -S truncate64 -S ftruncate64" >> /etc/audit/audit.rules |
|---|
| | 16 | fi |
|---|
| | 17 | echo -e "\n" >> /etc/audit/audit.rules |
|---|
| r192 |
r218 |
|
| 7 | 7 | echo '===================================================' |
|---|
| 8 | 8 | cat <<-EOF >> /etc/audit/audit.rules |
|---|
| 9 | | # privileged commands |
|---|
| 10 | | -a exit,always -S chroot -S mount -S umount -S umount2 -S adjtimex -S kill |
|---|
| 11 | | -w /usr/sbin/pwck |
|---|
| 12 | | -w /bin/chgrp |
|---|
| 13 | | -w /usr/bin/newgrp |
|---|
| 14 | | -w /usr/sbin/groupadd |
|---|
| 15 | | -w /usr/sbin/groupmod |
|---|
| 16 | | -w /usr/sbin/groupdel |
|---|
| 17 | | -w /usr/sbin/useradd |
|---|
| 18 | | -w /usr/sbin/userdel |
|---|
| 19 | | -w /usr/sbin/usermod |
|---|
| 20 | | -w /usr/bin/chage |
|---|
| 21 | | -w /usr/bin/setfacl |
|---|
| 22 | | -w /usr/bin/chacl |
|---|
| 23 | | |
|---|
| | 9 | # privileged commands |
|---|
| | 10 | -w /usr/sbin/pwck |
|---|
| | 11 | -w /bin/chgrp |
|---|
| | 12 | -w /usr/bin/newgrp |
|---|
| | 13 | -w /usr/sbin/groupadd |
|---|
| | 14 | -w /usr/sbin/groupmod |
|---|
| | 15 | -w /usr/sbin/groupdel |
|---|
| | 16 | -w /usr/sbin/useradd |
|---|
| | 17 | -w /usr/sbin/userdel |
|---|
| | 18 | -w /usr/sbin/usermod |
|---|
| | 19 | -w /usr/bin/chage |
|---|
| | 20 | -w /usr/bin/setfacl |
|---|
| | 21 | -w /usr/bin/chacl |
|---|
| 24 | 22 | EOF |
|---|
| | 23 | echo -n "-a exit,always -S chroot -S mount -S umount2 -S adjtimex -S kill" >> /etc/audit/audit.rules |
|---|
| | 24 | if [ "$(uname -i)" != "x86_64" ] |
|---|
| | 25 | then |
|---|
| | 26 | echo -n " -S umount" >> /etc/audit/audit.rules |
|---|
| | 27 | fi |
|---|
| | 28 | echo -e "\n" >> /etc/audit/audit.rules |
|---|
| r192 |
r218 |
|
| 7 | 7 | echo '===================================================' |
|---|
| 8 | 8 | cat <<-EOF >> /etc/audit/audit.rules |
|---|
| 9 | | # system administration actions |
|---|
| 10 | | # these two lines could be the cause of problems with filling audit logs and preventing system usage after installation |
|---|
| 11 | | -w /var/log/audit/audit.log |
|---|
| 12 | | -w /var/log/audit/audit[1-4].log |
|---|
| 13 | | -w /var/log/messages |
|---|
| 14 | | -w /var/log/lastlog |
|---|
| 15 | | -w /var/log/faillog |
|---|
| 16 | | -w /etc/audit/auditd.conf -p wa |
|---|
| 17 | | -w /etc/audit/audit.rules -p wa |
|---|
| 18 | | -w /etc/selinux/config -p wa |
|---|
| 19 | | -w /etc/passwd -p wa |
|---|
| 20 | | -w /etc/shadow -p wa |
|---|
| 21 | | -w /etc/group -p wa |
|---|
| 22 | | -w /etc/ssh/sshd_config |
|---|
| 23 | | -w /etc/pam.d |
|---|
| 24 | | -w /etc/login.defs |
|---|
| 25 | | -w /etc/rc.d/init.d |
|---|
| 26 | | -w /etc/inittab -p wa |
|---|
| 27 | | -w /var/run/utmp |
|---|
| 28 | | -w /var/run/wtmp |
|---|
| 29 | | -a exit,always -S acct -S reboot -S sched_setparam -S sched_setscheduler -S setdomainname -S setrlimit -S settimeofday -S stime -S swapon |
|---|
| 30 | | |
|---|
| | 9 | # system administration actions |
|---|
| | 10 | -w /var/log/audit/audit.log |
|---|
| | 11 | -w /var/log/audit/audit[1-4].log |
|---|
| | 12 | -w /var/log/messages |
|---|
| | 13 | -w /var/log/lastlog |
|---|
| | 14 | -w /var/log/faillog |
|---|
| | 15 | -w /etc/audit/auditd.conf -p wa |
|---|
| | 16 | -w /etc/audit/audit.rules -p wa |
|---|
| | 17 | -w /etc/selinux/config -p wa |
|---|
| | 18 | -w /etc/passwd -p wa |
|---|
| | 19 | -w /etc/shadow -p wa |
|---|
| | 20 | -w /etc/group -p wa |
|---|
| | 21 | -w /etc/ssh/sshd_config |
|---|
| | 22 | -w /etc/pam.d |
|---|
| | 23 | -w /etc/login.defs |
|---|
| | 24 | -w /etc/rc.d/init.d |
|---|
| | 25 | -w /etc/inittab -p wa |
|---|
| | 26 | -w /var/run/utmp |
|---|
| | 27 | -w /var/run/wtmp |
|---|
| 31 | 28 | EOF |
|---|
| | 29 | echo -n "-a exit,always -S acct -S reboot -S sched_setparam -S sched_setscheduler -S setdomainname -S setrlimit -S settimeofday -S swapon" >> /etc/audit/ audit.rules |
|---|
| | 30 | if [ "$(uname -i)" != "x86_64" ] |
|---|
| | 31 | then |
|---|
| | 32 | echo -n " -S stime" >> /etc/audit/audit.rules |
|---|
| | 33 | fi |
|---|
| | 34 | echo -e "\n" >> /etc/audit/audit.rules |
|---|
| r115 |
r218 |
|
| 6 | 6 | echo 'Patching GEN004500: Set mail log file permissions' |
|---|
| 7 | 7 | echo '===================================================' |
|---|
| 8 | | chmod 644 /var/log/maillog |
|---|
| | 8 | chmod 640 /var/log/maillog |
|---|
| r115 |
r218 |
|
| 8 | 8 | mv /etc/mail/helpfile /etc/mail/helpfile.bak |
|---|
| 9 | 9 | echo "" > /etc/mail/helpfile |
|---|
| | 10 | sed -i '/HelpFile/s/^/#/' /etc/mail/sendmail.cf |
|---|
| r121 |
r218 |
|
| 12 | 12 | /usr/sbin/userdel gopher |
|---|
| 13 | 13 | /usr/sbin/userdel nfsnobody |
|---|
| | 14 | /usr/sbin/userdel ftp |
|---|
| r144 |
r218 |
|
| 7 | 7 | echo ' initialization files' |
|---|
| 8 | 8 | echo '===================================================' |
|---|
| 9 | | for FILE in /etc/{profile,bashrc,environment}; do |
|---|
| | 9 | for FILE in /etc/{profile,bashrc}; do |
|---|
| 10 | 10 | echo "mesg n" >> $FILE |
|---|
| 11 | 11 | done; |
|---|
Download in other formats:
* Generating other formats may take time.