Skip to content

Commit

Permalink
Add CAT2 Password Requirements (#6)
Browse files Browse the repository at this point in the history
* RHEL-07-010040 Adds /etc/issue login banner

* RHEL-07-010090 Password Requirements

Require at least 1 uppercase character

* RHEL-07-010100 Password Requirements

Require at least 1 lower case character

* RHEL-07-010110 Password Requirements

Require at least one numeric character

* RHEL7-07-010120 Password Requirements

Require at least one special character

* RHEL-07-010130 Password Requirements

Minimum of 8 characters difference when changing passwords

* RHEL-07-010140 Password Requirements

Require the change of at least four character classes when passwords are changed

* RHEL-07-010150 Password Requirements

Enforce a max of 4 repeating characters

* RHEL-07-010160 Password Requirements

Enforce max of 4 repeating characters of the same character class

* RHEL-07-010200 Password Requirements

Require 24 hours minimum lifetime of passwords

* RHEL-07-010210 Password Requirements

Restrict passwords to 24 hour minimum lifetime

* RHEL-07-010220 Password Requirements

Passwords restricted to max lifetime of 60 days for new users

* RHEL-07-010230 Password Requirements

Restrict password lifetime to 60days for existing users.

* RHEL-07-010240 Password Requirements

Passwords must be prohibited from reuse for a minimum of 5 generations

* RHEL-07-010250 Password Requirements

Passwords must be a minimum of 15 characters in length

* RHEL-07-010040 Use copy module for login banner

Changed template to copy since the issue file is in the files/ dir

* RHEL-07-010200 | RHEL-07-010220 Fix Typo

updated lien to line
  • Loading branch information
jmeth authored and samdoran committed Jan 5, 2017
1 parent 1761c32 commit 6106fa6
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 15 deletions.
13 changes: 13 additions & 0 deletions files/issue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only.

By using this IS (which includes any device attached to this IS), you consent to the following conditions:

-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations.

-At any time, the USG may inspect and seize data stored on this IS.

-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose.

-This IS includes security measures (e.g., authentication and access controls) to protect USG interests--not for your personal benefit or privacy.

-Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative searching or monitoring of the content of privileged communications, or work product, related to personal representation or services by attorneys, psychotherapists, or clergy, and their assistants. Such communications and work product are private and confidential. See User Agreement for details."
24 changes: 24 additions & 0 deletions tasks/audit-cat2.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
- name: "MEDIUM | RHEL-07-010210 | AUDIT | Passwords must be restricted to a 24 hours/1 day minimum lifetime."
command: "awk -F: '$4 < 1 {print $1}' /etc/shadow"
register: rhel_07_010210_audit
failed_when: no
changed_when: no
ignore_errors: yes
tags:
- cat2
- medium
- audit
- RHEL-07-010210

- name: "MEDIUM | RHEL-07-010230 | AUDIT | Passwords must be restricted to a 24 hours/1 day minimum lifetime."
command: "awk -F: '$5 > 60 {print $1}' /etc/shadow"
register: rhel_07_010230_audit
failed_when: no
changed_when: no
ignore_errors: yes
tags:
- cat2
- medium
- audit
- RHEL-07-010230

- name: "MEDIUM | RHEL-07-040180 | AUDIT | The operating system must implement cryptography to protect the integrity of Lightweight Directory Access Protocol (LDAP) authentication communications."
command: grep -i useldapauth /etc/sysconfig/authconfig
register: rhel_07_040180_audit
Expand Down
72 changes: 57 additions & 15 deletions tasks/fix-cat2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
- RHEL-07-010031

- name: "MEDIUM | RHEL-07-010040 | PATCH | The operating system must display the Standard Mandatory DoD Notice and Consent Banner before granting local or remote access to the system via a command line user logon."
command: "true"
copy:
src: issue
dest: /etc/issue
owner: root
mode: 0644
tags:
- cat2
- medium
Expand Down Expand Up @@ -71,63 +75,87 @@
- RHEL-07-010073

- name: "MEDIUM | RHEL-07-010090 | PATCH | When passwords are changed or new passwords are established, the new password must contain at least one upper-case character."
command: "true"
lineinfile:
dest: /etc/security/pwquality.conf
regexp: ^#?\s?ucredit
line: ucredit = -1
tags:
- cat2
- medium
- patch
- RHEL-07-010090

- name: "MEDIUM | RHEL-07-010100 | PATCH | When passwords are changed or new passwords are established, the new password must contain at least one lower-case character."
command: "true"
lineinfile:
dest: /etc/security/pwquality.conf
regexp: ^#?\s?lcredit
line: lcredit = -1
tags:
- cat2
- medium
- patch
- RHEL-07-010100

- name: "MEDIUM | RHEL-07-010110 | PATCH | When passwords are changed or new passwords are assigned, the new password must contain at least one numeric character."
command: "true"
lineinfile:
dest: /etc/security/pwquality.conf
regexp: ^#?\s?dcredit
line: dcredit = -1
tags:
- cat2
- medium
- patch
- RHEL-07-010110

- name: "MEDIUM | RHEL-07-010120 | PATCH | When passwords are changed or new passwords are assigned, the new password must contain at least one special character."
command: "true"
lineinfile:
dest: /etc/security/pwquality.conf
regexp: ^#?\s?ocredit
line: ocredit = -1
tags:
- cat2
- medium
- patch
- RHEL-07-010120

- name: "MEDIUM | RHEL-07-010130 | PATCH | When passwords are changed a minimum of eight of the total number of characters must be changed."
command: "true"
lineinfile:
dest: /etc/security/pwquality.conf
regexp: ^#?\s?difok
line: difok = 8
tags:
- cat2
- medium
- patch
- RHEL-07-010130

- name: "MEDIUM | RHEL-07-010140 | PATCH | When passwords are changed a minimum of four character classes must be changed."
command: "true"
lineinfile:
dest: /etc/security/pwquality.conf
regexp: ^#?\s?minclass
line: minclass = 4
tags:
- cat2
- medium
- patch
- RHEL-07-010140

- name: "MEDIUM | RHEL-07-010150 | PATCH | When passwords are changed the number of repeating consecutive characters must not be more than four characters."
command: "true"
lineinfile:
dest: /etc/security/pwquality.conf
regexp: ^#?\s?maxrepeat
line: maxrepeat = 2
tags:
- cat2
- medium
- patch
- RHEL-07-010150

- name: "MEDIUM | RHEL-07-010160 | PATCH | When passwords are changed the number of repeating characters of the same character class must not be more than four characters."
command: "true"
lineinfile:
dest: /etc/security/pwquality.conf
regexp: ^#?\s?maxclassrepeat
line: maxclassrepeat = 4
tags:
- cat2
- medium
Expand Down Expand Up @@ -159,47 +187,61 @@
- RHEL-07-010190

- name: "MEDIUM | RHEL-07-010200 | PATCH | Passwords for new users must be restricted to a 24 hours/1 day minimum lifetime."
command: "true"
lineinfile:
dest: /etc/login.defs
regexp: (?i)^#?PASS_MIN_DAYS
line: PASS_MIN_DAYS 1
tags:
- cat2
- medium
- patch
- RHEL-07-010200

- name: "MEDIUM | RHEL-07-010210 | PATCH | Passwords must be restricted to a 24 hours/1 day minimum lifetime."
command: "true"
command: chage -m 1 {{ item }}
with_items: "{{ rhel_07_010210_audit.stdout_lines }}"
tags:
- cat2
- medium
- patch
- RHEL-07-010210

- name: "MEDIUM | RHEL-07-010220 | PATCH | Passwords for new users must be restricted to a 60-day maximum lifetime."
command: "true"
lineinfile:
dest: /etc/login.defs
regexp: (?i)^#?PASS_MAX_DAYS
line: PASS_MAX_DAYS 60
tags:
- cat2
- medium
- patch
- RHEL-07-010220

- name: "MEDIUM | RHEL-07-010230 | PATCH | Existing passwords must be restricted to a 60-day maximum lifetime."
command: "true"
command: chage -M 60 {{ item }}
with_items: "{{ rhel_07_010230_audit.stdout_lines }}"
tags:
- cat2
- medium
- patch
- RHEL-07-010230

- name: "MEDIUM | RHEL-07-010240 | PATCH | Passwords must be prohibited from reuse for a minimum of five generations."
command: "true"
lineinfile:
dest: /etc/pam.d/system-auth
regexp: password\s*sufficient\s*pam_unix.so
line: password sufficient pam_unix.so sha512 shadow try_first_pass use_authtok remember=5
tags:
- cat2
- medium
- patch
- RHEL-07-010240

- name: "MEDIUM | RHEL-07-010250 | PATCH | Passwords must be a minimum of 15 characters in length."
command: "true"
lineinfile:
dest: /etc/security/pwquality.conf
regexp: ^#?\s?minlen
line: minlen = 15
tags:
- cat2
- medium
Expand Down

0 comments on commit 6106fa6

Please sign in to comment.