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

Side by Side Diff: chrome/browser/resources/safe_browsing/README.md

Issue 1929693003: Populate download_file_types proto and filter it for each platform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@file_type_polices2
Patch Set: rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Behavior of Download File Types in Chrome 1 # Behavior of Download File Types in Chrome
2 2
3 This describes how to adjust file-type download behavior in 3 This describes how to adjust file-type download behavior in
4 Chrome including interactions with Safe Browsing. The metadata described 4 Chrome including interactions with Safe Browsing. The metadata described
5 here, and stored in `download_file_types.asciipb`, will be both baked into 5 here, and stored in `download_file_types.asciipb`, will be both baked into
6 Chrome released and pushable to Chrome between releases. http://crbug.com/596555 6 Chrome released and pushable to Chrome between releases. http://crbug.com/596555
7 7
8 Rendered version of this file: https://chromium.googlesource.com/chromium/src/+/ master/chrome/browser/resources/safe_browsing/README.md 8 Rendered version of this file: https://chromium.googlesource.com/chromium/src/+/ master/chrome/browser/resources/safe_browsing/README.md
9 9
10 10
11 ## Procedure for adding a new type 11 ## Procedure for adding a new type
12 * Edit `download_file_types.asciipb`. Update `histograms.xml` 12 * Edit `download_file_types.asciipb` and update `histograms.xml`
Jialiu Lin 2016/05/04 20:01:57 Do we need to add the new type to (1) histograms.x
13 * Get it reviewed, submit. 13 * Get it reviewed, submit.
14 * Push via component update (PROCEDURE TBD) 14 * Push via component update (PROCEDURE TBD)
15 15
16 ## Guidelines for a DownloadFileType entry: 16 ## Guidelines for a DownloadFileType entry:
17 See `download_file_types.proto` for all fields. 17 See `download_file_types.proto` for all fields.
18 18
19 * `extension`: Value must be unique within the config. It should be 19 * `extension`: Value must be unique within the config. It should be
20 lowercase ASCII and not contain a dot. If there _is_ a duplicate, 20 lowercase ASCII and not contain a dot. If there _is_ a duplicate,
21 first one wins. Only the `default_file_type` should leave this unset. 21 first one wins. Only the `default_file_type` should leave this unset.
22 22
23 * `uma_value`: Value must be unique and match one in the 23 * `uma_value`: (required) must be unique and match one in the
24 `SBClientDownloadExtensions` enum in `histograms.xml`. 24 `SBClientDownloadExtensions` enum in `histograms.xml`.
25 25
26 * `is_archive`: `True` if this filetype is a container for other files. 26 * `is_archive`: `True` if this filetype is a container for other files.
27 Leave it unset for `false`. 27 Leave it unset for `false`.
28 28
29 * `platform_settings`: (repeated) Must have one entry with an unset 29 * `ping_setting`: (required). This controls what sort of ping is sent
30 `platform` field, and optionally additional entries with overrides 30 to Safe Browsing and if a verdict is checked before the user can
31 for one or more platforms. An unset `platform` field acts as a 31 access the file.
32 default for any platforms that don't have an override. There should 32
33 not be two settings with the same `platform`, but if there are, 33 * `SAMPLED_PING`: Don't send a full Safe Browsing ping, but
34 first one wins. Keep them sorted by platform. 34 send a no-PII "light-ping" for a random sample of SBER users.
35 This should be the default for unknown types. The verdict won't
36 be used.
37 * `NO_PING`: Don’t send any pings. This file is whitelisted. All
38 NOT_DANGEROUS files should normally use this.
39 * `FULL_PING`: Send full pings and use the verdict. All dangerous
40 file should use this.
41
42 * `platform_settings`: (repeated) Zero or more settings to differentiate
43 behavior by platform. Keep them sorted by platform. At build time,
44 this list will be filtered to contain exactly one setting by chosing
45 as follows before writing out the binary proto.
46
47 1. If there's an entry matching the built platform,
48 that will be preferred. Otherwise,
49
50 2. If there's a "PLATFORM_ANY" (i.e. `platform` is not set),
51 that will be used. Otherwise,
52
53 3. The `default_file_type`'s settings will be filled in.
35 54
36 * `platform_settings.danger_level`: (required) 55 * `platform_settings.danger_level`: (required)
37 * `NOT_DANGEROUS`: Safe to download and open, even if the download 56 * `NOT_DANGEROUS`: Safe to download and open, even if the download
38 was accidental. 57 was accidental.
39 * `DANGEROUS`: Always warn the user that this file may harm their 58 * `DANGEROUS`: Always warn the user that this file may harm their
40 computer. We let them continue or discard the file. If Safe 59 computer. We let them continue or discard the file. If Safe
41 Browsing returns a SAFE verdict, we still warn the user. 60 Browsing returns a SAFE verdict, we still warn the user.
42 * `ALLOW_ON_USER_GESTURE`: Warn the user normally but skip the warning 61 * `ALLOW_ON_USER_GESTURE`: Warn the user normally but skip the warning
43 if there was a user gesture or the user visited this site before 62 if there was a user gesture or the user visited this site before
44 midnight last night (i.e. is a repeat visit). If Safe Browsing 63 midnight last night (i.e. is a repeat visit). If Safe Browsing
45 returns a SAFE verdict for this file, it won't show a warning. 64 returns a SAFE verdict for this file, it won't show a warning.
46 65
47 * `platform_settings.auto_open_hint`: Required. 66 * `platform_settings.auto_open_hint`: (required).
48 * `ALLOW_AUTO_OPEN`: File type can be opened automatically if the user 67 * `ALLOW_AUTO_OPEN`: File type can be opened automatically if the user
49 selected that option from the download tray on a previous download 68 selected that option from the download tray on a previous download
50 of this type. 69 of this type.
51 * `DISALLOW_AUTO_OPEN`: Never let the file automatically open. 70 * `DISALLOW_AUTO_OPEN`: Never let the file automatically open.
52 Files that should be disallowed from auto-opening include those that 71 Files that should be disallowed from auto-opening include those that
53 execute arbitrary or harmful code with user privileges, or change 72 execute arbitrary or harmful code with user privileges, or change
54 configuration of the system to cause harmful behavior immediately 73 configuration of the system to cause harmful behavior immediately
55 or at some time in the future. We *do* allow auto-open for files 74 or at some time in the future. We *do* allow auto-open for files
56 that upon opening sufficiently warn the user about the fact that it 75 that upon opening sufficiently warn the user about the fact that it
57 was downloaded from the internet and can do damage. **Note**: 76 was downloaded from the internet and can do damage. **Note**:
58 Some file types (e.g.: .local and .manifest) aren't dangerous 77 Some file types (e.g.: .local and .manifest) aren't dangerous
59 to open. However, their presence on the file system may cause 78 to open. However, their presence on the file system may cause
60 potentially dangerous changes in behavior for other programs. We 79 potentially dangerous changes in behavior for other programs. We
61 allow automatically opening these file types, but always warn when 80 allow automatically opening these file types, but always warn when
62 they are downloaded. 81 they are downloaded.
63 82
64 * `platform_settings.ping_setting`: Required. This controls what sort
65 of ping is sent to Safe Browsing and if a verdict is checked before
66 the user can access the file.
67 * `SAMPLED_PING`: Don't send a full Safe Browsing ping, but
68 send a no-PII "light-ping" for a random sample of SBER users.
69 This should be the default for unknown types. The verdict won't
70 be used.
71 * `NO_PING`: Don’t send any pings. This file is whitelisted. All
72 NOT_DANGEROUS files should normally use this.
73 * `FULL_PING`: Send full pings and use the verdict. All dangerous
74 file should use this.
75
76 * TODO(nparker): Support this: `platform_settings.unpacker`: 83 * TODO(nparker): Support this: `platform_settings.unpacker`:
77 optional. Specifies which archive unpacker internal to Chrome 84 optional. Specifies which archive unpacker internal to Chrome
78 should be used. If potentially dangerous file types are found, 85 should be used. If potentially dangerous file types are found,
79 Chrome will send a full-ping for the entire file. Otherwise, it'll 86 Chrome will send a full-ping for the entire file. Otherwise, it'll
80 follow the ping settings. Can be one of UNPACKER_ZIP or UNPACKER_DMG. 87 follow the ping settings. Can be one of UNPACKER_ZIP or UNPACKER_DMG.
81 88
82 ## Guidelines for the top level DownloadFileTypeConfig entry: 89 ## Guidelines for the top level DownloadFileTypeConfig entry:
83 * `version_id`: Must be increased (+1) every time the file is checked in. 90 * `version_id`: Must be increased (+1) every time the file is checked in.
84 Will be logged to UMA. 91 Will be logged to UMA.
85 92
86 * `sampled_ping_probability`: For what fraction of extended-reporting 93 * `sampled_ping_probability`: For what fraction of extended-reporting
87 users' downloads with unknown extensions (or 94 users' downloads with unknown extensions (or
88 ping_setting=SAMPLED_PING) should we send light-pings? [0.0 .. 1.0] 95 ping_setting=SAMPLED_PING) should we send light-pings? [0.0 .. 1.0]
89 96
90 * `file_type`: The big list of all known file types. Keep them 97 * `file_types`: The big list of all known file types. Keep them
91 sorted by extension. 98 sorted by extension.
92 99
93 * `default_file_type`: Settings used if a downloaded file is not in 100 * `default_file_type`: Settings used if a downloaded file is not in
94 the above list. `extension` is ignored, but other settings are used. 101 the above list. `extension` is ignored, but other settings are used.
95 The ping_setting should be SAMPLED_PING for all platforms. 102 The ping_setting should be SAMPLED_PING for all platforms. Only the
103 first platform_setting is used.
96 104
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698