Skip to content

Commit 5c3c04f

Browse files
committed
Feat: Add Postgres-16
Signed-off-by: Mahdi Fooladgar (professormahi) <professormahi_f@yahoo.com>
1 parent 27997f3 commit 5c3c04f

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

roles/postgres_hardening/defaults/main.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,13 @@ postgres_group: postgres
1212

1313
# SSL
1414
ssl_enabled: "on"
15-
ssl_ciphers: ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH
15+
ssl_ciphers: ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH
16+
17+
# Logging
18+
logging_collector: "on"
19+
log_connections: "on"
20+
log_disconnections: "on"
21+
log_duration: "on"
22+
log_hostname: "on"
23+
log_directory: pg_log
24+
log_line_prefix: "%t %u %d %h"

roles/postgres_hardening/tasks/hardening.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
mode: u=rw,g=,o=
9797

9898
#################################
99-
# POSTGRES-11/12 ################
99+
# POSTGRES-11/12/16 #############
100100
#################################
101101
- name: Secure postgresql.conf Configuration
102102
ansible.builtin.lineinfile:
@@ -106,7 +106,21 @@
106106
state: present
107107
with_items:
108108
- line: "ssl = {{ ssl_enabled }}"
109-
regexp: "#?ssl\\s?="
109+
regexp: "#?ssl\\s?="
110110
- line: "ssl_ciphers = '{{ ssl_ciphers }}'"
111111
regexp: "#?ssl_ciphers\\s?="
112+
- line : "logging_collector = {{ logging_collector }}"
113+
regexp: "#?logging_collector\\s?="
114+
- line: "log_connections = {{ log_connections }}"
115+
regexp: "#?log_connections\\s?="
116+
- line: "log_disconnections = {{ log_disconnections }}"
117+
regexp: "#?log_disconnections\\s?="
118+
- line: "log_duration = {{ log_duration }}"
119+
regexp: "#?log_duration\\s?="
120+
- line: "log_hostname = {{ log_hostname }}"
121+
regexp: "#?log_hostname\\s?="
122+
- line: "log_directory = '{{ log_directory }}'"
123+
regexp: "#?log_directory\\s?="
124+
- line: "log_line_prefix = '{{ log_line_prefix }}'"
125+
regexp: "#?log_line_prefix\\s?="
112126
notify: Restart postgres

0 commit comments

Comments
 (0)