Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@
ansible.builtin.systemd:
name: systemd-journald
state: restarted

#1.3 configuresecureboot
- name: Reload systemd
ansible.builtin.command: systemctl daemon-reload
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use ansible module instead of command

become: truem
3 changes: 3 additions & 0 deletions tasks/amazon_linux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
- name: Amazon Linux 2 | Configure secure boot setting
include_tasks: configure_secure_boot_al2.yaml
13 changes: 13 additions & 0 deletions tasks/configure_secure_boot_al2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---

- name: "1.3.1 Ensure authentication required for single user mode (rescue & emergency)"
ansible.builtin.lineinfile:
path: "/usr/lib/systemd/system/{{ item }}"
regexp: '^ExecStart='
line: 'ExecStart=-/bin/sh -c "/usr/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"'
backup: yes
loop:
- rescue.service
- emergency.service
notify: Reload systemd

18 changes: 10 additions & 8 deletions tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
---
- name: Include CIS Stage Specific vars
include_vars: cis-{{ cis_Stage }}.yaml

- name: Debian realted Specification
include_tasks: configure_Debian.yaml
- name: Ubuntu related Specification
include_tasks: ubuntu.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we doing Debian related change

when:
ansible_os_family == 'Debian'

- name: Centos realted Specification
include_tasks: configure_RedHat.yaml
- name: CentOS related Specification
include_tasks: centos.yaml
when:
ansible_os_family == 'RedHat' and ansible_distribution != 'Amazon'

- name: Amazon Linux 2 related Specification
include_tasks: amazon_linux.yaml
when:
ansible_os_family == 'RedHat'
ansible_distribution == 'Amazon'

# - name: Special purpose services
# include_tasks: services.yaml
Expand Down