-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Made some changes to CAT II #4
Changes from 3 commits
5600b67
cb80330
72cfb9b
3544356
5c66e01
45ac122
fd40aee
aed18a0
240e484
421d3d7
205ca42
cd83f09
47278c7
0a41091
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
- name: "MEDIUM | RHEL-07-040640 | AUDIT | The SSH public host key files must have mode 0644 or less permissive." | ||
command: find / -name '*ssh_host*key' | ||
failed_when: no | ||
changed_when: no | ||
ignore_errors: yes | ||
register: rhel_07_040650_audit | ||
tags: | ||
- cat2 | ||
- high | ||
- audit | ||
- RHEL-07-040640 | ||
- always | ||
|
||
- name: "MEDIUM | RHEL-07-040650 | AUDIT | The SSH private host key files must have mode 0600 or less permissive." | ||
command: find / -name '*ssh_host*key' | ||
failed_when: no | ||
changed_when: no | ||
ignore_errors: yes | ||
register: rhel_07_040650_audit | ||
tags: | ||
- cat2 | ||
- high | ||
- audit | ||
- RHEL-07-040650 | ||
- always |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1439,63 +1439,104 @@ | |
- RHEL-07-040620 | ||
|
||
- name: "MEDIUM | RHEL-07-040640 | PATCH | The SSH public host key files must have mode 0644 or less permissive." | ||
command: "true" | ||
file: | ||
dest: "{{ item }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please indent four spaces. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. Will commit when finished with other changes. |
||
mode: 0644 | ||
state: file | ||
with_items: "{{ rhel_07_040640_audit.stdout_lines }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use |
||
tags: | ||
- cat2 | ||
- medium | ||
- patch | ||
- RHEL-07-040640 | ||
|
||
- name: "MEDIUM | RHEL-07-040650 | PATCH | The SSH private host key files must have mode 0600 or less permissive." | ||
command: "true" | ||
file: | ||
dest: "{{ item }}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please indent four spaces. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. Will commit when finished with other changes. |
||
mode: 0600 | ||
state: file | ||
with_items: "{{ rhel_07_040650_audit.stdout_lines }}" | ||
tags: | ||
- cat2 | ||
- medium | ||
- patch | ||
- RHEL-07-040650 | ||
|
||
- name: "MEDIUM | RHEL-07-040660 | PATCH | The SSH daemon must not permit Generic Security Service Application Program Interface (GSSAPI) authentication unless needed." | ||
command: "true" | ||
lineinfile: | ||
dest: /etc/ssh/sshd_config | ||
regexp: (?i)^#?gssapiauthentication | ||
line: GSSAPIAuthentication no | ||
validate: sshd -t -f %s | ||
notify: restart ssh | ||
tags: | ||
- cat2 | ||
- medium | ||
- patch | ||
- RHEL-07-040660 | ||
- ssh | ||
|
||
- name: "MEDIUM | RHEL-07-040670 | PATCH | The SSH daemon must not permit Kerberos authentication unless needed." | ||
command: "true" | ||
lineinfile: | ||
dest: /etc/ssh/sshd_config | ||
regexp: (?i)^#?kerberosauthentication | ||
line: KerberosAuthentication no | ||
validate: sshd -t -f %s | ||
notify: restart ssh | ||
tags: | ||
- cat2 | ||
- medium | ||
- patch | ||
- RHEL-07-040670 | ||
- ssh | ||
|
||
- name: "MEDIUM | RHEL-07-040680 | PATCH | The SSH daemon must perform strict mode checking of home directory configuration files." | ||
command: "true" | ||
lineinfile: | ||
dest: /etc/ssh/sshd_config | ||
regexp: (?i)^#?strictmodes | ||
line: StrictModes yes | ||
validate: sshd -t -f %s | ||
notify: restart ssh | ||
tags: | ||
- cat2 | ||
- medium | ||
- patch | ||
- RHEL-07-040680 | ||
- ssh | ||
|
||
- name: "MEDIUM | RHEL-07-040690 | PATCH | The SSH daemon must use privilege separation." | ||
command: "true" | ||
lineinfile: | ||
dest: /etc/ssh/sshd_config | ||
regexp: (?i)^#?useprivilegeseparation | ||
line: UsePrivilegeSeparation yes | ||
validate: sshd -t -f %s | ||
notify: restart ssh | ||
tags: | ||
- cat2 | ||
- medium | ||
- patch | ||
- RHEL-07-040690 | ||
- ssh | ||
|
||
- name: "MEDIUM | RHEL-07-040700 | PATCH | The SSH daemon must not allow compression or must only allow compression after successful authentication." | ||
command: "true" | ||
lineinfile: | ||
dest: /etc/ssh/sshd_config | ||
regexp: (?i)^#?compression | ||
line: Compression no | ||
validate: sshd -t -f %s | ||
notify: restart ssh | ||
tags: | ||
- cat2 | ||
- medium | ||
- patch | ||
- RHEL-07-040700 | ||
- ssh | ||
|
||
- name: "MEDIUM | RHEL-07-040730 | PATCH | The system must not be performing packet forwarding unless the system is a router." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably should add a variable, e.g.,
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed, will commit when other changes complete. |
||
command: "true" | ||
sysctl: | ||
name: net.ipv4.ip_forward | ||
present: yes | ||
value: 0 | ||
tags: | ||
- cat2 | ||
- medium | ||
|
@@ -1511,12 +1552,15 @@ | |
- RHEL-07-040740 | ||
|
||
- name: "MEDIUM | RHEL-07-040810 | PATCH | The system must use a local firewall." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need an additional task that starts and enables the firewall to meet the full requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed, will commit when other changes are complete. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, this is a duplicate of RHEL-07-040290. Slightly different wording on the requirement but the fix action for both is identical. We can remove these tasks and just leave a comment in line with the finding ID stating it's a duplicate. Hooray for working from the draft STIG. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, was actually curious if we should leave it now and remove it when the final rev is complete? Not sure which one they will remove. Figured once the final release is out, do a final check for the actual findings, add those that are missing, and remove those that are taken out. Thoughts? |
||
command: "true" | ||
yum: | ||
name: firewalld | ||
state: latest | ||
tags: | ||
- cat2 | ||
- medium | ||
- patch | ||
- RHEL-07-040810 | ||
- firewalld | ||
|
||
- name: "MEDIUM | RHEL-07-040820 | PATCH | The system's access control program must be configured to grant or deny system access to specific hosts and services." | ||
command: "true" | ||
|
@@ -1535,10 +1579,12 @@ | |
- RHEL-07-040830 | ||
|
||
- name: "MEDIUM | RHEL-07-040860 | PATCH | The system must not forward IPv6 source-routed packets." | ||
command: "true" | ||
sysctl: | ||
name: net.ipv6.conf.all.accept_source_route | ||
present: yes | ||
value: 0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed on each sysctl task. Getting ready to commit changes now. |
||
tags: | ||
- cat2 | ||
- medium | ||
- patch | ||
- RHEL-07-040860 | ||
|
||
- RHEL-07-010860 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,12 @@ | |
- cat1 | ||
- audit | ||
|
||
- name: Run CAT II audits | ||
include: audit-cat2.yml | ||
tags: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These conditionals so should not be removed. They are what allow remediation based in severity. |
||
- cat2 | ||
- audit | ||
|
||
- name: Include CAT I patches | ||
include: fix-cat1.yml | ||
when: rhel7stig_cat1_patch | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the find module rather than command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Will commit when finished with other changes.