-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
829 additions
and
1,928 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,40 @@ | ||
rhel7stig_cat1_patch: yes | ||
rhel7stig_cat2_patch: no | ||
rhel7stig_cat3_patch: no | ||
|
||
# Whether or not to run tasks related to auditing/patching the desktop environment | ||
rhel7stig_gui: no | ||
|
||
# RHEL-07-030810 | ||
# Install and enable a DOD-approved AV program. ClamAV and McAfee (nails) | ||
# are the currently approved applications. This variable is used in two separate | ||
# tasks that will install the package and start and enable the service. | ||
rhel7stig_av_package: | ||
package: | ||
- clamav | ||
- clamav-scanner | ||
- clamav-server | ||
service: clamav-daemon | ||
|
||
# RHEL-07-040490 | ||
# If not required, remove lftpd. | ||
rhel7stig_lftpd_required: no | ||
|
||
# RHEL-07-040500 | ||
# If not required, remove tftp | ||
rhel7stig_tftp_required: no | ||
|
||
# RHEL-07-040580 | ||
# Set the SNMP community string to this from the default of public or private | ||
rhel7stig_snmp_community: Endgam3Ladyb0g | ||
|
||
# RHEL-07-010460 and RHEL-07-010470 | ||
# Password protect the boot loader | ||
rhel7stig_bootloader_password: 'Boot1tUp!' | ||
rhel7stig_boot_password_config: | ||
- regexp: ^set superusers | ||
line: 'set superusers="root"' | ||
|
||
- regexp: ^password_pbkdf2 root | ||
line: password_pbkdf2 root {{ rhel7stig_bootloader_password | grub2_hash(salt='KeokpkECTJeoDhEA5XtiLQ') }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import crypt | ||
from random import SystemRandom, shuffle | ||
from passlib.hash import grub_pbkdf2_sha512 | ||
import string | ||
try: | ||
import passlib.hash | ||
HAS_PASSLIB = True | ||
except: | ||
HAS_PASSLIB = False | ||
|
||
def grub2_hash(password, salt=None, iterations=10000): | ||
|
||
if salt is None: | ||
r = SystemRandom() | ||
salt = ''.join([r.choice(string.ascii_letters + string.digits) for _ in range(64)]) | ||
|
||
if not HAS_PASSLIB: | ||
if sys.platform.startswith('darwin'): | ||
raise errors.AnsibleFilterError('|password_hash requires the passlib python module to generate password hashes on Mac OS X/Darwin') | ||
saltstring = "$%s$%s" % (cryptmethod[hashtype],salt) | ||
encrypted = grub_pbkdf2_sha512.encrypt(password, salt=salt, rounds=iterations) | ||
else: | ||
encrypted = grub_pbkdf2_sha512.encrypt(password, salt=salt, rounds=iterations) | ||
|
||
return encrypted | ||
|
||
|
||
class FilterModule(object): | ||
|
||
def filters(self): | ||
return { | ||
'grub2_hash': grub2_hash | ||
} | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
- name: "HIGH | RHEL-07-010010 | AUDIT | The file permissions, ownership, and group membership of system files and commands must match the vendor values." | ||
shell: 'rpm -Va | grep ''^.M''' | ||
failed_when: no | ||
changed_when: no | ||
ignore_errors: yes | ||
register: rhel_07_010010_audit | ||
tags: | ||
- cat1 | ||
- high | ||
- audit | ||
- RHEL-07-010010 | ||
- always | ||
- rpm | ||
|
||
- name: "HIGH | RHEL-07-010020 | AUDIT | The cryptographic hash of system files and commands must match vendor values." | ||
shell: 'rpm -Va | grep ''^..5'' | grep -E ''/.?bin/''' | ||
failed_when: no | ||
changed_when: no | ||
ignore_errors: yes | ||
register: rhel_07_010020_audit | ||
tags: | ||
- cat1 | ||
- high | ||
- audit | ||
- RHEL-07-010020 | ||
- always | ||
|
||
- name: "HIGH | RHEL-07-010460 | AUDIT | Systems with a Basic Input/Output System (BIOS) must require authentication upon booting into single-user and maintenance modes." | ||
command: grep -i ^password_pbkdf2 /boot/grub2/grub.cfg | ||
failed_when: no | ||
changed_when: no | ||
ignore_errors: yes | ||
register: rhel_07_010460_audit | ||
tags: | ||
- cat1 | ||
- high | ||
- audit | ||
- RHEL-07-010460 | ||
- always | ||
|
||
- name: "HIGH | RHEL-07-010470 | AUDIT | Systems using Unified Extensible Firmware Interface (UEFI) must require authentication upon booting into single-user and maintenance modes." | ||
command: grep -i ^password_pbkdf2 /boot/efi/EFI/redhat/grub.cfg | ||
failed_when: no | ||
changed_when: no | ||
ignore_errors: yes | ||
register: rhel_07_010470_audit | ||
tags: | ||
- cat1 | ||
- high | ||
- audit | ||
- RHEL-07-010470 | ||
- always | ||
|
||
- name: "HIGH | RHEL-07-020170 | PATCH | Operating systems handling data requiring data-at-rest protections must employ cryptographic mechanisms to prevent unauthorized disclosure and modification of the information at rest." | ||
shell: blkid | grep -vi crypto_LUKS | ||
failed_when: no | ||
changed_when: no | ||
ignore_errors: yes | ||
register: rhel_07_020170_audit | ||
tags: | ||
- cat1 | ||
- high | ||
- audit | ||
- RHEL-07-020170 | ||
|
||
- name: "HIGH | RHEL-07-020310 | AUDIT | The root account must be the only account having unrestricted access to the system." | ||
command: 'awk -F: ''$3 == 0 && $1 !~ /root/ {print $1}'' /etc/passwd' | ||
failed_when: no | ||
changed_when: no | ||
ignore_errors: yes | ||
register: rhel_07_020310_audit | ||
tags: | ||
- cat1 | ||
- high | ||
- audit | ||
- RHEL-07-020310 | ||
- always | ||
|
||
- name: "HIGH | RHEL-07-040330 | AUDIT | There must be no .shosts files on the system." | ||
find: | ||
paths: / | ||
recurse: yes | ||
hidden: yes | ||
patterns: '*.shosts' | ||
register: rhel_07_040330_audit | ||
tags: | ||
- cat1 | ||
- high | ||
- audit | ||
- RHEL-07-040330 | ||
- always | ||
|
||
- name: "HIGH | RHEL-07-040331 | AUDIT | There must be no shosts.equiv files on the system." | ||
find: | ||
paths: / | ||
recurse: yes | ||
patterns: shosts.equiv | ||
register: rhel_07_040331_audit | ||
tags: | ||
- cat1 | ||
- high | ||
- audit | ||
- RHEL-07-040331 | ||
- always | ||
|
||
- name: "HIGH | RHEL-07-040580 | AUDIT | SNMP community strings must be changed from the default." | ||
command: grep {{ item }} /etc/snmp/snmpd.conf | ||
failed_when: no | ||
changed_when: no | ||
ignore_errors: yes | ||
with_items: | ||
- public | ||
- private | ||
register: rhel_07_040580_audit | ||
tags: | ||
- cat1 | ||
- high | ||
- audit | ||
- RHEL-07-040580 | ||
- always | ||
- snmp |
Oops, something went wrong.