Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9a19c30

Browse files
darorahf
authored andcommitted
fix: disable cron access (#103)
1 parent 71a42f4 commit 9a19c30

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

ansible/files/cron.deny

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ubuntu
2+
postgres

ansible/playbook.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@
104104
src: files/logrotate-postgres-csv
105105
dest: /etc/logrotate.d/postgres-csv
106106

107+
- name: Disable cron access
108+
copy:
109+
src: files/cron.deny
110+
dest: /etc/cron.deny
111+
107112
- name: Configure logrotation to run every hour
108113
shell:
109114
cmd: |
@@ -112,12 +117,6 @@
112117
systemctl reenable logrotate.timer
113118
become: yes
114119

115-
- name: restart crond
116-
systemd:
117-
state: restarted
118-
name: cron
119-
become: yes
120-
121120
- name: Enhance fail2ban
122121
import_tasks: tasks/setup-fail2ban.yml
123122

0 commit comments

Comments
 (0)