Skip to content

Commit

Permalink
Add auditing for tunable changes (#14149)
Browse files Browse the repository at this point in the history
Generate an audit trail for users making changes to tunables.
  • Loading branch information
anodos325 authored Aug 6, 2024
1 parent 92896c3 commit c416bf7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/middlewared/middlewared/plugins/tunables.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async def tunable_type_choices(self):
Bool('enabled', default=True),
Bool('update_initramfs', default=True),
register=True
))
), audit='Tunable create')
@job(lock='tunable_crud')
async def do_create(self, job, data):
"""
Expand Down Expand Up @@ -183,7 +183,8 @@ async def do_create(self, job, data):
('rm', {'name': 'type'}),
('rm', {'name': 'var'}),
('attr', {'update': True}),
)
),
audit='Tunable update'
)
@job(lock='tunable_crud')
async def do_update(self, job, id_, data):
Expand Down Expand Up @@ -224,6 +225,7 @@ async def do_update(self, job, id_, data):

return await self.get_instance(id_)

@accepts(Int('id', required=True), audit='Tunable delete')
@job(lock='tunable_crud')
async def do_delete(self, job, id_):
"""
Expand Down

0 comments on commit c416bf7

Please sign in to comment.