Closed Bug 1522265 Opened 5 years ago Closed 5 years ago

Moving malware, phishing and blocked URIs to features

Categories

(Toolkit :: Safe Browsing, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: baku, Assigned: baku)

References

Details

Attachments

(4 files, 3 obsolete files)

Malware, phishing and blockedURIs are 3 classifiers which have not been ported to features yet. I have 3 patches to do it. This is not clean as much as I would like to, but it's a good starting point.

Attached patch part 1 - features (obsolete) — Splinter Review
Assignee: nobody → amarchesini
Attachment #9038652 - Flags: review?(dlee)
Attached patch part 2 - factory (obsolete) — Splinter Review
Attachment #9038653 - Flags: review?(dlee)
Attachment #9038654 - Flags: review?(dlee)
Priority: -- → P2
Attached patch part 1 - features (obsolete) — Splinter Review
Attachment #9038652 - Attachment is obsolete: true
Attachment #9038652 - Attachment is obsolete: true
Attachment #9038652 - Flags: review?(dlee)
Attachment #9039516 - Flags: review?(dlee)
Attachment #9038652 - Flags: review?(dlee)
Attachment #9039517 - Flags: review?(dlee)
Blocks: 1513046
Status: NEW → ASSIGNED
Comment on attachment 9039517 [details] [diff] [review]
part 1 - features

Review of attachment 9039517 [details] [diff] [review]:
-----------------------------------------------------------------

Take a quick look and I guess another part1 feature is duplicate?
Attachment #9039517 - Flags: review?(dlee) → review+
Comment on attachment 9038653 [details] [diff] [review]
part 2 - factory

Review of attachment 9038653 [details] [diff] [review]:
-----------------------------------------------------------------

I think you want to update this patch because it still uses the old for loop
Attachment #9038653 - Flags: review?(dlee)
Attached patch part 2 - factorySplinter Review
Attachment #9038653 - Attachment is obsolete: true
Attachment #9039625 - Flags: review?(dlee)
Attachment #9039516 - Attachment is obsolete: true
Attachment #9039516 - Flags: review?(dlee)
Attachment #9039625 - Flags: review?(dlee) → review+
Comment on attachment 9038654 [details] [diff] [review]
part 3 - DBService

Review of attachment 9038654 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM! baku, thank you for working on this!

::: toolkit/components/url-classifier/Classifier.cpp
@@ -406,5 @@
>  
> -nsresult Classifier::CheckURI(const nsACString& aSpec,
> -                              const nsTArray<nsCString>& aTables,
> -                              LookupResultArray& aResults) {
> -  Telemetry::AutoTimer<Telemetry::URLCLASSIFIER_CL_CHECK_TIME> timer;

move this telemetry to FeatureHolder::DoLocalLookup to keep monitoring the lookup time.

::: toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
@@ +1700,5 @@
>  
>    // XXX: Do we *really* need to be able to change all of these at runtime?
>    // Note: These observers should only be added when everything else above has
>    //       succeeded. Failing to do so can cause long shutdown times in certain
>    //       situations. See Bug 1247798 and Bug 1244803.

The comment can be removed.

@@ +1770,5 @@
>  
>    NS_ENSURE_TRUE(gDbBackgroundThread, NS_ERROR_NOT_INITIALIZED);
>  
> +  nsTArray<RefPtr<nsIUrlClassifierFeature>> features;
> +  mozilla::net::UrlClassifierFeatureFactory::GetFeaturesNoChannel(features);

This looks strange to me, I think it is more clear that we use
UrlClassifierFeaturePhishingProtection and add a comment about Phishing Protection feature doesn't require a channel.

The reason I suggest use PhisingProtection instead of SafeBrowsing is because : "The Safe Browsing feature in Firefox has been renamed to Phishing Protection, but it's still known as Safe Browsing internally[1]"

[1] https://wiki.mozilla.org/Security/Safe_Browsing

::: toolkit/components/url-classifier/nsUrlClassifierDBService.h
@@ +134,5 @@
>    // processed.
>    bool mInUpdate;
>  
>    // The list of tables that can use the default hash completer object.
>    nsTArray<nsCString> mGethashTables;

We can also remove this now
Attachment #9038654 - Flags: review?(dlee) → review+

Just renamed NoChannel to PhishingProtection.

Attachment #9039659 - Flags: review?(dlee)
Attachment #9039659 - Flags: review?(dlee) → review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/e6a0832f3b11
Moving malware, phishing and blocked URIs to features - part 1 - feature no channel, r=dimi
https://hg.mozilla.org/integration/mozilla-inbound/rev/6085d51681f8
Moving malware, phishing and blocked URIs to features - part 2 - factory updated, r=dimi
https://hg.mozilla.org/integration/mozilla-inbound/rev/38b824df9d02
Moving malware, phishing and blocked URIs to features - part 3 - DBService updated, r=dimi
https://hg.mozilla.org/integration/mozilla-inbound/rev/38b4179568c7
Moving malware, phishing and blocked URIs to features - part 4 - Phishing Protection, r=dimi
Flags: needinfo?(amarchesini)
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ce4973824e42
Moving malware, phishing and blocked URIs to features - part 1 - feature no channel, r=dimi
https://hg.mozilla.org/integration/mozilla-inbound/rev/32eedda05a80
Moving malware, phishing and blocked URIs to features - part 2 - factory updated, r=dimi
https://hg.mozilla.org/integration/mozilla-inbound/rev/ac7f6aeaa6de
Moving malware, phishing and blocked URIs to features - part 3 - DBService updated, r=dimi
https://hg.mozilla.org/integration/mozilla-inbound/rev/c3d216ba3e15
Moving malware, phishing and blocked URIs to features - part 4 - Phishing Protection, r=dimi
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7b0986d3e0a4
Moving malware, phishing and blocked URIs to features - part 5 - Fix a method name call, r=me CLOSED TREE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: