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

fix(audit-log): change max_log_file_action to rotate #4

Merged
merged 5 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions roles/cis_security/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ log_host: false # Linux: Whether this machine will host rsyslog messages for oth
log_port: 514 # Linux: Port to listen to RSYSLOG messages on (if log_host is true)
log_file_size: 8 # Linux: log file size. RHEL default is 8MB, control has no default
# rsyslog_file: # Linux: Uncomment to copy file listed to /etc/rsyslog.d
space_left_disk_size: 10000
nipunaudemy marked this conversation as resolved.
Show resolved Hide resolved
max_log_file_actions: keep_logs

# network security settings
tcpwrappers: false # Linux: Configure tcpwrappers controls. RHEL 7 control only
Expand Down
3 changes: 2 additions & 1 deletion roles/cis_security/tasks/type-files/redhat-7-type.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1609,9 +1609,10 @@
replace: "{{ item.replace }}"
loop:
- {find: '^max_log_file\s+=\s+[^{{ log_file_size }}]', replace: 'max_log_file = {{ log_file_size }}'} # 4.1.1.1
- {find: '^max_log_file_action\s+=\s+((?!keep_logs).)*$', replace: 'max_log_file_action = keep_logs'} # 4.1.1.2
- {find: '^max_log_file_action\s+=\s+((?!{{ max_log_file_action }}).)*$', replace: 'max_log_file_action ={{ max_log_file_action }} '} # 4.1.1.2
- {find: '^space_left_action\s+=\s+((?!email).)*$', replace: 'space_left_action = email'} # 4.1.1.2
- {find: '^action_mail_acct\s+=\s+((?!root).)*$', replace: 'action_mail_acct = root'} # 4.1.1.2
- {find: '^admin_space_left\s+=\s+\d+$', replace: 'admin_space_left = {{ space_left_disk_size }}'} #
- {find: '^admin_space_left_action\s+=\s+((?!suspend).)*$', replace: 'admin_space_left_action = suspend'} # 4.1.1.2
notify: Restart auditd
tags:
Expand Down
3 changes: 2 additions & 1 deletion roles/cis_security/tasks/type-files/redhat-8-type.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1585,9 +1585,10 @@
replace: "{{ item.replace }}"
loop:
- { find: "^max_log_file\\s+=\\s+[^{{ log_file_size }}]", replace: "max_log_file = {{ log_file_size }}" } # 4.1.2.1
- { find: "^max_log_file_action\\s+=\\s+((?!keep_logs).)*$", replace: max_log_file_action = keep_logs } # 4.1.2.2
- { find: "^max_log_file_action\\s+=\\s+((?!{{ max_log_file_action }}).)*$", replace: max_log_file_action = {{ max_log_file_action }} } # 4.1.2.2
- { find: "^space_left_action\\s+=\\s+((?!email).)*$", replace: space_left_action = email } # 4.1.2.2
- { find: "^action_mail_acct\\s+=\\s+((?!root).)*$", replace: action_mail_acct = root } # 4.1.2.2
- { find: "^admin_space_left\\s+=\\s+\\d+$", replace: "admin_space_left = {{ space_left_disk_size }}"} #
- { find: "^admin_space_left_action\\s+=\\s+((?!suspend).)*$", replace: admin_space_left_action = suspend } # 4.1.2.2
notify: Restart auditd
tags:
Expand Down
3 changes: 2 additions & 1 deletion roles/cis_security/tasks/type-files/ubuntu-18-type.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1566,9 +1566,10 @@
replace: "{{ item.replace }}"
loop:
- { find: "^max_log_file\\s+=\\s+[^{{ log_file_size }}]", replace: "max_log_file = {{ log_file_size }}" } # 4.1.2.1
- { find: "^max_log_file_action\\s+=\\s+((?!keep_logs).)*$", replace: max_log_file_action = keep_logs } # 4.1.2.2
- { find: "^max_log_file_action\\s+=\\s+((?!{{ max_log_file_action }}).)*$", replace: max_log_file_action = {{ max_log_file_action }} } # 4.1.2.2
- { find: "^space_left_action\\s+=\\s+((?!email).)*$", replace: space_left_action = email } # 4.1.2.2
- { find: "^action_mail_acct\\s+=\\s+((?!root).)*$", replace: action_mail_acct = root } # 4.1.2.2
- { find: "^admin_space_left\\s+=\\s+\\d+$", replace: "admin_space_left = {{ space_left_disk_size }}"} #
- { find: "^admin_space_left_action\\s+=\\s+((?!suspend).)*$", replace: admin_space_left_action = suspend } # 4.1.2.2
tags:
- 4.1.2.1
Expand Down