Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Issue 1643573002: Add a ModuleLoadAnalyzer which checks modules against a whitelist (Closed)

Created:
4 years, 11 months ago by proberge
Modified:
4 years, 10 months ago
CC:
grt+watch_chromium.org, vmpstr+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a ModuleLoadAnalyzer which checks modules against a whitelist and reports suspicious modules. The ModuleLoadAnalyzer is only enabled if a profile with Safebrowsing Extended Reporting is found. In addition, a feature flag must be enabled through the command line or a field trial. BUG=585123 Committed: https://crrev.com/908da69d25746389d4b695e989b3df5e31e88341 Cr-Commit-Position: refs/heads/master@{#377604}

Patch Set 1 #

Patch Set 2 : Remove accidentally added rsp files from the CL #

Patch Set 3 : Only enable for extended reporting AND feature flag. Add unit test. #

Total comments: 12

Patch Set 4 : Update safe_browsing_db unit test and minor cleanups #

Total comments: 4

Patch Set 5 : Address comments for patchsets #3 and #4 #

Total comments: 4

Patch Set 6 : abort_reporting to static field, add test for shutdown case #

Total comments: 2

Patch Set 7 : s/soon when/soon as #

Total comments: 9

Patch Set 8 : Make module_load_analyzer classless, remove static global and use CONTINUE_ON_SHUTDOWN #

Total comments: 50

Patch Set 9 : Resolve comments on #8 and add consent level to Incidents #

Total comments: 67

Patch Set 10 : Address comments on #9 #

Patch Set 11 : Rebase-update after dependent CL submitted #

Total comments: 2

Patch Set 12 : Fix incorrect and misleading unit tests in for blacklist_load and suspicious_module incidents #

Total comments: 2

Patch Set 13 : rebase-update'd #

Unified diffs Side-by-side diffs Delta from patch set Stats (+597 lines, -20 lines) Patch
M chrome/browser/safe_browsing/incident_reporting/blacklist_load_incident_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +8 lines, -8 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/incident.h View 1 2 3 4 5 6 7 8 9 2 chunks +13 lines, -1 line 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/incident.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.h View 1 2 2 chunks +9 lines, -0 lines 0 comments Download
M chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc View 1 2 3 4 5 6 7 8 9 10 8 chunks +57 lines, -11 lines 0 comments Download
A chrome/browser/safe_browsing/incident_reporting/module_load_analyzer.h View 1 2 3 4 5 6 7 8 9 1 chunk +29 lines, -0 lines 0 comments Download
A chrome/browser/safe_browsing/incident_reporting/module_load_analyzer.cc View 1 2 3 4 5 6 7 8 9 1 chunk +45 lines, -0 lines 0 comments Download
A chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc View 1 2 3 4 5 6 7 8 9 1 chunk +138 lines, -0 lines 0 comments Download
A chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +121 lines, -0 lines 0 comments Download
A chrome/browser/safe_browsing/incident_reporting/suspicious_module_incident.h View 1 2 3 4 5 6 7 8 1 chunk +39 lines, -0 lines 0 comments Download
A chrome/browser/safe_browsing/incident_reporting/suspicious_module_incident.cc View 1 2 3 4 5 6 7 8 1 chunk +43 lines, -0 lines 0 comments Download
A chrome/browser/safe_browsing/incident_reporting/suspicious_module_incident_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +47 lines, -0 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/safe_browsing/safe_browsing_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +8 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/safe_browsing/csd.proto View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +8 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +19 lines, -0 lines 0 comments Download

Messages

Total messages: 47 (15 generated)
proberge
Please only review what's inside the incident_reporting folder, I'll have a safe_browsing owner look at ...
4 years, 10 months ago (2016-02-05 20:36:08 UTC) #3
robertshield
https://codereview.chromium.org/1643573002/diff/40001/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.h File chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.h (right): https://codereview.chromium.org/1643573002/diff/40001/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.h#newcode102 chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.h:102: // a profile participating in extended reporting is found. ...
4 years, 10 months ago (2016-02-05 21:20:32 UTC) #4
veranika
https://codereview.chromium.org/1643573002/diff/60001/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc File chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc (right): https://codereview.chromium.org/1643573002/diff/60001/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc#newcode411 chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc:411: prefs::kSafeBrowsingExtendedReportingEnabled)) Wouldn't it be better to use IncidentReportingService::IsEnabledForProfile here? ...
4 years, 10 months ago (2016-02-05 22:15:10 UTC) #8
proberge
https://codereview.chromium.org/1643573002/diff/40001/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.h File chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.h (right): https://codereview.chromium.org/1643573002/diff/40001/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.h#newcode102 chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.h:102: // a profile participating in extended reporting is found. ...
4 years, 10 months ago (2016-02-05 22:26:10 UTC) #9
robertshield
Sending one comment now, still completing second pass. https://codereview.chromium.org/1643573002/diff/80001/chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc File chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc (right): https://codereview.chromium.org/1643573002/diff/80001/chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc#newcode103 chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc:103: if ...
4 years, 10 months ago (2016-02-08 16:22:02 UTC) #10
robertshield
https://codereview.chromium.org/1643573002/diff/80001/chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win_unittest.cc File chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win_unittest.cc (right): https://codereview.chromium.org/1643573002/diff/80001/chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win_unittest.cc#newcode89 chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win_unittest.cc:89: } Is it possible to test the shut down ...
4 years, 10 months ago (2016-02-08 16:28:02 UTC) #11
proberge
https://codereview.chromium.org/1643573002/diff/80001/chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc File chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc (right): https://codereview.chromium.org/1643573002/diff/80001/chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc#newcode103 chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc:103: if (abort_reporting_) On 2016/02/08 16:22:02, robertshield wrote: > As ...
4 years, 10 months ago (2016-02-08 21:43:47 UTC) #12
robertshield
lgtm https://codereview.chromium.org/1643573002/diff/100001/chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc File chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc (right): https://codereview.chromium.org/1643573002/diff/100001/chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc#newcode87 chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc:87: // soon when the analyzer is destroyed. s/soon ...
4 years, 10 months ago (2016-02-09 14:57:25 UTC) #13
grt (UTC plus 2)
I have some questions about the threading model. Please ping me when you have a ...
4 years, 10 months ago (2016-02-09 15:21:23 UTC) #15
proberge
++rkaplow for histograms, ++nparker for csd.proto (please ignore safe_browsing_db related files as they will be ...
4 years, 10 months ago (2016-02-09 15:51:53 UTC) #20
rkaplow
lgtm https://codereview.chromium.org/1643573002/diff/120001/chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc File chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc (right): https://codereview.chromium.org/1643573002/diff/120001/chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc#newcode10 chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc:10: #include "base/metrics/histogram.h" should be using histogram_macros.h https://codereview.chromium.org/1643573002/diff/120001/chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc#newcode160 chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win.cc:160: ...
4 years, 10 months ago (2016-02-09 20:45:52 UTC) #21
proberge
On 2016/02/09 15:21:23, grt wrote: > I have some questions about the threading model. Please ...
4 years, 10 months ago (2016-02-10 14:20:35 UTC) #22
proberge
Following discussion with @grt, made the analyzer classless and removed the global static variable. PTAL. ...
4 years, 10 months ago (2016-02-10 14:21:41 UTC) #23
grt (UTC plus 2)
https://codereview.chromium.org/1643573002/diff/120001/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc File chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc (right): https://codereview.chromium.org/1643573002/diff/120001/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc#newcode222 chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc:222: LogIncidentDataType(DISCARDED, *incident); is it possible to retain this logging ...
4 years, 10 months ago (2016-02-11 15:55:00 UTC) #24
proberge
https://codereview.chromium.org/1643573002/diff/140001/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc File chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc (right): https://codereview.chromium.org/1643573002/diff/140001/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc#newcode412 chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc:412: extended_reporting_only_delayed_analysis_callbacks_.Start(); On 2016/02/11 15:54:59, grt wrote: > nit: i ...
4 years, 10 months ago (2016-02-11 20:25:22 UTC) #25
proberge
https://codereview.chromium.org/1643573002/diff/120001/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc File chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc (right): https://codereview.chromium.org/1643573002/diff/120001/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc#newcode222 chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc:222: LogIncidentDataType(DISCARDED, *incident); On 2016/02/11 15:54:59, grt wrote: > is ...
4 years, 10 months ago (2016-02-12 13:37:11 UTC) #26
grt (UTC plus 2)
https://codereview.chromium.org/1643573002/diff/120001/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc File chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc (right): https://codereview.chromium.org/1643573002/diff/120001/chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc#newcode222 chrome/browser/safe_browsing/incident_reporting/incident_reporting_service.cc:222: LogIncidentDataType(DISCARDED, *incident); On 2016/02/12 13:37:11, proberge wrote: > On ...
4 years, 10 months ago (2016-02-15 16:46:51 UTC) #27
proberge
https://codereview.chromium.org/1643573002/diff/160001/chrome/browser/safe_browsing/incident_reporting/incident.h File chrome/browser/safe_browsing/incident_reporting/incident.h (right): https://codereview.chromium.org/1643573002/diff/160001/chrome/browser/safe_browsing/incident_reporting/incident.h#newcode36 chrome/browser/safe_browsing/incident_reporting/incident.h:36: // profile. Please keep this list in ascending order ...
4 years, 10 months ago (2016-02-16 16:56:24 UTC) #28
Nathan Parker
Can you make this dependent on https://codereview.chromium.org/1638223003/? I can't tell what is added here. CSD ...
4 years, 10 months ago (2016-02-16 21:23:35 UTC) #29
grt (UTC plus 2)
I didn't realize that this contained code from another CL. In the future, please pipeline ...
4 years, 10 months ago (2016-02-17 18:05:00 UTC) #30
proberge
https://codereview.chromium.org/1643573002/diff/160001/chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win_unittest.cc File chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win_unittest.cc (right): https://codereview.chromium.org/1643573002/diff/160001/chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win_unittest.cc#newcode57 chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win_unittest.cc:57: EXPECT_CALL(*mock_safe_browsing_database_manager_, On 2016/02/17 18:04:59, grt wrote: > On 2016/02/16 ...
4 years, 10 months ago (2016-02-17 21:16:32 UTC) #31
grt (UTC plus 2)
lgtm once the test is fixed https://codereview.chromium.org/1643573002/diff/160001/chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win_unittest.cc File chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win_unittest.cc (right): https://codereview.chromium.org/1643573002/diff/160001/chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win_unittest.cc#newcode57 chrome/browser/safe_browsing/incident_reporting/module_load_analyzer_win_unittest.cc:57: EXPECT_CALL(*mock_safe_browsing_database_manager_, On 2016/02/17 ...
4 years, 10 months ago (2016-02-18 16:06:56 UTC) #32
proberge
On 2016/02/16 21:23:35, nparker wrote: > Can you make this dependent on https://codereview.chromium.org/1638223003/ I > ...
4 years, 10 months ago (2016-02-18 18:44:12 UTC) #33
proberge
https://codereview.chromium.org/1643573002/diff/200001/chrome/browser/safe_browsing/incident_reporting/suspicious_module_incident_unittest.cc File chrome/browser/safe_browsing/incident_reporting/suspicious_module_incident_unittest.cc (right): https://codereview.chromium.org/1643573002/diff/200001/chrome/browser/safe_browsing/incident_reporting/suspicious_module_incident_unittest.cc#newcode43 chrome/browser/safe_browsing/incident_reporting/suspicious_module_incident_unittest.cc:43: ASSERT_EQ(MakeIncident("37")->ComputeDigest(), On 2016/02/18 16:06:55, grt wrote: > this test ...
4 years, 10 months ago (2016-02-18 18:44:40 UTC) #34
Nathan Parker
lgtm https://codereview.chromium.org/1643573002/diff/220001/chrome/browser/safe_browsing/safe_browsing_service.h File chrome/browser/safe_browsing/safe_browsing_service.h (right): https://codereview.chromium.org/1643573002/diff/220001/chrome/browser/safe_browsing/safe_browsing_service.h#newcode151 chrome/browser/safe_browsing/safe_browsing_service.h:151: void RegisterExtendedReportingOnlyDelayedAnalysisCallback( I'm wondering if it'd be simpler ...
4 years, 10 months ago (2016-02-22 19:58:02 UTC) #35
proberge
https://codereview.chromium.org/1643573002/diff/220001/chrome/browser/safe_browsing/safe_browsing_service.h File chrome/browser/safe_browsing/safe_browsing_service.h (right): https://codereview.chromium.org/1643573002/diff/220001/chrome/browser/safe_browsing/safe_browsing_service.h#newcode151 chrome/browser/safe_browsing/safe_browsing_service.h:151: void RegisterExtendedReportingOnlyDelayedAnalysisCallback( On 2016/02/22 19:58:01, nparker wrote: > I'm ...
4 years, 10 months ago (2016-02-22 20:09:43 UTC) #36
Nathan Parker
lgtm
4 years, 10 months ago (2016-02-22 20:41:12 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1643573002/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1643573002/240001
4 years, 10 months ago (2016-02-25 16:08:36 UTC) #40
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 10 months ago (2016-02-25 17:46:09 UTC) #42
commit-bot: I haz the power
Patchset 13 (id:??) landed as https://crrev.com/908da69d25746389d4b695e989b3df5e31e88341 Cr-Commit-Position: refs/heads/master@{#377604}
4 years, 10 months ago (2016-02-25 17:47:32 UTC) #44
Nico
This broke clang/win builds: ..\..\chrome\browser\safe_browsing\incident_reporting\module_load_analyzer_win_unittest.cc(38,7) : error: [chromium-style] Classes that are ref-counted should have explicit ...
4 years, 10 months ago (2016-02-25 19:35:50 UTC) #46
proberge
4 years, 10 months ago (2016-02-25 19:40:24 UTC) #47
Message was sent while issue was closed.
On 2016/02/25 19:35:50, Nico wrote:
> This broke clang/win builds:
> 
>
..\..\chrome\browser\safe_browsing\incident_reporting\module_load_analyzer_win_unittest.cc(38,7)
> :  error: [chromium-style] Classes that are ref-counted should have explicit
> destructors that are declared protected or private.
> class MockSafeBrowsingDatabaseManager : public TestSafeBrowsingDatabaseManager
{
>       ^
>
..\..\chrome\browser\safe_browsing\incident_reporting\module_load_analyzer_win_unittest.cc(38,41)
> :  note: [chromium-style] 'MockSafeBrowsingDatabaseManager' inherits from
> 'safe_browsing::TestSafeBrowsingDatabaseManager' here
> class MockSafeBrowsingDatabaseManager : public TestSafeBrowsingDatabaseManager
{
>                                         ^
> ..\..\components/safe_browsing_db/test_database_manager.h(26,7) :  note:
> [chromium-style] 'TestSafeBrowsingDatabaseManager' inherits from
> 'safe_browsing::SafeBrowsingDatabaseManager' here
>     : public SafeBrowsingDatabaseManager {
>       ^
> ..\..\components/safe_browsing_db/database_manager.h(34,7) :  note:
> [chromium-style] 'SafeBrowsingDatabaseManager' inherits from
> 'base::RefCountedThreadSafe<SafeBrowsingDatabaseManager>' here
>     : public base::RefCountedThreadSafe<SafeBrowsingDatabaseManager> {
>       ^
> 
> 
>
https://build.chromium.org/p/chromium.fyi/builders/CrWinClang/builds/6559/ste...
> 
> 
> Can you take a look, please?

Thanks, I'll fix it forward asap.

Powered by Google App Engine
This is Rietveld 408576698