Skip to content
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

Use upstream konstruktoid/ansible-role-hardening (initial refactor for issue 96) #106

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
9 changes: 0 additions & 9 deletions src/automated-security-updates.yml

This file was deleted.

6 changes: 0 additions & 6 deletions src/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
become: true
become_method: ansible.builtin.sudo
tasks:
- name: Install and configure automated security updates
ansible.builtin.include_role:
name: automated_security_updates
- name: Install and configure login banner
ansible.builtin.include_role:
name: banner
Expand All @@ -19,9 +16,6 @@
- name: Install and configure htop
ansible.builtin.include_role:
name: htop
- name: Configure JournalD to preserve logs across reboots
ansible.builtin.include_role:
name: persist_journald
- name: Install and configure systemd-resolved
ansible.builtin.include_role:
name: systemd_resolved
56 changes: 51 additions & 5 deletions src/harden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,61 @@
- https://raw.githubusercontent.com/cisagov/ansible-role-banner/develop/files/issue
- https://raw.githubusercontent.com/cisagov/ansible-role-banner/develop/files/motd
- name: Harden system
# This role is forked from konstruktoid/ansible-role-hardening
# and we do not control the names of the role variables. This
# We do not control the names of the role variables. This
# is the reason for the noqa comment.
ansible.builtin.include_role: # noqa var-naming[no-role-prefix]
name: harden
ansible.builtin.import_role: # noqa var-naming[no-role-prefix]
name: konstruktoid.hardening
vars:
# Point the role to the correct issue and motd templates
automatic_updates: true
konstruktoid marked this conversation as resolved.
Show resolved Hide resolved
konstruktoid marked this conversation as resolved.
Show resolved Hide resolved
fallback_ntp:
- 169.254.169.123
konstruktoid marked this conversation as resolved.
Show resolved Hide resolved
issue_template: /tmp/issue
konstruktoid marked this conversation as resolved.
Show resolved Hide resolved
journald_storage: persistent
konstruktoid marked this conversation as resolved.
Show resolved Hide resolved
manage_timesyncd: false
manage_resolved: false
manage_ufw: false
motd_template: /tmp/motd
konstruktoid marked this conversation as resolved.
Show resolved Hide resolved
ntp_servers:
- 169.254.169.123
konstruktoid marked this conversation as resolved.
Show resolved Hide resolved
sshd_admin_net:
- "0.0.0.0/0"
system_upgrade: true
konstruktoid marked this conversation as resolved.
Show resolved Hide resolved
packages_blocklist:
- apport*
- autofs
- avahi*
- avahi-*
- beep
- git
- pastebinit
- popularity-contest
- prelink
- rpcbind
- rsh*
- rsync
- talk*
- telnet*
- tftp*
- tuned
- whoopsie
- xinetd
- yp-tools
- ypbind
packages_debian:
- auditd
- cracklib-runtime
- libpam-pwquality
packages_redhat:
- audit
- cracklib
- libpwquality
- python3-dnf-plugin-post-transaction-actions
konstruktoid marked this conversation as resolved.
Show resolved Hide resolved
packages_ubuntu: []
pass_max_days: 365
pass_min_days: 7
sshd_max_sessions: 4
suid_sgid_permissions: false
umask_value: "027"
konstruktoid marked this conversation as resolved.
Show resolved Hide resolved
- name: Delete local copies of issue and motd files
ansible.builtin.file:
path: "{{ item }}"
Expand Down
2 changes: 1 addition & 1 deletion src/ipa-initial-seeding-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
- name: Install create-ipa-initial-seeding-script.sh
ansible.builtin.get_url:
dest: /usr/local/sbin
mode: 0500
mode: "0500"
url: >
https://raw.githubusercontent.com/cisagov/cool-users/master/create-ipa-initial-seeding-script.sh
6 changes: 0 additions & 6 deletions src/packer.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,6 @@ source "amazon-ebs" "openvpn" {
build {
sources = ["source.amazon-ebs.openvpn"]

provisioner "ansible" {
playbook_file = "src/upgrade.yml"
use_proxy = false
use_sftp = true
}

konstruktoid marked this conversation as resolved.
Show resolved Hide resolved
provisioner "ansible" {
playbook_file = "src/python.yml"
use_proxy = false
Expand Down
3 changes: 0 additions & 3 deletions src/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
- name: Import base image playbook
ansible.builtin.import_playbook: base.yml

- name: Import automated security updates playbook
ansible.builtin.import_playbook: automated-security-updates.yml

- name: Import UFW playbook
ansible.builtin.import_playbook: ufw.yml

Expand Down
12 changes: 4 additions & 8 deletions src/requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ collections:
roles:
- name: amazon_ssm_agent
src: https://github.com/cisagov/ansible-role-amazon-ssm-agent
- name: automated_security_updates
src: https://github.com/cisagov/ansible-role-automated-security-updates
- name: banner
src: https://github.com/cisagov/ansible-role-banner
- name: cdm_nessus_agent
Expand All @@ -20,16 +18,16 @@ roles:
src: https://github.com/cisagov/ansible-role-crowdstrike
- name: freeipa_client
src: https://github.com/cisagov/ansible-role-freeipa-client
- name: harden
src: https://github.com/cisagov/ansible-role-hardening-2
- name: konstruktoid.hardening
version: v2.0.4
src: https://github.com/konstruktoid/ansible-role-hardening.git
scm: git
konstruktoid marked this conversation as resolved.
Show resolved Hide resolved
- name: htop
src: https://github.com/cisagov/ansible-role-htop
- name: nvme
src: https://github.com/cisagov/ansible-role-nvme
- name: openvpn
src: https://github.com/cisagov/ansible-role-openvpn
- name: persist_journald
src: https://github.com/cisagov/ansible-role-persist-journald
- name: pip
src: https://github.com/cisagov/ansible-role-pip
- name: python
Expand All @@ -40,5 +38,3 @@ roles:
src: https://github.com/cisagov/ansible-role-systemd-resolved
- name: ufw
src: https://github.com/cisagov/ansible-role-ufw
- name: upgrade
src: https://github.com/cisagov/ansible-role-upgrade
9 changes: 0 additions & 9 deletions src/upgrade.yml
konstruktoid marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

Loading