Skip to content

Add log rotate configuration for stepup-authentication.log #492

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
12 changes: 11 additions & 1 deletion roles/rsyslog/tasks/process_auth_logs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
with_items: "{{ rsyslog_environments }}"
when: item.db_loglogins_name is defined

- name: Put log_logins logrotate scripts
- name: Put log_logins logrotate scripts for ebauth
template:
src: logrotate_ebauth.j2
dest: /etc/logrotate.d/logrotate_ebauth_{{ item.name }}
Expand All @@ -91,6 +91,16 @@
with_items: "{{ rsyslog_environments }}"
when: item.db_loglogins_name is defined

- name: Put log_logins logrotate scripts for stepup
template:
src: logrotate_stepup_authentication.j2
dest: /etc/logrotate.d/logrotate_stepup_authentication_{{ item.name }}
mode: 0644
owner: root
group: root
with_items: "{{ rsyslog_environments }}"
when: item.db_loglogins_name is defined
Copy link
Contributor

Choose a reason for hiding this comment

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

The when condition will fail since there is not yet a logparse script for stepup logs.


- name: Create logdirectory for log_logins cleanup script
file:
path: "{{ rsyslog_dir }}/apps/{{ item.name }}/loglogins_cleanup/"
Expand Down
17 changes: 17 additions & 0 deletions roles/rsyslog/templates/logrotate_stepup_authentication.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{ rsyslog_dir }}/log_logins/{{ item.name }}/stepup-authentication.log
{
missingok
daily
rotate 180
sharedscripts
dateext
dateyesterday
compress
delaycompress
create 0640 root {{ rsyslog_read_group }}
postrotate
# TODO: Write logs to MySQL for further processing (e.g. for deprovisioning)
# E.g.: /usr/local/sbin/parse_stepup_authentication_to_mysql_{{ item.name }}.py > /dev/null
systemctl kill -s HUP rsyslog.service
endscript
}