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

Added logging for troubleshooting/diagnosing settings #647

Merged
merged 1 commit into from
Aug 22, 2024
Merged
Changes from all commits
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
8 changes: 8 additions & 0 deletions Nudge/UI/Main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -263,20 +263,28 @@ class AppDelegate: NSObject, NSApplicationDelegate {
nudgePrimaryState.activelyExploitedCVEs = activelyExploitedCVEs
switch (activelyExploitedCVEs, presentCVEs, AppStateManager().requireMajorUpgrade()) {
case (false, true, true):
LogManager.notice("Non Actively Exploited Major Upgrade detected. Using nonActivelyExploitedCVEsMajorUpgradeSLA value: \(OSVersionRequirementVariables.nonActivelyExploitedCVEsMajorUpgradeSLA)", logger: sofaLog)
slaExtension = TimeInterval(OSVersionRequirementVariables.nonActivelyExploitedCVEsMajorUpgradeSLA * 86400)
case (false, true, false):
LogManager.notice("Non Actively Exploited Minor Update detected. Using nonActivelyExploitedCVEsMinorUpdateSLA value: \(OSVersionRequirementVariables.nonActivelyExploitedCVEsMinorUpdateSLA)", logger: sofaLog)
slaExtension = TimeInterval(OSVersionRequirementVariables.nonActivelyExploitedCVEsMinorUpdateSLA * 86400)
case (true, false, true): // The selected major upgrade does not have CVEs, but the old OS does
LogManager.notice("Actively Exploited Major Upgrade detected. Using activelyExploitedCVEsMajorUpgradeSLA value: \(OSVersionRequirementVariables.activelyExploitedCVEsMajorUpgradeSLA)", logger: sofaLog)
slaExtension = TimeInterval(OSVersionRequirementVariables.activelyExploitedCVEsMajorUpgradeSLA * 86400)
case (true, true, true):
LogManager.notice("Actively Exploited Major Upgrade detected. Using activelyExploitedCVEsMajorUpgradeSLA value: \(OSVersionRequirementVariables.activelyExploitedCVEsMajorUpgradeSLA)", logger: sofaLog)
slaExtension = TimeInterval(OSVersionRequirementVariables.activelyExploitedCVEsMajorUpgradeSLA * 86400)
case (true, false, false):
LogManager.notice("Actively Exploited Minor Update detected. Using activelyExploitedCVEsMinorUpdateSLA value: \(OSVersionRequirementVariables.activelyExploitedCVEsMinorUpdateSLA)", logger: sofaLog)
slaExtension = TimeInterval(OSVersionRequirementVariables.activelyExploitedCVEsMinorUpdateSLA * 86400)
case (true, true, false):
LogManager.notice("Actively Exploited Minor Update detected. Using activelyExploitedCVEsMinorUpdateSLA value: \(OSVersionRequirementVariables.activelyExploitedCVEsMinorUpdateSLA)", logger: sofaLog)
slaExtension = TimeInterval(OSVersionRequirementVariables.activelyExploitedCVEsMinorUpdateSLA * 86400)
case (false, false, true):
LogManager.notice("Standard Major Upgrade detected. Using standardMajorUpgradeSLA value: \(OSVersionRequirementVariables.standardMajorUpgradeSLA)", logger: sofaLog)
slaExtension = TimeInterval(OSVersionRequirementVariables.standardMajorUpgradeSLA * 86400)
case (false, false, false):
LogManager.notice("Standard Minor Update detected. Using standardMinorUpdateSLA value: \(OSVersionRequirementVariables.standardMinorUpdateSLA)", logger: sofaLog)
slaExtension = TimeInterval(OSVersionRequirementVariables.standardMinorUpdateSLA * 86400)
default: // If we get here, something is wrong, use 90 days as a safety
LogManager.warning("SLA Extension logic failed, using 90 days as a safety", logger: sofaLog)
Expand Down