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

Malware protection 5: Refactor Special Error Types #3603

Merged
merged 32 commits into from
Dec 3, 2024

Conversation

mallexxx
Copy link
Collaborator

Task/Issue URL: https://app.asana.com/0/481882893211075/1208033567421351/f
BSK PR: duckduckgo/BrowserServicesKit#1098

Description:

  • Some final adjustments for Malware protection integration and Privacy Dashboard protocol change: refactor SSLErrorType, SpecialErrorData

Optional E2E tests:

  • Run PIR E2E tests
    Check this to run the Personal Information Removal end to end tests. If updating CCF, or any PIR related code, tick this.

Steps to test this PR:

  1. Validate SSL cert error page and bypassing works (https://badssl.com/)
  2. Validate Phishing detection works (http://privacy-test-pages.site/security/badware/phishing.html) – enable Feature Flag in Debug -> Feature flags for it to work

Definition of Done:


Internal references:

Pull Request Review Checklist
Software Engineering Expectations
Technical Design Template
Pull Request Documentation

@mallexxx mallexxx changed the title Alex/malware protection 5 Malware protection: Refactor Special Error Types Nov 27, 2024
Copy link
Contributor

github-actions bot commented Nov 27, 2024

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS against 5f30dee

@mallexxx mallexxx changed the title Malware protection: Refactor Special Error Types Malware protection 5: Refactor Special Error Types Nov 27, 2024
Base automatically changed from alex/malware-protection-4 to alex/malware-protection-3 November 29, 2024 07:24
Base automatically changed from alex/malware-protection-3 to alex/malware-protection-1 November 29, 2024 07:35
Copy link
Collaborator

@SabrinaTardio SabrinaTardio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not reviewed it all yet (also I see that you are still pushing changes) I left some comments meanwhile

DuckDuckGo/ContentBlocker/macos-config.json Outdated Show resolved Hide resolved
case is MaliciousSiteError:
return SpecialErrorPageHTMLTemplate.htmlFromTemplate

case is URLError where error.isServerCertificateUntrusted && featureFlagger.isFeatureOn(.sslCertificatesBypass):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

DuckDuckGo/Common/Extensions/URLExtension.swift Outdated Show resolved Hide resolved
DuckDuckGo/Onboarding/OnboardingNavigationResponder.swift Outdated Show resolved Hide resolved
DuckDuckGo/Preferences/View/PreferencesGeneralView.swift Outdated Show resolved Hide resolved
DuckDuckGo/Tab/Navigation/DuckURLSchemeHandler.swift Outdated Show resolved Hide resolved
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need changes here?
In general can we avoid changes that are unrelated to in the PR?
There also others… it’s becoming quite hard to follow/review

Copy link
Collaborator

@SabrinaTardio SabrinaTardio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

mallexxx added a commit to duckduckgo/BrowserServicesKit that referenced this pull request Dec 3, 2024
<!--
Note: This checklist is a reminder of our shared engineering
expectations.
-->

Please review the release process for BrowserServicesKit
[here](https://app.asana.com/0/1200194497630846/1200837094583426).

**Required**:

Task/Issue URL:
https://app.asana.com/0/481882893211075/1208033567421351/f
iOS PR: duckduckgo/iOS#3642
macOS PR: duckduckgo/macos-browser#3603
What kind of version bump will this require?: Major

**Description**:
- Some final adjustments for Malware protection integration and Privacy
Dashboard protocol change: refactor `SSLErrorType`, `SpecialErrorData`

<!--
Tagging instructions
If this PR isn't ready to be merged for whatever reason it should be
marked with the `DO NOT MERGE` label (particularly if it's a draft)
If it's pending Product Review/PFR, please add the `Pending Product
Review` label.

If at any point it isn't actively being worked on/ready for
review/otherwise moving forward (besides the above PR/PFR exception)
strongly consider closing it (or not opening it in the first place). If
you decide not to close it, make sure it's labelled to make it clear the
PRs state and comment with more information.
-->

**Steps to test this PR**:
1. Validate SSL cert error page and bypassing works
(https://badssl.com/)
2. Validate Phishing detection works
(http://privacy-test-pages.site/security/badware/phishing.html) – enable
Feature Flag in Debug -> Feature flags for it to work

<!--
Before submitting a PR, please ensure you have tested the combinations
you expect the reviewer to test, then delete configurations you *know*
do not need explicit testing.

Using a simulator where a physical device is unavailable is acceptable.
-->

**OS Testing**:

* [ ] iOS 14
* [ ] iOS 15
* [ ] iOS 16
* [ ] macOS 10.15
* [ ] macOS 11
* [ ] macOS 12

---
###### Internal references:
[Software Engineering
Expectations](https://app.asana.com/0/59792373528535/199064865822552)
[Technical Design
Template](https://app.asana.com/0/59792373528535/184709971311943)
mallexxx added a commit to duckduckgo/iOS that referenced this pull request Dec 3, 2024
<!--
Note: This checklist is a reminder of our shared engineering
expectations. Feel free to change it, although assigning a GitHub
reviewer and the items in bold are required.

⚠️ If you're an external contributor, please file an issue first before
working on a PR, as we can't guarantee that we will accept your changes
if they haven't been discussed ahead of time. Thanks!
-->

Task/Issue URL:
https://app.asana.com/0/481882893211075/1208033567421351/f
BSK PR: duckduckgo/BrowserServicesKit#1098
macOS PR: duckduckgo/macos-browser#3603

**Description**:
- Update Error Data type to match macOS

<!--
If at any point it isn't actively being worked on/ready for
review/otherwise moving forward strongly consider closing it (or not
opening it in the first place). If you decide not to close it, use Draft
PR while work is still in progress or use `DO NOT MERGE` label to
clarify the PRs state and comment with more information.
-->

**Steps to test this PR**:
1. Validate on badssl.com that bad SSL error handling works as before
and error page + bypass works

<!--
Before submitting a PR, please ensure you have tested the combinations
you expect the reviewer to test, then delete configurations you *know*
do not need explicit testing.

Using a simulator where a physical device is unavailable is acceptable.
-->

**Definition of Done (Internal Only)**:

* [ ] Does this PR satisfy our [Definition of
Done](https://app.asana.com/0/1202500774821704/1207634633537039/f)?

**Copy Testing**:

* [ ] Use of correct apostrophes in new copy, ie `’` rather than `'`

**Orientation Testing**:

* [ ] Portrait
* [ ] Landscape

**Device Testing**:

* [ ] iPhone SE (1st Gen)
* [ ] iPhone 8
* [ ] iPhone X
* [ ] iPhone 14 Pro
* [ ] iPad

**OS Testing**:

* [ ] iOS 15
* [ ] iOS 16
* [ ] iOS 17

**Theme Testing**:

* [ ] Light theme
* [ ] Dark theme

---
###### Internal references:
[Software Engineering
Expectations](https://app.asana.com/0/59792373528535/199064865822552)
[Technical Design
Template](https://app.asana.com/0/59792373528535/184709971311943)
@mallexxx mallexxx merged commit aeee5df into alex/malware-protection-1 Dec 3, 2024
14 of 16 checks passed
@mallexxx mallexxx deleted the alex/malware-protection-5 branch December 3, 2024 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants