From 599588532aa2b7d83f6df91d68c04428ddfe8a53 Mon Sep 17 00:00:00 2001 From: Andrew Walker Date: Wed, 7 Aug 2024 11:53:32 -0700 Subject: [PATCH] Add failover plugin auditing (#14146) This commit generates audit-trail for some HA-related configuration changes. --- src/middlewared/middlewared/plugins/failover.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/middlewared/middlewared/plugins/failover.py b/src/middlewared/middlewared/plugins/failover.py index c0b1164951adb..5ed3c0349caba 100644 --- a/src/middlewared/middlewared/plugins/failover.py +++ b/src/middlewared/middlewared/plugins/failover.py @@ -73,7 +73,7 @@ async def failover_extend(self, data): ('edit', {'name': 'master', 'method': lambda x: setattr(x, 'null', True)}), ('rm', {'name': 'id'}), ('attr', {'update': True}), - )) + ), audit='Failover config update') async def do_update(self, data): """ Update failover state. @@ -287,7 +287,7 @@ async def get_ips(self, app): """Get a list of IPs for which the webUI can be accessed.""" return await self.middleware.call('system.general.get_ui_urls') - @accepts() + @accepts(audit='Failover become passive') @returns() def become_passive(self): """ @@ -324,7 +324,7 @@ def become_passive(self): # this shouldn't be reached but better safe than sorry os.system('shutdown -r now') - @accepts(roles=['FAILOVER_WRITE']) + @accepts(roles=['FAILOVER_WRITE'], audit='Failover force master') @returns(Bool()) async def force_master(self): """ @@ -678,7 +678,7 @@ def upgrade_version(self): Str('train', empty=False), Bool('resume', default=False), Bool('resume_manual', default=False), - ), roles=['FAILOVER_WRITE']) + ), roles=['FAILOVER_WRITE'], audit='Failover upgrade') @returns(Bool()) @job(lock='failover_upgrade', pipes=['input'], check_pipes=False) def upgrade(self, job, options):