dbatools icon indicating copy to clipboard operation
dbatools copied to clipboard

SQL Server Patch Management / Early Warning System

Open sql-williamd opened this issue 8 years ago • 8 comments

Feature Request

We are seeing the storm brewing around the Intel CPU scandal. Microsoft has already issued emergency patches for SQL Server 2016 and 2017, with more to come.

There is already some version checking code, along with the build information table here: https://sqlcollaborative.github.io/builds

These are all great to identify if your systems are patched, but with this Spectre/Meltdown being such a specific emergency patch (whether warranted or not), it would be great to have the ability for dbatools to offer a new command/feature allowing for a patch that is "ultra-mega-super critical" to be marked as such and cause dbatools to throw a huge, unmissable tantrum about the patch missing on any machines.

It could be argued that SQL 2016 SP1 would have a similar warning, because of the amazing extras unlocked by it, although that isn't a security alert. Maybe this is something to put into different categories, but certainly allow a more "verbal" warning system.

Of course, this may be something for a certain side project too.

sql-williamd avatar Jan 04 '18 19:01 sql-williamd

haha, "certain"... guess we can put a prio on https://github.com/sqlcollaborative/dbatools/issues/2375 . I'll cook something up right away.

niphlod avatar Jan 04 '18 19:01 niphlod

I was asked to word it that way 😄

Yeah, that is similar to/in conjunction with #2375 for sure.

sql-williamd avatar Jan 04 '18 19:01 sql-williamd

Overall I don't see a need to have special commands that bring attention to the patching for the CPU bugs. From a security standpoint, these are no different or more critical than other MS bulletins put out for security fixes. It is just the amount of systems involved in the CPU bugs has brought more attention to it.

I'd say what we have in Test-DbaSqlBuild is sufficient.

wsmelton avatar Jan 14 '18 04:01 wsmelton

Hi @wsmelton - I didn't mean for a special cpu bug based issue system. I was meaning for the current command to somehow provide a clearer warning about critical patches becoming available. As it is, Test-DbaSqlBuild informs if a server is behind patching. However, many companies don't necessarily see these patches as important. A clear sign that a patch is an emergency/critical fix requiring immediate action would help make this clear.

sql-williamd avatar Jan 14 '18 09:01 sql-williamd

To do that on a continuous basis would require that we manually flag them as such. There is no way based on a KB number or build number to know anything more than it is an SP, CU, or out of cycle patch (which on average now are security patches). Which the out of cycle patches are generally all categorized as critical by Windows Update, WSUS, and Microsoft. If we start manually flagging them, who makes the discussion that it is or is not?

Just as a reference most of the sites that keep up with patches for SQL Server, like Ozar's site (https://sqlserverupdates.com/sql-server-2017-updates/) make no reference that a CU is critical/emergency. As well, the latest batches of patches that were released for SQL Server in the last few weeks are only critical for the CPU issue based on how you are running SQL Server. So that lays out a problem of how do you state it is critical or not?

I would say that companies do see patches as important. Any company (whether fortune 500 or mom and pop type) that has to keep up with security protocols/standards for their system, or employes a CIO or CSO is going to note the severity of a patch that was released. They monitor the MS security bulletins from Microsoft or other vulnerability notifications by 3rd party security vendors. I can attest to that because I have worked in a security team that bore the responsibility.

wsmelton avatar Jan 14 '18 11:01 wsmelton

I agree that it involves work, but I am not seeing your experience of patches being seen as important to most companies over here in Europe.

I very rarely see SQL server being patched when I visit new clients. It is almost the norm to see the SQL server instances patched to the level that was available at install time (RTM is quite common tbh).

There are caveats to my anecdotal evidence, where legal requirements cause patching to be more frequent, but I'd wager that most instances are not patched.

Either way, it would be great to have the ability to do this somehow. Maybe the ability for a user of dbatools to externally mark certain patches (a json file or something), so that it is a user defined setup instead of universal.

sql-williamd avatar Jan 14 '18 12:01 sql-williamd

Either way, it would be great to have the ability to do this somehow. Maybe the ability for a user of dbatools to externally mark certain patches (a json file or something), so that it is a user defined setup instead of universal.

This sounds more like an external utility that utilizes dbatools and the build index we have in the module. A wrapper that takes a json file and then does some Pester testing to flag builds as desired.

wsmelton avatar Jan 15 '18 07:01 wsmelton

BTW, given each "environment" "requires" "some patches" (and yes, I quoted all three of them), there's nothing easier than defining for the environment you want to care for a target build and use test-dbasqlbuild with that as a target. There is no silver bullet around.

niphlod avatar Jan 15 '18 07:01 niphlod