Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

enh(purge): add audit log purge #7710

Merged
merged 2 commits into from
Jul 17, 2019
Merged

enh(purge): add audit log purge #7710

merged 2 commits into from
Jul 17, 2019

Conversation

kduret
Copy link
Contributor

@kduret kduret commented Jul 17, 2019

Adds audit log purge log

allows people to configure data retention for audit logs

This adds a new field in the form in administration -> parameters -> options at the bottom of the page. Field that allows people to configure the retention duration for their audit log. It also displays logs from CLAPI actions

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software
  • Updating documentation (missing information, typo...)

Target serie

  • 2.8.x
  • 18.10.x
  • 19.04.x (master)

How this pull request can be tested ?

-head over the administration -> parameters -> options and set a value for your audit log retention duration.

-create a backup of your database so you'll be able to repeat the next step as much as you want

-mysqldump -u centreon -p centreon_storage log_action log_action_modification > /tmp/backup_audit_log_tables.sql

In my exemple, I have the following logs
https://user-images.githubusercontent.com/7352865/56137468-38d8aa00-5f95-11e9-8b80-61f221df8fed.png

I configure my audit logs retention to 3 days so most of my past actions are going to be purged
https://user-images.githubusercontent.com/7352865/56137519-586fd280-5f95-11e9-86b9-a6df66013c2a.png

if you've done your backup, you're now ready to use the purge

write the following command on your central server
/opt/rh/rh-php71/root/usr/bin/php /usr/share/centreon/cron/centstorage_purge.php

go back to your log menu and find out that there're no data older than 3 days ago
https://user-images.githubusercontent.com/7352865/56137808-e350cd00-5f95-11e9-9cf7-550262423726.png

Checklist

Community contributors & Centreon team
  • I followed the coding style guidelines provided by Centreon
  • I have commented my code, especially new classes, functions or any legacy code modified. (docblock)
  • I have commented my code, especially hard-to-understand areas of the PR.
  • I have made corresponding changes to the documentation.
  •  I have rebased my development branch on the base branch (master, maintenance).
Centreon team only
  • I have made sure that the unit tests related to the story are successful.
  • I have made sure that unit tests covers 80% of the code written for the story.
  • I have made sure that acceptance tests related to the story are successful (local and CI)

@kduret kduret merged commit bc2bcde into master Jul 17, 2019
@kduret kduret deleted the MON-3885-auditlog-purge branch July 17, 2019 16:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants