Forum Discussion

akaraulli's avatar
akaraulli
Brass Contributor
Feb 29, 2024
Solved

Select from sys.fn_get_audit_file without CONTROL SERVER

Hi

We are pulling MS SQL Server audit records using sys.fn_get_audit_file

Server Login MYUSER

Not mapped to any non-system database

Related DB User on database "master" is: myuser

Granted CONTROL SERVER and (of course) Connect

 

Can execute:

select * from sys.fn_get_audit_file(<path>, default, default)


Problem:
Granting CONTROL SERVER to a user that needs to only SELECT the audit records - and doing nothing else - looks too much.

So we tried:

Revoke CONTROL SERVER form Server Login MYUSER

On database "master", grant DB User “myuser” SELECT on sys.fn_get_audit_file

 

Now the Server Login MYUSER cannot execute:

select * from sys.fn_get_audit_file(<path>, default, default)

 

Error Message:

Msg 300, Level 14, State 1, Line 1

CONTROL SERVER permission was denied on object 'server', database 'master'.

Msg 297, Level 16, State 1, Line 1

The user does not have permission to perform this action.

Question:
Is it possible to SELECT from sys.fn_get_audit_file without having the CONTROL SERVER ?

best regards
Altin

6 Replies

Resources