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

Add new virtual table windows_security_center #6256

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove useless includes
  • Loading branch information
terracatta committed Feb 19, 2020
commit e99d4e3b55deb2b0acac706e25b66b4edc27d840
13 changes: 7 additions & 6 deletions osquery/tables/system/windows/windows_security_center.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@
#include <wscapi.h>

#include <osquery/core.h>
#include <osquery/core/windows/wmi.h>
#include <osquery/logger.h>
#include <osquery/sql.h>
#include <osquery/tables.h>
#include <osquery/utils/conversions/windows/strings.h>
#include <osquery/utils/map_take.h>
#include <osquery/utils/scope_guard.h>

namespace osquery {
namespace tables {
Expand All @@ -29,6 +26,9 @@ const auto kSecurityProviderStates = std::unordered_map<int, std::string>{
};

std::string resolveProductHealthOrError(int productName) {
// Attempt a runtime link to the DLL containing these functions,
// since linking the library was causing a crash on some Windows
// machines (like the CI server).
typedef HRESULT(WINAPI * pWscGetSecurityProviderHealth)(
_In_ DWORD Providers, _Out_ PWSC_SECURITY_PROVIDER_HEALTH);
pWscGetSecurityProviderHealth WscGetSecurityProviderHealth;
Expand Down Expand Up @@ -73,9 +73,10 @@ bool windowsUpdateServicesEnabled() {
return true;
}

// In our testing, the Windows Update health check shows good, even if essential
// services are disabled If the the standard API call is good we verify these
// services are NOT disabled before we let the table return the "Good" result
// In our testing, the autoupdate health check shows "Good", even if essential
// services are disabled. If the the standard API call is "Good". we verify
// these services are NOT disabled before we let the table return the "Good"
// result
std::string genWindowsUpdateHealth() {
std::string productHealth =
resolveProductHealthOrError(WSC_SECURITY_PROVIDER_AUTOUPDATE_SETTINGS);
Expand Down