| 404 | | # |
|---|
| 405 | | # 4.B.4.a(6)(a) |
|---|
| 406 | | # KickStart Actions: None |
|---|
| 407 | | # |
|---|
| 408 | | # |
|---|
| 409 | | # 4.B.4.a(6)(b) |
|---|
| 410 | | # KickStart Actions: Reset the permissions of /etc/syslog.conf to 640 and set |
|---|
| 411 | | # /var/{run,log}/{wtmp,utmp} files to 664. |
|---|
| 412 | | # |
|---|
| 413 | | # GEN005400 |
|---|
| 414 | | # Reset the permissions to a DISA-blessed rw-r----- |
|---|
| 415 | | echo "Locking down GEN005400" |
|---|
| 416 | | chmod 640 /etc/syslog.conf |
|---|
| 417 | | echo "GEN005400 Complete" |
|---|
| 418 | | # |
|---|
| 419 | | # GEN001260 |
|---|
| 420 | | echo "Locking down GEN001260" |
|---|
| 421 | | perl -npe 's%chmod 0664 /var/run/utmp /var/log/wtmp%chmod 0644 /var/run/utmp /var/log/wtmp%g' -i /etc/rc.d/rc.sysinit |
|---|
| 422 | | echo "GEN001260 Complete" |
|---|
| 423 | | # |
|---|
| 424 | | # 4.B.4.a(6)(c) |
|---|
| 425 | | # KickStart Actions: Log rotation to 90 days (12 weeks) and turn compression on. |
|---|
| 426 | | # This will have to up'd if system does not retain backups |
|---|
| 427 | | # for 5 years (e.g., tape backup). |
|---|
| 428 | | # |
|---|
| 429 | | for logconf in `ls -1 /etc/logrotate.conf` |
|---|
| 430 | | do |
|---|
| 431 | | perl -npe 's/rotate\s+4/rotate 12/' -i $logconf |
|---|
| 432 | | perl -npe 's/\#compress/compress/' -i $logconf |
|---|
| 433 | | done |
|---|
| 434 | | # |
|---|
| 435 | | # GEN002860 (G674) |
|---|
| 436 | | # Rotate the audit-logs on a daily basis--keep them all |
|---|
| 437 | | cat <<EOF > /etc/logrotate.d/audit |
|---|
| 438 | | /var/log/audit/audit.log |
|---|
| 439 | | { |
|---|
| 440 | | daily |
|---|
| 441 | | notifempty |
|---|
| 442 | | missingok |
|---|
| 443 | | postrotate |
|---|
| 444 | | /sbin/service auditd restart 2> /dev/null > /dev/null || true |
|---|
| 445 | | endscript |
|---|
| 446 | | } |
|---|
| 447 | | EOF |
|---|
| 448 | | echo "GEN002860 Complete" |
|---|
| 449 | | # |
|---|
| 450 | | # 4.B.4.a(6)(d) |
|---|
| 451 | | # KickStart Actions: Turn on the Audit Daemon and set permissions |
|---|
| 452 | | # |
|---|
| 453 | | # GEN002660 |
|---|
| 454 | | # Turn on the Audit Daemon |
|---|
| 455 | | echo "Locking down GEN002660" |
|---|
| 456 | | chkconfig auditd on |
|---|
| 457 | | echo "GEN002660 Complete" |
|---|
| 458 | | # |
|---|
| 459 | | # GEN002680 (G094) |
|---|
| 460 | | # Reset permissions on audit logs |
|---|
| 461 | | echo "Locking down GEN002680" |
|---|
| 462 | | chmod 700 /var/log/audit |
|---|
| 463 | | chmod 600 /var/log/audit/* |
|---|
| 464 | | echo "GEN002680 Complete" |
|---|
| 465 | | # |
|---|
| 466 | | # |
|---|
| 467 | | # 4.B.4.a(6)(d)(1) |
|---|
| 468 | | # KickStart Actions: None, This is met with the /var/log/wtmp and |
|---|
| 469 | | # /var/log/utmp files. Permissions have been set |
|---|
| 470 | | # correctly above. |
|---|
| 471 | | # See Section 4.B.4.a(6)(d)(2) |
|---|
| 472 | | # |
|---|
| 473 | | # 4.B.4.a(6)(d)(2) |
|---|
| 474 | | # KickStart Actions: This will require refinement. |
|---|
| 475 | | # Commented rules do not insert w/o an error. |
|---|
| 476 | | # |
|---|
| 477 | | cat <<EOF > /etc/audit.rules |
|---|
| 478 | | |
|---|
| 479 | | ## Remove any existing rules |
|---|
| 480 | | -D |
|---|
| 481 | | ## Increase buffer size to handle the increased number of messages. |
|---|
| 482 | | ## Feel free to increase this if the machine panic's |
|---|
| 483 | | -b 8192 |
|---|
| 484 | | ## Set failure mode to panic |
|---|
| 485 | | # -f 2 |
|---|
| 486 | | # |
|---|
| 487 | | # GEN002720 |
|---|
| 488 | | ## Audits for failed attempts to access files and programs. |
|---|
| 489 | | echo "Locking down GEN002720" |
|---|
| 490 | | |
|---|
| 491 | | -a exit,always -S mknod -F success=0 |
|---|
| 492 | | -a exit,possible -S open -F success=0 |
|---|
| 493 | | -a exit,possible -S pipe -F success=0 |
|---|
| 494 | | -a exit,possible -S mkdir -F success=0 |
|---|
| 495 | | -a exit,possible -S creat -F success=0 |
|---|
| 496 | | #LEAK |
|---|
| 497 | | # MOD |
|---|
| 498 | | -a exit,possible -S truncate -F success=0 |
|---|
| 499 | | -a exit,possible -S truncate64 -F success=0 |
|---|
| 500 | | -a exit,possible -S ftruncate -F success=0 |
|---|
| 501 | | -a exit,possible -S ftruncate64 -F success=0 |
|---|
| 502 | | # |
|---|
| 503 | | echo "GEN002720 Complete" |
|---|
| 504 | | # |
|---|
| 505 | | # GEN002740 |
|---|
| 506 | | ## Audit for files and programs deleted by user |
|---|
| 507 | | echo "Locking down GEN002740" |
|---|
| 508 | | -a exit,possible -S unlink -F success!=0 |
|---|
| 509 | | -a exit,possible -S rmdir -F success!=0 |
|---|
| 510 | | -a exit,possible -w /bin/rm -F success=0 -F success!=0 |
|---|
| 511 | | -a exit,possible -S rename -F success!=0 |
|---|
| 512 | | # |
|---|
| 513 | | echo "GEN002740 Complete" |
|---|
| 514 | | # |
|---|
| 515 | | # GEN002760 |
|---|
| 516 | | echo "Locking down GEN002760" |
|---|
| 517 | | ## Audit all administrative actions |
|---|
| 518 | | # AUD_it |
|---|
| 519 | | # Backup_export |
|---|
| 520 | | # Dev_change |
|---|
| 521 | | # Dev_configure |
|---|
| 522 | | # Dev_create |
|---|
| 523 | | -a exit,possible -S chown -F success!=0 |
|---|
| 524 | | -a exit,possible -S chown32 -F success!=0 |
|---|
| 525 | | -a exit,possible -S fchown -F success!=0 |
|---|
| 526 | | -a exit,possible -S fchown32 -F success!=0 |
|---|
| 527 | | -a exit,possible -S lchown -F success!=0 |
|---|
| 528 | | -a exit,possible -S lchown32 -F success!=0 |
|---|
| 529 | | -a exit,always -S chroot -F success!=0 |
|---|
| 530 | | -a exit,always -S mount -F success=0 -F success!=0 |
|---|
| 531 | | -a exit,always -S umount -F success=0 -F success!=0 |
|---|
| 532 | | -a exit,always -S umount2 -F success=0 -F success!=0 |
|---|
| 533 | | -a exit,always -w /usr/sbin/pwck -F success=0 -F success!=0 |
|---|
| 534 | | -a exit,always -S adjtimex -F success!=0 |
|---|
| 535 | | -a exit,always -S settimeofday -F success!=0 |
|---|
| 536 | | -a exit,always -S kill -F success=0 -F success!=0 |
|---|
| 537 | | # |
|---|
| 538 | | #Proc_privilege |
|---|
| 539 | | -a exit,always -w /bin/chgrp -F success=0 -F success!=0 |
|---|
| 540 | | -a exit,always -w /usr/bin/newgrp -F success=0 -F success!=0 |
|---|
| 541 | | -a exit,always -w /usr/sbin/groupadd -F success=0 -F success!=0 |
|---|
| 542 | | -a exit,always -w /usr/sbin/groupmod -F success=0 -F success!=0 |
|---|
| 543 | | -a exit,always -w /usr/sbin/groupdel -F success=0 -F success!=0 |
|---|
| 544 | | # Restore imports |
|---|
| 545 | | # |
|---|
| 546 | | # TCBCK_delete |
|---|
| 547 | | -a exit,possible -w /usr/sbin/useradd -F success=0 -F success!=0 |
|---|
| 548 | | -a exit,possible -w /usr/sbin/userdel -F success=0 -F success!=0 |
|---|
| 549 | | -a exit,possible -w /usr/sbin/usermod -F success=0 -F success!=0 |
|---|
| 550 | | -a exit,possible -w /usr/bin/chage -F success=0 -F success!=0 |
|---|
| 551 | | -a exit,possible -S reboot -F success!=0 |
|---|
| 552 | | # User_setenv |
|---|
| 553 | | # |
|---|
| 554 | | echo "GEN002760 Complete" |
|---|
| 555 | | |
|---|
| 556 | | ## |
|---|
| 557 | | ## 4.B.4.a(6)(d)(1) |
|---|
| 558 | | # |
|---|
| 559 | | # GEN002780 |
|---|
| 560 | | echo "Locking down GEN002780" |
|---|
| 561 | | ## Audit all security actions |
|---|
| 562 | | -w /bin/login -p x |
|---|
| 563 | | -a exit,possible -w /bin/logout -F success!=0 |
|---|
| 564 | | -a exit,possible -S init_module -F success!=0 |
|---|
| 565 | | -a exit,possible -S delete_module -F success!=0 |
|---|
| 566 | | -a exit,possible -w /bin/su -F success!=0 |
|---|
| 567 | | # |
|---|
| 568 | | echo "GEN002780 Complete" |
|---|
| 569 | | # |
|---|
| 570 | | # GEN002800 |
|---|
| 571 | | echo "Locking down GEN002800" |
|---|
| 572 | | ## Audit use of privileged commands |
|---|
| 573 | | -a exit,possible -w /usr/bin/setfacl -F success=0 -F success!=0 |
|---|
| 574 | | -a exit,possible -w /usr/bin/chacl -F success=0 -F success!=0 |
|---|
| 575 | | -a exit,possible -S chmod -F success=0 -F success!=0 |
|---|
| 576 | | -a exit,possible -S fchmod -F success=0 -F success!=0 |
|---|
| 577 | | -a exit,possible -S link -F success=0 -F success!=0 |
|---|
| 578 | | -a exit,possible -S symlink -F success=0 -F success!=0 |
|---|
| 579 | | # Proc_realgid |
|---|
| 580 | | # Proc_setuserids |
|---|
| 581 | | # |
|---|
| 582 | | echo "GEN002800 Complete" |
|---|
| 583 | | # |
|---|
| 584 | | ## ??????????? |
|---|
| 585 | | ## Audit application and session initiation |
|---|
| 586 | | ## Proc_Delete |
|---|
| 587 | | # |
|---|
| 588 | | # ???????????? |
|---|
| 589 | | EOF |
|---|
| 590 | | # |
|---|
| 591 | | # 4.B.4.a(6)(d)(3) |
|---|
| 592 | | # KickStart Actions: All authentication attemps will be monitored |
|---|
| 593 | | # in /var/log/messages. |
|---|
| 594 | | # |
|---|
| 595 | | # GEN003660 |
|---|
| 596 | | echo "Locking down GEN003660" |
|---|
| 597 | | echo "auth.notice /var/log/messages" >> /etc/syslog.conf |
|---|
| 598 | | echo "GEN003660 Complete" |
|---|
| 599 | | # |
|---|
| 600 | | # |
|---|
| | 396 | |
|---|
| | 397 | # 4.B.4.a(6)(a) |
|---|
| | 398 | # KickStart Actions: None |
|---|
| | 399 | |
|---|
| | 400 | # 4.B.4.a(6)(b) |
|---|
| | 401 | # KickStart Actions: Reset the permissions of /etc/syslog.conf to 640 and set |
|---|
| | 402 | # /var/{run,log}/{wtmp,utmp} files to 664. |
|---|
| | 403 | |
|---|
| | 404 | ## (GEN005400: CAT II) (Previously â G656) The SA will ensure the owner of the |
|---|
| | 405 | ## /etc/syslog.conf file is root with permissions of 640, or more restrictive. |
|---|
| | 406 | chown root /etc/syslog.conf |
|---|
| | 407 | chmod 640 /etc/syslog.conf |
|---|
| | 408 | |
|---|
| | 409 | ## (GEN001260: CAT II) (Previously â G037) The SA will ensure all system log |
|---|
| | 410 | ## files have permissions of 640, or more restrictive. |
|---|
| | 411 | ## TODO: Is this correct? |
|---|
| | 412 | perl -npe 's%chmod 0664 /var/run/utmp /var/log/wtmp%chmod 0644 /var/run/utmp /var/log/wtmp%g' -i /etc/rc.d/rc.sysinit |
|---|
| | 413 | |
|---|
| | 414 | # 4.B.4.a(6)(c) |
|---|
| | 415 | # KickStart Actions: Log rotation to 90 days (12 weeks) and turn compression on. |
|---|
| | 416 | # This will have to up'd if system does not retain backups |
|---|
| | 417 | # for 5 years (e.g., tape backup). |
|---|
| | 418 | |
|---|
| | 419 | for logconf in `ls -1 /etc/logrotate.conf` |
|---|
| | 420 | do |
|---|
| | 421 | perl -npe 's/rotate\s+4/rotate 12/' -i $logconf |
|---|
| | 422 | perl -npe 's/\#compress/compress/' -i $logconf |
|---|
| | 423 | done |
|---|
| | 424 | |
|---|
| | 425 | ## (GEN002860: CAT II) (Previously â G674) The SA and/or IAO will ensure old |
|---|
| | 426 | ## audit logs are closed and new audit logs are started daily. |
|---|
| | 427 | cat <<-EOF > /etc/logrotate.d/audit |
|---|
| | 428 | /var/log/audit/audit.log |
|---|
| | 429 | { |
|---|
| | 430 | daily |
|---|
| | 431 | notifempty |
|---|
| | 432 | missingok |
|---|
| | 433 | postrotate |
|---|
| | 434 | /sbin/service auditd restart 2> /dev/null > /dev/null || true |
|---|
| | 435 | endscript |
|---|
| | 436 | } |
|---|
| | 437 | EOF |
|---|
| | 438 | |
|---|
| | 439 | # 4.B.4.a(6)(d) |
|---|
| | 440 | # KickStart Actions: Turn on the Audit Daemon and set permissions |
|---|
| | 441 | |
|---|
| | 442 | ## (GEN002660: CAT II) (Previously â G093) The SA will configure and implement |
|---|
| | 443 | ## auditing. |
|---|
| | 444 | chkconfig auditd on |
|---|
| | 445 | |
|---|
| | 446 | ## (GEN002680: CAT II) (Previously â G094) The SA will ensure audit data files |
|---|
| | 447 | ## and directories will be readable only by personnel authorized by the IAO. |
|---|
| | 448 | chmod 700 /var/log/audit |
|---|
| | 449 | |
|---|
| | 450 | ## (GEN002700: CAT I) (Previously â G095) The SA will ensure audit data files |
|---|
| | 451 | ## have permissions of 640, or more restrictive. |
|---|
| | 452 | chmod 600 /var/log/audit/* |
|---|
| | 453 | |
|---|
| | 454 | # 4.B.4.a(6)(d)(1) |
|---|
| | 455 | # KickStart Actions: None, This is met with the /var/log/wtmp and |
|---|
| | 456 | # /var/log/utmp files. Permissions have been set |
|---|
| | 457 | # correctly above. |
|---|
| | 458 | # See Section 4.B.4.a(6)(d)(2) |
|---|
| | 459 | |
|---|
| | 460 | # 4.B.4.a(6)(d)(2) |
|---|
| | 461 | # KickStart Actions: This will require refinement. |
|---|
| | 462 | # Commented rules do not insert w/o an error. |
|---|
| | 463 | |
|---|
| | 464 | ## (GEN002720-GEN002840: CAT II) (Previously â G100-G106) The SA will configure the |
|---|
| | 465 | ## auditing system to audit the following events for all users and root: |
|---|
| | 466 | ## FIXME: This should be split up |
|---|
| | 467 | cat <<-EOF > /etc/audit.rules |
|---|
| | 468 | ## Remove any existing rules |
|---|
| | 469 | -D |
|---|
| | 470 | ## Increase buffer size to handle the increased number of messages. |
|---|
| | 471 | ## Feel free to increase this if the machine panic's |
|---|
| | 472 | -b 8192 |
|---|
| | 473 | ## Set failure mode to panic |
|---|
| | 474 | # -f 2 |
|---|
| | 475 | # |
|---|
| | 476 | # GEN002720 |
|---|
| | 477 | ## Audits for failed attempts to access files and programs. |
|---|
| | 478 | -a exit,always -S mknod -F success=0 |
|---|
| | 479 | -a exit,possible -S open -F success=0 |
|---|
| | 480 | -a exit,possible -S pipe -F success=0 |
|---|
| | 481 | -a exit,possible -S mkdir -F success=0 |
|---|
| | 482 | -a exit,possible -S creat -F success=0 |
|---|
| | 483 | #LEAK |
|---|
| | 484 | # MOD |
|---|
| | 485 | -a exit,possible -S truncate -F success=0 |
|---|
| | 486 | -a exit,possible -S truncate64 -F success=0 |
|---|
| | 487 | -a exit,possible -S ftruncate -F success=0 |
|---|
| | 488 | -a exit,possible -S ftruncate64 -F success=0 |
|---|
| | 489 | |
|---|
| | 490 | # GEN002740 |
|---|
| | 491 | ## Audit for files and programs deleted by user |
|---|
| | 492 | -a exit,possible -S unlink -F success!=0 |
|---|
| | 493 | -a exit,possible -S rmdir -F success!=0 |
|---|
| | 494 | -a exit,possible -w /bin/rm -F success=0 -F success!=0 |
|---|
| | 495 | -a exit,possible -S rename -F success!=0 |
|---|
| | 496 | |
|---|
| | 497 | # GEN002760 |
|---|
| | 498 | ## Audit all administrative actions |
|---|
| | 499 | # AUD_it |
|---|
| | 500 | # Backup_export |
|---|
| | 501 | # Dev_change |
|---|
| | 502 | # Dev_configure |
|---|
| | 503 | # Dev_create |
|---|
| | 504 | -a exit,possible -S chown -F success!=0 |
|---|
| | 505 | -a exit,possible -S chown32 -F success!=0 |
|---|
| | 506 | -a exit,possible -S fchown -F success!=0 |
|---|
| | 507 | -a exit,possible -S fchown32 -F success!=0 |
|---|
| | 508 | -a exit,possible -S lchown -F success!=0 |
|---|
| | 509 | -a exit,possible -S lchown32 -F success!=0 |
|---|
| | 510 | -a exit,always -S chroot -F success!=0 |
|---|
| | 511 | -a exit,always -S mount -F success=0 -F success!=0 |
|---|
| | 512 | -a exit,always -S umount -F success=0 -F success!=0 |
|---|
| | 513 | -a exit,always -S umount2 -F success=0 -F success!=0 |
|---|
| | 514 | -a exit,always -w /usr/sbin/pwck -F success=0 -F success!=0 |
|---|
| | 515 | -a exit,always -S adjtimex -F success!=0 |
|---|
| | 516 | -a exit,always -S settimeofday -F success!=0 |
|---|
| | 517 | -a exit,always -S kill -F success=0 -F success!=0 |
|---|
| | 518 | |
|---|
| | 519 | #Proc_privilege |
|---|
| | 520 | -a exit,always -w /bin/chgrp -F success=0 -F success!=0 |
|---|
| | 521 | -a exit,always -w /usr/bin/newgrp -F success=0 -F success!=0 |
|---|
| | 522 | -a exit,always -w /usr/sbin/groupadd -F success=0 -F success!=0 |
|---|
| | 523 | -a exit,always -w /usr/sbin/groupmod -F success=0 -F success!=0 |
|---|
| | 524 | -a exit,always -w /usr/sbin/groupdel -F success=0 -F success!=0 |
|---|
| | 525 | # Restore imports |
|---|
| | 526 | |
|---|
| | 527 | # TCBCK_delete |
|---|
| | 528 | -a exit,possible -w /usr/sbin/useradd -F success=0 -F success!=0 |
|---|
| | 529 | -a exit,possible -w /usr/sbin/userdel -F success=0 -F success!=0 |
|---|
| | 530 | -a exit,possible -w /usr/sbin/usermod -F success=0 -F success!=0 |
|---|
| | 531 | -a exit,possible -w /usr/bin/chage -F success=0 -F success!=0 |
|---|
| | 532 | -a exit,possible -S reboot -F success!=0 |
|---|
| | 533 | # User_setenv |
|---|
| | 534 | |
|---|
| | 535 | ## |
|---|
| | 536 | ## 4.B.4.a(6)(d)(1) |
|---|
| | 537 | # |
|---|
| | 538 | # GEN002780 |
|---|
| | 539 | ## Audit all security actions |
|---|
| | 540 | -w /bin/login -p x |
|---|
| | 541 | -a exit,possible -w /bin/logout -F success!=0 |
|---|
| | 542 | -a exit,possible -S init_module -F success!=0 |
|---|
| | 543 | -a exit,possible -S delete_module -F success!=0 |
|---|
| | 544 | -a exit,possible -w /bin/su -F success!=0 |
|---|
| | 545 | |
|---|
| | 546 | # GEN002800 |
|---|
| | 547 | ## Audit use of privileged commands |
|---|
| | 548 | -a exit,possible -w /usr/bin/setfacl -F success=0 -F success!=0 |
|---|
| | 549 | -a exit,possible -w /usr/bin/chacl -F success=0 -F success!=0 |
|---|
| | 550 | -a exit,possible -S chmod -F success=0 -F success!=0 |
|---|
| | 551 | -a exit,possible -S fchmod -F success=0 -F success!=0 |
|---|
| | 552 | -a exit,possible -S link -F success=0 -F success!=0 |
|---|
| | 553 | -a exit,possible -S symlink -F success=0 -F success!=0 |
|---|
| | 554 | # Proc_realgid |
|---|
| | 555 | # Proc_setuserids |
|---|
| | 556 | |
|---|
| | 557 | ## ??????????? |
|---|
| | 558 | ## Audit application and session initiation |
|---|
| | 559 | ## Proc_Delete |
|---|
| | 560 | # |
|---|
| | 561 | # ???????????? |
|---|
| | 562 | EOF |
|---|
| | 563 | |
|---|
| | 564 | # 4.B.4.a(6)(d)(3) |
|---|
| | 565 | # KickStart Actions: All authentication attemps will be monitored |
|---|
| | 566 | # in /var/log/messages. |
|---|
| | 567 | |
|---|
| | 568 | ## (GEN003660: CAT II) The SA will ensure the authentication notice and |
|---|
| | 569 | ## informational data is logged. |
|---|
| | 570 | echo "auth.notice /var/log/messages" >> /etc/syslog.conf |
|---|
| | 571 | |
|---|
| 653 | | |
|---|
| 654 | | # |
|---|
| 655 | | # 4.B.4.a(11)(a) |
|---|
| 656 | | # KickStart Actions: None |
|---|
| 657 | | |
|---|
| 658 | | # |
|---|
| 659 | | # 4.B.4.a(11)(b) |
|---|
| 660 | | # KickStart Actions: None |
|---|
| 661 | | |
|---|
| 662 | | # |
|---|
| 663 | | # 4.B.4.a(11)(c) |
|---|
| 664 | | # KickStart Actions: The following item have been set to meet this policy. |
|---|
| 665 | | # Note: |
|---|
| 666 | | # Investigating using PAM for preventing 10 recent passwords- doesn't appear |
|---|
| 667 | | # to be easily done using pam_passwdqc |
|---|
| 668 | | |
|---|
| 669 | | # Passwd strength |
|---|
| 670 | | cat <<EOF > /etc/pam.d/system-auth |
|---|
| 671 | | # %PAM-1.0 |
|---|
| 672 | | # This file is auto-generated. |
|---|
| 673 | | # User changes will be destroyed the next time authconfig is run. |
|---|
| 674 | | auth required /lib/security/$ISA/pam_env.so |
|---|
| 675 | | auth sufficient /lib/security/$ISA/pam_unix.so likeauth nullok |
|---|
| 676 | | auth required /lib/security/$ISA/pam_deny.so |
|---|
| 677 | | auth required /lib/security/pam_tally.so onerr=fail no_magic_root |
|---|
| 678 | | |
|---|
| 679 | | account required /lib/security/$ISA/pam_unix.so |
|---|
| 680 | | account sufficient /lib/security/$ISA/pam_succeed_if.so uid < 100 quiet |
|---|
| 681 | | account required /lib/security/$ISA/pam_permit.so |
|---|
| 682 | | account required /lib/security/pam_tally.so deny=3 reset no_magic_root |
|---|
| 683 | | |
|---|
| 684 | | password required /lib/security/$ISA/pam_passwdqc.so enforce=users ask_oldauthok=update |
|---|
| 685 | | password sufficient /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow remember=10 |
|---|
| 686 | | password required /lib/security/$ISA/pam_deny.so |
|---|
| 687 | | |
|---|
| 688 | | session required /lib/security/$ISA/pam_limits.so |
|---|
| 689 | | session required /lib/security/$ISA/pam_unix.so |
|---|
| 690 | | EOF |
|---|
| 691 | | |
|---|
| 692 | | # Password Strength Settings /etc/login.defs |
|---|
| 693 | | # GEN000 |
|---|
| 694 | | echo "Locking down GEN000580" |
|---|
| 695 | | perl -npe 's/PASS_MIN_LEN\s+5/PASS_MIN_LEN 9/' -i /etc/login.defs |
|---|
| 696 | | #STIG specifies using following, but it's not a valid parameter |
|---|
| 697 | | #echo "PASSLENGTH 9" >> /etc/login.defs |
|---|
| 698 | | echo "GEN000580 Complete" |
|---|
| 699 | | # |
|---|
| 700 | | # 4.B.4.a(11)(d) |
|---|
| 701 | | # KickStart Actions: None - PROCEDURAL REQUIREMENT |
|---|
| 702 | | # |
|---|
| 703 | | # 4.B.4.a(11)(e) |
|---|
| 704 | | # KickStart Actions: Change the password expiration time from undefined to 60 days. |
|---|
| 705 | | # Users cannot change passwords more than once a day. |
|---|
| 706 | | # |
|---|
| 707 | | # Change the password expiration time from undefined to 60 days |
|---|
| 708 | | # GEN000700 |
|---|
| 709 | | echo "Locking down GEN000700" |
|---|
| 710 | | perl -npe 's/PASS_MAX_DAYS\s+99999/PASS_MAX_DAYS 60/' -i /etc/login.defs |
|---|
| 711 | | chage -M 60 root |
|---|
| 712 | | echo "GEN000700 Complete" |
|---|
| 713 | | # |
|---|
| 714 | | # Ensure that the user cannot change their password more than once a day. |
|---|
| 715 | | # GEN000540 |
|---|
| 716 | | echo "Locking down GEN000540" |
|---|
| 717 | | perl -npe 's/PASS_MIN_DAYS\s+0/PASS_MIN_DAYS 1/g' -i /etc/login.defs |
|---|
| 718 | | echo "GEN000540 Complete" |
|---|
| 719 | | # |
|---|
| 720 | | # 4.B.4.a(11)(f) |
|---|
| 721 | | # KickStart Actions: opasswd file creation in /etc/security/opasswd |
|---|
| 722 | | # for non-replication. |
|---|
| 723 | | |
|---|
| 724 | | touch /etc/security/opasswd |
|---|
| 725 | | chmod 600 /etc/security/opasswd |
|---|
| 726 | | |
|---|
| 727 | | # |
|---|
| 728 | | # 4.B.4.a(11)(g) |
|---|
| 729 | | # Protection of authenticators to perserve confidentiality and |
|---|
| 730 | | # integrity. Red Hat encrypts authenticators using the MD5 |
|---|
| 731 | | # Message Digest. |
|---|
| 732 | | # KickStart Actions: Additional I&A Security. |
|---|
| 733 | | |
|---|
| 734 | | |
|---|
| 735 | | # |
|---|
| | 611 | # 4.B.4.a(11)(a) |
|---|
| | 612 | # KickStart Actions: None |
|---|
| | 613 | |
|---|
| | 614 | # 4.B.4.a(11)(b) |
|---|
| | 615 | # KickStart Actions: None |
|---|
| | 616 | |
|---|
| | 617 | # 4.B.4.a(11)(c) |
|---|
| | 618 | # KickStart Actions: The following item have been set to meet this policy. |
|---|
| | 619 | # Note: |
|---|
| | 620 | # Investigating using PAM for preventing 10 recent passwords- doesn't appear |
|---|
| | 621 | # to be easily done using pam_passwdqc |
|---|
| | 622 | |
|---|
| | 623 | # Passwd strength |
|---|
| | 624 | cat <<-EOF > /etc/pam.d/system-auth |
|---|
| | 625 | # %PAM-1.0 |
|---|
| | 626 | # This file is auto-generated. |
|---|
| | 627 | # User changes will be destroyed the next time authconfig is run. |
|---|
| | 628 | auth required /lib/security/$ISA/pam_env.so |
|---|
| | 629 | auth sufficient /lib/security/$ISA/pam_unix.so likeauth nullok |
|---|
| | 630 | auth required /lib/security/$ISA/pam_deny.so |
|---|
| | 631 | auth required /lib/security/pam_tally.so onerr=fail no_magic_root |
|---|
| | 632 | account required /lib/security/$ISA/pam_unix.so |
|---|
| | 633 | account sufficient /lib/security/$ISA/pam_succeed_if.so uid < 100 quiet |
|---|
| | 634 | account required /lib/security/$ISA/pam_permit.so |
|---|
| | 635 | account required /lib/security/pam_tally.so deny=3 reset no_magic_root |
|---|
| | 636 | password required /lib/security/$ISA/pam_passwdqc.so enforce=users #ask_oldauthok=update |
|---|
| | 637 | password sufficient /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow remember=10 |
|---|
| | 638 | password required /lib/security/$ISA/pam_deny.so |
|---|
| | 639 | |
|---|
| | 640 | session required /lib/security/$ISA/pam_limits.so |
|---|
| | 641 | session required /lib/security/$ISA/pam_unix.so |
|---|
| | 642 | EOF |
|---|
| | 643 | |
|---|
| | 644 | ## (GEN000580: CAT II) (Previously â G019) The IAO will ensure all passwords contain a |
|---|
| | 645 | ## minimum of eight characters. |
|---|
| | 646 | sed -i "s/PASS_MIN_LEN[ \t]*[0-9]*/PASS_MIN_LEN\t8/" /etc/login.defs |
|---|
| | 647 | |
|---|
| | 648 | # 4.B.4.a(11)(d) |
|---|
| | 649 | # KickStart Actions: None - PROCEDURAL REQUIREMENT |
|---|
| | 650 | |
|---|
| | 651 | # 4.B.4.a(11)(e) |
|---|
| | 652 | # KickStart Actions: Change the password expiration time from undefined to 60 days. |
|---|
| | 653 | # Users cannot change passwords more than once a day. |
|---|
| | 654 | |
|---|
| | 655 | ## (GEN000700: CAT II) (Previously â G020) The SA will ensure passwords are |
|---|
| | 656 | ## changed at least every 90 days. |
|---|
| | 657 | sed -i '/^PASS_MAX_DAYS/ c\PASS_MAX_DAYS\t90' /etc/login.defs |
|---|
| | 658 | |
|---|
| | 659 | ## (GEN000540: CAT II) (Previously â G004) The SA will ensure passwords are |
|---|
| | 660 | ## not changed more than once a day. |
|---|
| | 661 | sed -i '/^PASS_MIN_DAYS/ c\PASS_MIN_DAYS\t1' /etc/login.defs |
|---|
| | 662 | |
|---|
| | 663 | # 4.B.4.a(11)(f) |
|---|
| | 664 | # KickStart Actions: opasswd file creation in /etc/security/opasswd |
|---|
| | 665 | # for non-replication. |
|---|
| | 666 | |
|---|
| | 667 | touch /etc/security/opasswd |
|---|
| | 668 | chmod 600 /etc/security/opasswd |
|---|
| | 669 | |
|---|
| | 670 | # 4.B.4.a(11)(g) |
|---|
| | 671 | # KickStart Actions: Additional I&A Security. |
|---|
| | 672 | # Protection of authenticators to perserve confidentiality and |
|---|
| | 673 | # integrity. Red Hat encrypts authenticators using the MD5 |
|---|
| | 674 | # Message Digest. |
|---|
| | 675 | |
|---|
| 786 | | # |
|---|
| 787 | | # |
|---|
| 788 | | # Further restricting root logins |
|---|
| 789 | | # GEN000xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
|---|
| 790 | | #investigating by using PAM for preventing 10 recent passwords- doesn't appear |
|---|
| 791 | | # to be easily done using pam_passwdqc |
|---|
| 792 | | # Further restricting root logins |
|---|
| 793 | | echo "Locking down GEN00xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" |
|---|
| 794 | | cat << EOF > /etc/pam.d/su |
|---|
| 795 | | # %PAM-1.0 |
|---|
| 796 | | auth sufficient /lib/security/$ISA/pam_rootok.so |
|---|
| 797 | | # Uncomment the following line to implicitly trust users in the "wheel" group. |
|---|
| 798 | | # auth sufficient /lib/security/$ISA/pam_wheel.so trust use_uid |
|---|
| 799 | | # Uncomment the following line to require a user to be in the "wheel" group. |
|---|
| 800 | | auth required /lib/security/$ISA/pam_wheel.so use_uid |
|---|
| 801 | | auth required /lib/security/$ISA/pam_stack.so service=system-auth |
|---|
| 802 | | account required /lib/security/$ISA/pam_stack.so service=system-auth |
|---|
| 803 | | password required /lib/security/$ISA/pam_stack.so service=system-auth |
|---|
| 804 | | # pam_selinux.so close must be first session rule |
|---|
| 805 | | session required /lib/security/$ISA/pam_selinux.so close |
|---|
| 806 | | session required /lib/security/$ISA/pam_stack.so service=system-auth |
|---|
| 807 | | # pam_selinux.so open and pam_xauth must be last two session rules |
|---|
| 808 | | session required /lib/security/$ISA/pam_selinux.so open multiple |
|---|
| 809 | | session optional /lib/security/$ISA/pam_xauth.so |
|---|
| 810 | | EOF |
|---|
| 811 | | echo "GEN00xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Complete" |
|---|
| 812 | | # |
|---|
| 813 | | # You have to enter a Superuser PW when booting into single user mode |
|---|
| 814 | | # GEN000020 |
|---|
| 815 | | # GEN000040 |
|---|
| 816 | | echo "Locking down GEN000020, GEN000040" |
|---|
| 817 | | echo "Require the root pw when booting into single user mode" >> /etc/inittab |
|---|
| 818 | | echo "~~:S:wait:/sbin/sulogin" >> /etc/inittab |
|---|
| 819 | | echo "GEN000020, GEN000040 Complete" |
|---|
| 820 | | # |
|---|
| | 723 | |
|---|
| | 724 | # Further restricting root logins |
|---|
| | 725 | # GEN000xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
|---|
| | 726 | # investigating by using PAM for preventing 10 recent passwords- doesn't appear |
|---|
| | 727 | # to be easily done using pam_passwdqc |
|---|
| | 728 | # Further restricting root logins |
|---|
| | 729 | cat <<-EOF > /etc/pam.d/su |
|---|
| | 730 | # %PAM-1.0 |
|---|
| | 731 | auth sufficient /lib/security/$ISA/pam_rootok.so |
|---|
| | 732 | # Uncomment the following line to implicitly trust users in the "wheel" group. |
|---|
| | 733 | # auth sufficient /lib/security/$ISA/pam_wheel.so trust use_uid |
|---|
| | 734 | # Uncomment the following line to require a user to be in the "wheel" group. |
|---|
| | 735 | auth required /lib/security/$ISA/pam_wheel.so use_uid |
|---|
| | 736 | auth required /lib/security/$ISA/pam_stack.so service=system-auth |
|---|
| | 737 | account required /lib/security/$ISA/pam_stack.so service=system-auth |
|---|
| | 738 | password required /lib/security/$ISA/pam_stack.so service=system-auth |
|---|
| | 739 | # pam_selinux.so close must be first session rule |
|---|
| | 740 | session required /lib/security/$ISA/pam_selinux.so close |
|---|
| | 741 | session required /lib/security/$ISA/pam_stack.so service=system-auth |
|---|
| | 742 | # pam_selinux.so open and pam_xauth must be last two session rules |
|---|
| | 743 | session required /lib/security/$ISA/pam_selinux.so open multiple |
|---|
| | 744 | session optional /lib/security/$ISA/pam_xauth.so |
|---|
| | 745 | EOF |
|---|
| | 746 | |
|---|
| | 747 | ## (GEN000020: CAT II) (Previously â G001) The IAO and SA will ensure, if |
|---|
| | 748 | ## configurable, the UNIX host is configured to require a password for access |
|---|
| | 749 | ## to single-user and maintenance modes. |
|---|
| | 750 | echo "" >> /etc/inittab |
|---|
| | 751 | echo "#Require password in single-user mode" >> /etc/inittab |
|---|
| | 752 | echo "~~:S:wait:/sbin/sulogin" >> /etc/inittab |
|---|
| | 753 | |
|---|
| | 754 | |
|---|