Skip to content

Commit

Permalink
Malware protection 6: Malware integration (#3604)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/481882893211075/1208033567421351/f
BSK PR: duckduckgo/BrowserServicesKit#1099
- add .malware threat and special page types
  • Loading branch information
mallexxx authored Dec 10, 2024
1 parent 763dbb4 commit 708655c
Show file tree
Hide file tree
Showing 34 changed files with 282 additions and 114 deletions.
18 changes: 15 additions & 3 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1947,6 +1947,10 @@
84B49F0F2CB10F0900FF08BB /* OHHTTPStubsSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 84B49F0E2CB10F0900FF08BB /* OHHTTPStubsSwift */; };
84BBC7FF2CFA0D2F00BAE57A /* TestUtils in Frameworks */ = {isa = PBXBuildFile; productRef = 84BBC7FE2CFA0D2F00BAE57A /* TestUtils */; };
84BBC8012CFA0D3800BAE57A /* TestUtils in Frameworks */ = {isa = PBXBuildFile; productRef = 84BBC8002CFA0D3800BAE57A /* TestUtils */; };
84C96E462CF9BB6400A80A01 /* malwareFilterSet.json in Resources */ = {isa = PBXBuildFile; fileRef = 84C96E442CF9BB6400A80A01 /* malwareFilterSet.json */; };
84C96E472CF9BB6400A80A01 /* malwareHashPrefixes.json in Resources */ = {isa = PBXBuildFile; fileRef = 84C96E452CF9BB6400A80A01 /* malwareHashPrefixes.json */; };
84C96E482CF9BB6400A80A01 /* malwareFilterSet.json in Resources */ = {isa = PBXBuildFile; fileRef = 84C96E442CF9BB6400A80A01 /* malwareFilterSet.json */; };
84C96E492CF9BB6400A80A01 /* malwareHashPrefixes.json in Resources */ = {isa = PBXBuildFile; fileRef = 84C96E452CF9BB6400A80A01 /* malwareHashPrefixes.json */; };
84DC715A2C1C1E9000033B8C /* UserDefaultsWrapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84DC71582C1C1E8A00033B8C /* UserDefaultsWrapperTests.swift */; };
84DC715B2C1C1E9000033B8C /* UserDefaultsWrapperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84DC71582C1C1E8A00033B8C /* UserDefaultsWrapperTests.swift */; };
84DDB90A2C92B66E008C997B /* WKVisitedLinkStoreWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84DDB9092C92B667008C997B /* WKVisitedLinkStoreWrapper.swift */; };
Expand Down Expand Up @@ -4174,6 +4178,8 @@
84537A022C998C24008723BC /* FireWindowSession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FireWindowSession.swift; sourceTree = "<group>"; };
848648A02C76F4B20082282D /* BookmarksBarMenuViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarksBarMenuViewController.swift; sourceTree = "<group>"; };
84B479072CCA7A3900F40329 /* Logger+UnitTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Logger+UnitTests.swift"; sourceTree = "<group>"; };
84C96E442CF9BB6400A80A01 /* malwareFilterSet.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = malwareFilterSet.json; sourceTree = "<group>"; };
84C96E452CF9BB6400A80A01 /* malwareHashPrefixes.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = malwareHashPrefixes.json; sourceTree = "<group>"; };
84DC71582C1C1E8A00033B8C /* UserDefaultsWrapperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserDefaultsWrapperTests.swift; sourceTree = "<group>"; };
84DDB9092C92B667008C997B /* WKVisitedLinkStoreWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WKVisitedLinkStoreWrapper.swift; sourceTree = "<group>"; };
84F1C8CE2C7705B500716446 /* BookmarksBarMenuPopover.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarksBarMenuPopover.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -9739,11 +9745,13 @@
CDE248A22C821FD500F9399D /* MaliciousSiteProtection */ = {
isa = PBXGroup;
children = (
CDE248A62C821FFE00F9399D /* phishingFilterSet.json */,
CDE248A32C821FFE00F9399D /* phishingHashPrefixes.json */,
CDE248A42C821FFE00F9399D /* MaliciousSiteProtectionManager.swift */,
CDE248A52C821FFE00F9399D /* MaliciousSiteProtectionPreferences.swift */,
CDE248A72C821FFE00F9399D /* MaliciousSiteProtectionState.swift */,
84C96E442CF9BB6400A80A01 /* malwareFilterSet.json */,
84C96E452CF9BB6400A80A01 /* malwareHashPrefixes.json */,
CDE248A62C821FFE00F9399D /* phishingFilterSet.json */,
CDE248A32C821FFE00F9399D /* phishingHashPrefixes.json */,
);
path = MaliciousSiteProtection;
sourceTree = "<group>";
Expand Down Expand Up @@ -10654,6 +10662,8 @@
3706FCD0293F65D500E42796 /* BookmarksBarCollectionViewItem.xib in Resources */,
3706FCD2293F65D500E42796 /* shield.json in Resources */,
7B5A23762C46A4A8007213AC /* ExcludedDomains.storyboard in Resources */,
84C96E482CF9BB6400A80A01 /* malwareFilterSet.json in Resources */,
84C96E492CF9BB6400A80A01 /* malwareHashPrefixes.json in Resources */,
3706FCD6293F65D500E42796 /* httpsMobileV2FalsePositives.json in Resources */,
3706FCD8293F65D500E42796 /* BookmarksBar.storyboard in Resources */,
3706FCD9293F65D500E42796 /* trackers-1.json in Resources */,
Expand Down Expand Up @@ -10848,6 +10858,8 @@
4BE5336B286912D40019DBFD /* BookmarksBarCollectionViewItem.xib in Resources */,
AA34396C2754D4E300B241FA /* shield.json in Resources */,
7B5A23752C46A4A8007213AC /* ExcludedDomains.storyboard in Resources */,
84C96E462CF9BB6400A80A01 /* malwareFilterSet.json in Resources */,
84C96E472CF9BB6400A80A01 /* malwareHashPrefixes.json in Resources */,
4B677435255DBEB800025BD8 /* httpsMobileV2FalsePositives.json in Resources */,
4BD18F05283F151F00058124 /* BookmarksBar.storyboard in Resources */,
AA3439792754D55100B241FA /* trackers-1.json in Resources */,
Expand Down Expand Up @@ -15225,7 +15237,7 @@
repositoryURL = "https://github.com/duckduckgo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 220.0.0;
version = 221.0.1;
};
};
9FF521422BAA8FF300B9819B /* XCRemoteSwiftPackageReference "lottie-spm" */ = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/BrowserServicesKit",
"state" : {
"revision" : "55e7de13a99793329993367169c9b6bafbd07bac",
"version" : "220.0.0"
"revision" : "b7f7ba99f7c77b576679eee426ddd80320dc74d8",
"version" : "221.0.1"
}
},
{
"identity" : "content-scope-scripts",
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/content-scope-scripts",
"state" : {
"revision" : "c4bb146afdf0c7a93fb9a7d95b1cb255708a470d",
"version" : "6.41.0"
"revision" : "93ea6c3e771bc0b743b38cefbff548c10add9898",
"version" : "6.42.0"
}
},
{
Expand Down Expand Up @@ -104,8 +104,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/duckduckgo/privacy-dashboard",
"state" : {
"revision" : "49db79829dcb166b3524afdbc1c680890452ce1c",
"version" : "7.2.1"
"revision" : "022c845b06ace6a4aa712a4fa3e79da32193d5c6",
"version" : "7.4.0"
}
},
{
Expand Down
1 change: 0 additions & 1 deletion DuckDuckGo/Bookmarks/Services/BookmarkStoreMock.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ final class BookmarkStoreMock: BookmarkStore, CustomDebugStringConvertible {
queue.append(contentsOf: folder.children)
}
}
var indexInFavoritesArray = 0
store?.save(entitiesAtIndices: entities.map { ($0, nil, nil) }, completion: { _ in })
}
}
Expand Down
2 changes: 2 additions & 0 deletions DuckDuckGo/Common/Extensions/URLExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,8 @@ extension URL {
return URL(string: "https://duckduckgo.com/duckduckgo-help-pages/sync-and-backup/password-manager-security/")!
}

static var maliciousSiteProtectionLearnMore = URL(string: "https://duckduckgo.com/duckduckgo-help-pages/privacy/phishing-and-malware-protection/")!

static var searchSettings: URL {
return URL(string: "https://duckduckgo.com/settings/")!
}
Expand Down
5 changes: 3 additions & 2 deletions DuckDuckGo/Common/Localizables/UserText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ struct UserText {
static let webProcessCrashPageMessage = NSLocalizedString("page.crash.message", value: "Try reloading the page or come back later.", comment: "Error page message text shown when a Web Page process had crashed")
static let sslErrorPageTabTitle = NSLocalizedString("ssl.error.page.tab.title", value: "Warning: Site May Be Insecure", comment: "Title shown in an error page tab that warn users of security risks on a website due to SSL issues")
static let phishingErrorPageTabTitle = NSLocalizedString("phishing.error.page.tab.title", value: "Warning: Site May Be Deceptive", comment: "Title shown in an error page tab that warn users of security risks on a website that has been flagged as Phishing.")
static let malwareErrorPageTabTitle = NSLocalizedString("malware.error.page.tab.title", value: "Warning: Site May Be Malicious", comment: "Title shown in an error page tab that warn users of security risks on a website that has been flagged as Malware.")

static let openSystemPreferences = NSLocalizedString("open.preferences", value: "Open System Preferences", comment: "Open System Preferences (to re-enable permission for the App) (up to and including macOS 12")
static let openSystemSettings = NSLocalizedString("open.settings", value: "Open System Settings…", comment: "This string represents a prompt or button label prompting the user to open system settings")
Expand Down Expand Up @@ -446,8 +447,8 @@ struct UserText {
static let downloadsOpenPopupOnCompletion = NSLocalizedString("downloads.open.on.completion", value: "Automatically open the Downloads panel when downloads complete", comment: "Checkbox to open a Download Manager popover when downloads are completed")

static let maliciousSiteDetectionHeader = NSLocalizedString("phishing-detection.enabled.header", value: "Malicious Site Protection", comment: "Header for phishing site protection section in the settings page")
static let maliciousSiteDetectionIsEnabled = NSLocalizedString("phishing-detection.enabled.checkbox", value: "Allow DuckDuckGo to warn you before loading a webpage that has been flagged as malicious or fraudulent.", comment: "Checkbox that enables or disables the phishing detection feature in the browser")
static let maliciousDetectionEnabledWarning = NSLocalizedString("phishing-detection.enabled.warning", value: "Disabling this feature can put your personal information at risk. Only do so if you fully understand the risk involved.", comment: "A description box to warn users away from disabling malicious site protection")
static let maliciousSiteDetectionIsEnabled = NSLocalizedString("phishing-detection.enabled.checkbox", value: "Warn me on sites flagged for phishing or malware.", comment: "Checkbox that enables or disables the phishing and malware detection feature in the browser")
static let maliciousDetectionEnabledWarning = NSLocalizedString("phishing-detection.enabled.warning", value: "Disabling this feature can put your personal information at risk.", comment: "A description box to warn users away from disabling the phishing and malware protection feature")

// MARK: Password Manager
static let passwordManagementAllItems = NSLocalizedString("passsword.management.all-items", value: "All Items", comment: "Used as title for the Autofill All Items option")
Expand Down
2 changes: 1 addition & 1 deletion DuckDuckGo/Common/Utilities/UserDefaultsWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public struct UserDefaultsWrapper<T> {

case homeButtonPosition = "preferences.appeareance.home-button-position"

case phishingDetectionEnabled = "preferences.security.phishing-detection-enabled"
case maliciousSiteDetectionEnabled = "preferences.security.phishing-detection-enabled"

// ATB
case installDate = "statistics.installdate.key"
Expand Down
52 changes: 32 additions & 20 deletions DuckDuckGo/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -35845,6 +35845,18 @@
}
}
},
"malware.error.page.tab.title" : {
"comment" : "Title shown in an error page tab that warn users of security risks on a website that has been flagged as Malware.",
"extractionState" : "extracted_with_value",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Warning: Site May Be Malicious"
}
}
}
},
"Manage Bookmarks" : {
"comment" : "Main Menu History item",
"localizations" : {
Expand Down Expand Up @@ -44903,60 +44915,60 @@
}
},
"phishing-detection.enabled.checkbox" : {
"comment" : "Checkbox that enables or disables the phishing detection feature in the browser",
"comment" : "Checkbox that enables or disables the phishing and malware detection feature in the browser",
"extractionState" : "extracted_with_value",
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"state" : "needs_review",
"value" : "Erlaube DuckDuckGo, dich zu warnen, bevor eine Webseite geladen wird, die als bösartig oder betrügerisch gekennzeichnet wurde."
}
},
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Allow DuckDuckGo to warn you before loading a webpage that has been flagged as malicious or fraudulent."
"value" : "Warn me on sites flagged for phishing or malware."
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
"state" : "needs_review",
"value" : "Permite que DuckDuckGo te avise antes de cargar una página web que se haya marcado como maliciosa o fraudulenta."
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
"state" : "needs_review",
"value" : "Autorisez DuckDuckGo à vous avertir avant de charger une page Web signalée comme malveillante ou frauduleuse."
}
},
"it" : {
"stringUnit" : {
"state" : "translated",
"state" : "needs_review",
"value" : "Consenti a DuckDuckGo di avvisarti prima di caricare una pagina web contrassegnata come dannosa o fraudolenta."
}
},
"nl" : {
"stringUnit" : {
"state" : "translated",
"state" : "needs_review",
"value" : "Laat DuckDuckGo je waarschuwen voordat je een webpagina laadt die als kwaadaardig of frauduleus is gemarkeerd."
}
},
"pl" : {
"stringUnit" : {
"state" : "translated",
"state" : "needs_review",
"value" : "Zezwól DuckDuckGo na ostrzeganie przed załadowaniem strony internetowej, która została oznaczona jako złośliwa lub jako oszustwo."
}
},
"pt" : {
"stringUnit" : {
"state" : "translated",
"state" : "needs_review",
"value" : "Permitir que o DuckDuckGo te avise antes de carregar uma página que foi sinalizada como maliciosa ou fraudulenta."
}
},
"ru" : {
"stringUnit" : {
"state" : "translated",
"state" : "needs_review",
"value" : "Разрешить DuckDuckGo предупреждать вас о потенциально вредоносных или мошеннических сайтах перед загрузкой страницы."
}
}
Expand Down Expand Up @@ -45023,60 +45035,60 @@
}
},
"phishing-detection.enabled.warning" : {
"comment" : "A description box to warn users away from disabling malicious site protection",
"comment" : "A description box to warn users away from disabling the phishing and malware protection feature",
"extractionState" : "extracted_with_value",
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"state" : "needs_review",
"value" : "Das Deaktivieren dieser Funktion kann deine persönlichen Daten gefährden. Wenn du dir über die damit verbundenen Risiken im Klaren bist, kannst du trotzdem fortfahren."
}
},
"en" : {
"stringUnit" : {
"state" : "new",
"value" : "Disabling this feature can put your personal information at risk. Only do so if you fully understand the risk involved."
"value" : "Disabling this feature can put your personal information at risk."
}
},
"es" : {
"stringUnit" : {
"state" : "translated",
"state" : "needs_review",
"value" : "Desactivar esta función puede poner en riesgo tu información personal. Hazlo solo si entiendes completamente el riesgo que implica."
}
},
"fr" : {
"stringUnit" : {
"state" : "translated",
"state" : "needs_review",
"value" : "La désactivation de cette fonctionnalité peut mettre vos informations personnelles en danger. Faites-le uniquement si vous comprenez parfaitement les risques encourus."
}
},
"it" : {
"stringUnit" : {
"state" : "translated",
"state" : "needs_review",
"value" : "Disabilitando questa funzione, potresti mettere a rischio i tuoi dati personali. Fallo solo se comprendi appieno il rischio che comporta."
}
},
"nl" : {
"stringUnit" : {
"state" : "translated",
"state" : "needs_review",
"value" : "Als je deze functie uitschakelt, kunnen je persoonlijke gegevens in gevaar komen. Doe dit alleen als je het risico volledig begrijpt."
}
},
"pl" : {
"stringUnit" : {
"state" : "translated",
"state" : "needs_review",
"value" : "Wyłączenie tej funkcji może narazić Twoje dane osobowe na ryzyko. Rób to tylko wtedy, gdy rozumiesz związane z tym zagrożenie."
}
},
"pt" : {
"stringUnit" : {
"state" : "translated",
"state" : "needs_review",
"value" : "Desativar esta funcionalidade pode pôr em risco as tuas informações pessoais. Não desatives a menos que compreendas os riscos."
}
},
"ru" : {
"stringUnit" : {
"state" : "translated",
"state" : "needs_review",
"value" : "При отключении этой функции ваши личные данные могут оказаться под угрозой. Эту функцию следует деактивировать только в том случае, если вы осознаете связанные с этим риски."
}
}
Expand Down
Loading

0 comments on commit 708655c

Please sign in to comment.