Skip to content
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

[sp_Blitz] msdb checks fire and fail because of permissions #3355

Closed
Montro1981 opened this issue Sep 26, 2023 · 2 comments
Closed

[sp_Blitz] msdb checks fire and fail because of permissions #3355

Montro1981 opened this issue Sep 26, 2023 · 2 comments

Comments

@Montro1981
Copy link
Contributor

Montro1981 commented Sep 26, 2023

Version of the script
Version 8.16
VersionDate 2023-08-20

What is the current behavior?
During the "declarations for First Responder Kit consistency check" step, a script is executed to retrieve all the databases where we have SELECT permissions, the msdb database can be included in this list.
Since we have SELECT permissions, the script assumes that we can also view the objects in the current security context.

The issue is similar to issue #3334
The errors are not fatal and the procedure will continue on it's merry way.

If the current behavior is a bug, please provide the steps to reproduce.
Create a user on the SQL server with VIEW SERVER STATE rights that is not mapped to the msdb database.
Execute:

SELECT [objectid] FROM msdb.sys.objects;

This should fail.

What is the expected behavior?
There is a @SkipMSDB variable declared but it is never set or used, I propose to include a check similar to the model database check that was created for issue #3334 that sets the @SkipMSDB variable. And when @SkipMSDB = 1 then checks 6, 28, 57, 79, 94, 123, 180, 181, and 219 need to be added to the #SkipChecks table

Montro1981 added a commit to Montro1981/SQL-Server-First-Responder-Kit that referenced this issue Sep 26, 2023
@Montro1981
Copy link
Contributor Author

Pull request #3358 created

BrentOzar added a commit that referenced this issue Oct 10, 2023
@BrentOzar BrentOzar added this to the 2023-10 Release milestone Oct 10, 2023
@BrentOzar
Copy link
Member

Thanks for the pull request! Good call on skipping those checks if we don't have access to MSDB, nicely done. Merging into the dev branch, will be in the next release with credit to you in the release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants