Skip to content

Commit

Permalink
Add debug info for system firewall
Browse files Browse the repository at this point in the history
  • Loading branch information
dz0ny committed Aug 16, 2022
1 parent 0583507 commit c43d593
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
9 changes: 9 additions & 0 deletions Pareto/Checks/Firewall and Sharing/FirewallStealth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ class FirewallStealthCheck: ParetoCheck {
return FirewallCheck.sharedInstance.isActive && isActive
}

override public var hasDebug: Bool {
return true
}

override public func debugInfo() -> String {
let dictionary = readDefaultsFile(path: "/Library/Preferences/com.apple.alf.plist")
return "com.apple.alf.plist:\n\(dictionary.debugDescription)"
}

override public var showSettings: Bool {
if teamEnforced {
return false
Expand Down
2 changes: 1 addition & 1 deletion Pareto/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>4885</string>
<string>4886</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
Expand Down
5 changes: 4 additions & 1 deletion Pareto/Models/TimeMachineBackup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ enum EncryptionState: String {
struct TimeMachineDestinations {
let LastKnownEncryptionState: EncryptionState
let DestinationID: String
let DiskImageKeychainUUID: String
let ReferenceLocalSnapshotDate: Date // Last time of backup
let BackupAlias: Data
let IsNAS: Bool
Expand All @@ -22,6 +23,7 @@ struct TimeMachineDestinations {
guard let dict = obj else {
LastKnownEncryptionState = EncryptionState.Unknown
DestinationID = ""
DiskImageKeychainUUID = ""
ReferenceLocalSnapshotDate = Date.distantPast
BackupAlias = Data(capacity: 0)
IsNAS = false
Expand All @@ -32,11 +34,12 @@ struct TimeMachineDestinations {
IsNAS = backup.contains("afp://") || backup.contains("smb://")
LastKnownEncryptionState = EncryptionState(rawValue: dict["LastKnownEncryptionState"] as? String ?? "") ?? EncryptionState.Unknown
DestinationID = dict["DestinationID"] as? String ?? ""
DiskImageKeychainUUID = dict["DiskImageKeychainUUID"] as? String ?? ""
ReferenceLocalSnapshotDate = dict["ReferenceLocalSnapshotDate"] as? Date ?? Date.distantPast
}

var isEncrypted: Bool {
return LastKnownEncryptionState == EncryptionState.Encrypted
return LastKnownEncryptionState == EncryptionState.Encrypted || !DiskImageKeychainUUID.isEmpty
}

var isUpToDateBackup: Bool {
Expand Down

0 comments on commit c43d593

Please sign in to comment.