Jorge Lucangeli Obes has uploaded this change for review.
Remove code for security_BundledExtensions.
It hasn't been run since late 2015:
https://chromium.git.corp.google.com/chromiumos/third_party/autotest/+/82c8b60519290e1b8d4c9dc28af1eaec75c16b30#
It's also not included in the autotest-test-security ebuild.
BUG=chromium:709990
TEST=autotest_quickmerge --board=amd64-generic
Change-Id: Ic7fb8646ac15a1b4b0d92414419d3a65acea7152
---
D client/site_tests/security_BundledExtensions/baseline
D client/site_tests/security_BundledExtensions/control
D client/site_tests/security_BundledExtensions/security_BundledExtensions.py
3 files changed, 0 insertions(+), 364 deletions(-)
diff --git a/client/site_tests/security_BundledExtensions/baseline b/client/site_tests/security_BundledExtensions/baseline
deleted file mode 100644
index 7aa6a1c..0000000
--- a/client/site_tests/security_BundledExtensions/baseline
+++ /dev/null
@@ -1,175 +0,0 @@
-# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-{
-# Chrome Web Store ("ahfgeienlihckogmohjhadlkjgocpleb"),
-# Virtual Keyboard ("mppnpdlheglhdfmldimlhpnegondlapf"),
-# Files ("hhaomjibdihmijegdhdafkllkbggdgoj"), and
-# Bookmark Manager ("eemcgdkfndhakfknompkggombfjjjeno") are
-# already tracked and reviewed on the Chrome side. Ignore them
-# in our test, otherwise it's just a baseline maintenance treadmill.
- "ignored_extension_ids": [
- "ahfgeienlihckogmohjhadlkjgocpleb",
- "mppnpdlheglhdfmldimlhpnegondlapf",
- "hhaomjibdihmijegdhdafkllkbggdgoj",
- "eemcgdkfndhakfknompkggombfjjjeno"
- ],
- "bundled_crx_baseline": [],
- "component_extension_baseline": [
- { "id": "idddmepepmjcgiedknnmlbadcokidhoa",
- "name": "NCDLauncher",
- "effectiveHostPermissions": [],
- "apiPermissions": []
- },
- { "id": "pmfjbimdmchhbnneeidfognadeopoehp",
- "name": "Image Loader",
- "effectiveHostPermissions": ["https://www.googledrive.com/*"],
- "apiPermissions": ["fileBrowserHandler",
- "fileBrowserHandlerInternal",
- "fileBrowserPrivate"]
- },
- { "id": "obklkkbkpaoaejdabbfldmcfplpdgolj",
- "name": "Wallpaper Picker",
- "effectiveHostPermissions": ["https://storage.googleapis.com/*",
- "https://commondatastorage.googleapis.com/*"],
- "apiPermissions": ["alarms",
- "fileSystem",
- "fileSystem.write",
- "storage",
- "unlimitedStorage",
- "wallpaperPrivate"]
- },
- { "id": "iadeocfgjdjdmpenejdbfeaocpbikmab",
- "name": "Mobile Activation",
- "effectiveHostPermissions": [],
- "apiPermissions": []
- },
- { "id": "nkoccljplnhpfnfiajclkommnmllphnl",
- "name": "crosh_builtin",
- "effectiveHostPermissions": [],
- "apiPermissions": ["terminalPrivate",
- "storage",
- "clipboardWrite",
- "clipboardRead",
- "unlimitedStorage"]
- },
- { "id": "kddnkjkcjddckihglkfcickdhbmaodcn",
- "name": "Chrome Goodies",
- "effectiveHostPermissions": ["https://*/*"],
- "apiPermissions": ["alarms",
- "cookies",
- "chromeosInfoPrivate",
- "echoPrivate",
- "notifications"]
- },
- { "id": "mgndgikekgjfcpckkfioiadnlibdjbkf",
- "name": "Chrome",
- "effectiveHostPermissions": [],
- "apiPermissions": []
- },
- { "id": "hiahncppkeponhognffoakpacfndjdhm",
- "name": "Networks",
- "effectiveHostPermissions": ["chrome://resources/*"],
- "apiPermissions": ["networkingPrivate"]
- },
- { "id": "mlbmkoenclnokonejhlfakkeabdlmpek",
- "name": "TimeScapes",
- "boards": ["link"],
- "effectiveHostPermissions": [],
- "apiPermissions": []
- },
- { "id": "kodldpbjkkmmnilagfdheibampofhaom",
- "name": "Connectivity Diagnostics",
- "effectiveHostPermissions": ["http://*.google.com/*",
- "https://*.google.com/*"],
- "apiPermissions": ["clipboardWrite",
- "dns",
- "diagnostics",
- "experimental",
- "metricsPrivate",
- "networkingPrivate",
- "socket"]
- },
- { "id": "gfdkimpbcpahaombhbimeihdjnejgicl",
- "name": "Feedback",
- "effectiveHostPermissions": ["chrome://resources/*"],
- "apiPermissions": ["feedbackPrivate"]
- },
- { "id": "ljoammodoonkhnehlncldjelhidljdpi",
- "name": "Get Help",
- "effectiveHostPermissions": [
- "https://commondatastorage.googleapis.com/*",
- "https://storage.googleapis.com/*",
- "https://www-googleapis-test.sandbox.google.com/*",
- "https://www.google-analytics.com/*",
- "https://www.googleapis.com/*",
- "https://www.google.com/*",
- "https://*.ytimg.com/*"],
- "apiPermissions": ["chromeosInfoPrivate",
- "identity",
- "management",
- "storage",
- "unlimitedStorage",
- "webRequestInternal",
- "webview"]
- },
- { "id": "bpmcpldpdmajfigpchkicefoigmkfalc",
- "name": "Quickoffice (Beta)",
- "effectiveHostPermissions": ["https://www.google-analytics.com/*"],
- "apiPermissions": ["fileBrowserHandler",
- "fileBrowserHandlerInternal",
- "fileSystem",
- "fileSystem.write",
- "clipboardWrite",
- "clipboardRead",
- "metricsPrivate",
- "storage",
- "streamsPrivate",
- "unlimitedStorage"]
- },
- { "name": "Help",
- "id": "honijodknafkokifofgiaalefdiedpko",
- "effectiveHostPermissions": [],
- "apiPermissions": []
- },
- { "name": "Hangout Services",
- "id": "nkeimhogjdpnpccoofpliimaahmaaome",
- "effectiveHostPermissions": [],
- "apiPermissions": ["alarms",
- "desktopCapture",
- "system.cpu",
- "webConnectable",
- "webrtcAudioPrivate",
- "webrtcLoggingPrivate"]
- },
- { "name": "Google Now",
- "id": "pafkbggdmjlpgkdkcbjmhmfcdpncadgh",
- "effectiveHostPermissions": [
- "<all_urls>",
- "chrome://favicon/*"],
- "apiPermissions": ["preferencesPrivate",
- "pushMessaging",
- "tabs",
- "metricsPrivate",
- "storage",
- "notifications",
- "location",
- "alarms",
- "webstorePrivate",
- "identity"]
- },
- { "name": "Welcome",
- "id": "jdgcneonijmofocbhmijhacgchbihela",
- "effectiveHostPermissions": ["chrome://theme/*",
- "chrome://resources/*"],
- "apiPermissions": ["firstRunPrivate"]
- },
- { "name": "Chrome OS text-to-speech component extension",
- "id": "gjjabgpgjpampikjhjpfhneeoapjbjaf",
- "effectiveHostPermissions": [],
- "apiPermissions": ["ttsEngine",
- "unlimitedStorage"]
- }
- ],
- "official_components": []
-}
diff --git a/client/site_tests/security_BundledExtensions/control b/client/site_tests/security_BundledExtensions/control
deleted file mode 100644
index 5df493f..0000000
--- a/client/site_tests/security_BundledExtensions/control
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-AUTHOR = "jor...@chromium.org"
-NAME = "security_BundledExtensions"
-PURPOSE = "Verify bundled extensions/their permissions have all been approved"
-CRITERIA = """
-This test will fail if the set of expected extensions -- and every
-permission requested by those extensions -- does not exactly match
-the expected set.
-"""
-ATTRIBUTES = ""
-TIME = "SHORT"
-TEST_CATEGORY = "Functional"
-TEST_CLASS = "security"
-TEST_TYPE = "client"
-
-DOC = """
-This test uses telemetry to ask Chrome what extensions it has installed,
-what their effective permissions are, etc. Then it compares those to a
-list and fails (with various helpful details) if there is not an exact match.
-"""
-
-job.run_test('security_BundledExtensions')
diff --git a/client/site_tests/security_BundledExtensions/security_BundledExtensions.py b/client/site_tests/security_BundledExtensions/security_BundledExtensions.py
deleted file mode 100644
index 4e5b0e7..0000000
--- a/client/site_tests/security_BundledExtensions/security_BundledExtensions.py
+++ /dev/null
@@ -1,164 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import json
-import logging
-import os
-
-from autotest_lib.client.bin import test, utils
-from autotest_lib.client.common_lib import error
-from autotest_lib.client.common_lib.cros import chrome
-
-class security_BundledExtensions(test.test):
- """Verify security properties of bundled (on-disk) extensions."""
- version = 1
-
- def load_baseline(self):
- """
- Loads the set of expected permissions.
-
- @return Dictionary of expected permissions.
- """
- bfile = open(os.path.join(self.bindir, 'baseline'))
- with open(os.path.join(self.bindir, 'baseline')) as bfile:
- baseline = []
- for line in bfile:
- if not line.startswith('#'):
- baseline.append(line)
- baseline = json.loads(''.join(baseline))
- self._ignored_extension_ids = baseline['ignored_extension_ids']
- self._bundled_crx_baseline = baseline['bundled_crx_baseline']
- self._component_extension_baseline = baseline[
- 'component_extension_baseline']
- self._official_components = baseline['official_components']
- self._extensions_info = None
-
-
- def _get_stable_extensions_info(self, ext):
- """
- Poll condition that verifies that we're getting a stable list of
- extensions from chrome.autotestPrivate.getExtensionInfo.
-
- @return list of dicts, each representing an extension.
- """
- logging.info("Poll")
- prev = self._extensions_info
- ext.ExecuteJavaScript('''
- window.__extensions_info = null;
- chrome.autotestPrivate.getExtensionsInfo(function(s) {
- window.__extensions_info = s.extensions;
- });
- ''')
- self._extensions_info = utils.poll_for_condition(
- lambda: ext.EvaluateJavaScript('window.__extensions_info'))
- if not prev:
- return False
- return len(prev) == len(self._extensions_info)
-
- def _get_extensions_info(self):
- """
- Calls _get_stable_extensions_info to get a stable list of extensions.
- Filters out extensions that are on the to-be-ignored list.
-
- @return list of dicts, each representing an extension.
- """
- with chrome.Chrome(logged_in=True, autotest_ext=True) as cr:
- ext = cr.autotest_ext
- if not ext:
- return None
-
- utils.poll_for_condition(
- lambda: self._get_stable_extensions_info(ext),
- sleep_interval=0.5, timeout=30)
- logging.debug("getExtensionsInfo:\n%s", self._extensions_info)
- filtered_info = []
- self._ignored_extension_ids.append(ext.extension_id)
- for rec in self._extensions_info:
- if not rec['id'] in self._ignored_extension_ids:
- filtered_info.append(rec)
- self._extensions_info = filtered_info
- return filtered_info
-
-
- def compare_extensions(self):
- """Compare installed extensions to the expected set.
-
- Find the set of expected IDs.
- Find the set of observed IDs.
- Do set comparison to find the unexpected, and the expected/missing.
-
- """
- test_fail = False
- combined_baseline = (self._bundled_crx_baseline +
- self._component_extension_baseline)
- # Filter out any baseline entries that don't apply to this board.
- # If there is no 'boards' limiter on a given record, the record applies.
- # If there IS a 'boards' limiter, check that it applies.
- board = utils.get_current_board()
- combined_baseline = [x for x in combined_baseline
- if ((not 'boards' in x) or
- ('boards' in x and board in x['boards']))]
-
- observed_extensions = self._get_extensions_info()
- observed_ids = set([x['id'] for x in observed_extensions])
- expected_ids = set([x['id'] for x in combined_baseline])
-
- missing_ids = expected_ids - observed_ids
- missing_names = ['%s (%s)' % (x['name'], x['id'])
- for x in combined_baseline if x['id'] in missing_ids]
-
- unexpected_ids = observed_ids - expected_ids
- unexpected_names = ['%s (%s)' % (x['name'], x['id'])
- for x in observed_extensions if
- x['id'] in unexpected_ids]
-
- good_ids = expected_ids.intersection(observed_ids)
-
- if missing_names:
- logging.error('Missing: %s', '; '.join(missing_names))
- test_fail = True
- if unexpected_names:
- logging.error('Unexpected: %s', '; '.join(unexpected_names))
- test_fail = True
-
- # For those IDs in both the expected-and-observed, ie, "good":
- # Compare sets of expected-vs-actual API permissions, report diffs.
- # Do same for host permissions.
- for good_id in good_ids:
- baseline = [x for x in combined_baseline if x['id'] == good_id][0]
- actual = [x for x in observed_extensions if x['id'] == good_id][0]
- # Check the API permissions.
- baseline_apis = set(baseline['apiPermissions'])
- actual_apis = set(actual['apiPermissions'])
- missing_apis = baseline_apis - actual_apis
- unexpected_apis = actual_apis - baseline_apis
- if missing_apis or unexpected_apis:
- test_fail = True
- self._report_attribute_diffs(missing_apis, unexpected_apis,
- actual)
- # Check the host permissions.
- baseline_hosts = set(baseline['effectiveHostPermissions'])
- actual_hosts = set(actual['effectiveHostPermissions'])
- missing_hosts = baseline_hosts - actual_hosts
- unexpected_hosts = actual_hosts - baseline_hosts
- if missing_hosts or unexpected_hosts:
- test_fail = True
- self._report_attribute_diffs(missing_hosts, unexpected_hosts,
- actual)
- if test_fail:
- # TODO(jorgelo): make this fail again, see crbug.com/343271.
- raise error.TestWarn('Baseline mismatch, see error log.')
-
-
- def _report_attribute_diffs(self, missing, unexpected, rec):
- logging.error('Problem with %s (%s):', rec['name'], rec['id'])
- if missing:
- logging.error('It no longer uses: %s', '; '.join(missing))
- if unexpected:
- logging.error('It unexpectedly uses: %s', '; '.join(unexpected))
-
-
- def run_once(self, mode=None):
- self.load_baseline()
- self.compare_extensions()
To view, visit change 473126. To unsubscribe, visit settings.
Jorge Lucangeli Obes posted comments on this change.
Patch set 1:Verified +1Commit-Queue +1Trybot-Ready +1
Mike Frysinger posted comments on this change.
Patch set 1:Code-Review +2
Jorge Lucangeli Obes posted comments on this change.
Patch set 1:Commit-Queue +1Trybot-Ready +1
Error message has no mention of this test.
ChromeOS bot uploaded patch set #2 to the change originally created by Jorge Lucangeli Obes.
Remove code for security_BundledExtensions.
It hasn't been run since late 2015:
https://chromium.git.corp.google.com/chromiumos/third_party/autotest/+/82c8b60519290e1b8d4c9dc28af1eaec75c16b30#
It's also not included in the autotest-test-security ebuild.
BUG=chromium:709990
TEST=autotest_quickmerge --board=amd64-generic
Change-Id: Ic7fb8646ac15a1b4b0d92414419d3a65acea7152
Reviewed-on: https://chromium-review.googlesource.com/473126
Commit-Ready: Jorge Lucangeli Obes <jor...@chromium.org>
Tested-by: Jorge Lucangeli Obes <jor...@chromium.org>
Reviewed-by: Mike Frysinger <vap...@chromium.org>
---
D client/site_tests/security_BundledExtensions/baseline
D client/site_tests/security_BundledExtensions/control
D client/site_tests/security_BundledExtensions/security_BundledExtensions.py
3 files changed, 0 insertions(+), 364 deletions(-)
To view, visit change 473126. To unsubscribe, visit settings.
ChromeOS bot merged this change.
Remove code for security_BundledExtensions.
It hasn't been run since late 2015:
https://chromium.git.corp.google.com/chromiumos/third_party/autotest/+/82c8b60519290e1b8d4c9dc28af1eaec75c16b30#
It's also not included in the autotest-test-security ebuild.
BUG=chromium:709990
TEST=autotest_quickmerge --board=amd64-generic
Change-Id: Ic7fb8646ac15a1b4b0d92414419d3a65acea7152
Reviewed-on: https://chromium-review.googlesource.com/473126
Commit-Ready: Jorge Lucangeli Obes <jor...@chromium.org>
Tested-by: Jorge Lucangeli Obes <jor...@chromium.org>
Reviewed-by: Mike Frysinger <vap...@chromium.org>