Skip to content

Commit

Permalink
adds feature to allow rsync and is CIS compliant
Browse files Browse the repository at this point in the history
Signed-off-by: Dan D <[email protected]>
  • Loading branch information
dderemiah committed Oct 20, 2023
1 parent 0e78bb2 commit 20b8fa0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ ubtu20cis_dovecot_server: false
ubtu20cis_smb_server: false
ubtu20cis_squid_server: false
ubtu20cis_snmp_server: false
ubtu20cis_rsync_server: false
ubtu20cis_rsync_server: mask # Can be set to true, mask or remove depending on requirements
ubtu20cis_nis_server: false
ubtu20cis_nfs_client: false
# rpcbind is required by nfs-common which is required on client and server
Expand Down
25 changes: 19 additions & 6 deletions tasks/section_2/cis_2.2.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,26 @@
- rule_2.2.16
- postfix

- name: "2.2.17 | PATCH | Ensure rsync service is not installed"
ansible.builtin.package:
name: rsync
state: absent
- name: "2.2.17 | PATCH | Ensure rsync service is either not installed or masked"
block:
- name: "2.2.17 | PATCH | Ensure rsync service is either not installed or masked | remove pkg"
ansible.builtin.package:
name: rsync
state: absent
when:
- ubtu20cis_rule_2_2_17
- ubtu20cis_rsync_server == 'remove'

- name: "2.2.17 | PATCH | Ensure rsync service is either not installed or masked | mask service"
ansible.builtin.service:
name: rsync.service
state: stopped
enabled: false
masked: true
when:
- ubtu20cis_rule_2_2_17
- ubtu20cis_rsync_server == 'mask'
when:
- ubtu20cis_rule_2_2_17
- not ubtu20cis_rsync_server
- "'rsync' in ansible_facts.packages"
tags:
- level1-server
Expand Down

0 comments on commit 20b8fa0

Please sign in to comment.