OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Safe Browsing reporting protocol buffers. | 5 // Safe Browsing reporting protocol buffers. |
6 // | 6 // |
7 // A ClientMalwareReportRequest is sent when a user opts-in to | 7 // A ClientSafeBrowsingReportRequest is sent when a user opts-in to |
8 // sending detailed malware reports from the safe browsing interstitial page. | 8 // sending detailed threat reports from the safe browsing interstitial page. |
9 // | 9 // |
10 // It is a list of Resource messages, which may contain the url of a | 10 // It is a list of Resource messages, which may contain the url of a |
11 // resource such as the page in the address bar or any other resource | 11 // resource such as the page in the address bar or any other resource |
12 // that was loaded for this page. | 12 // that was loaded for this page. |
13 // | 13 // |
14 // In addition to the url, a resource can contain HTTP request and response | 14 // In addition to the url, a resource can contain HTTP request and response |
15 // headers and bodies. | 15 // headers and bodies. |
16 | 16 |
17 syntax = "proto2"; | 17 syntax = "proto2"; |
18 | 18 |
19 option optimize_for = LITE_RUNTIME; | 19 option optimize_for = LITE_RUNTIME; |
20 | 20 |
21 package safe_browsing; | 21 package safe_browsing; |
22 | 22 |
23 // A Detailed Safebrowsing Report from clients. Chrome safebrowsing reports are | |
24 // only sent by Chrome users who have opted into extended Safe Browsing. | |
25 message ClientSafeBrowsingReportRequest { | |
Nathan Parker
2015/11/03 20:51:57
Can you add a comment that this is replacing Clien
Jialiu Lin
2015/11/04 21:32:25
Done.
| |
26 // Note: A lot of the "optional" fields would make sense to be | |
27 // "required" instead. However, having them as optional allows the | |
28 // clients to send "stripped down" versions of the message in the | |
29 // future, if we want to. | |
30 | |
31 enum ReportType { | |
32 UNKNOWN = 0; | |
33 URL_PHISHING = 1; | |
34 URL_MALWARE = 2; | |
35 URL_UNWANTED = 3; | |
36 BINARY_MALWARE_URL = 4; | |
37 CLIENT_SIDE_PHISHING_URL = 5; | |
38 CLIENT_SIDE_MALWARE_URL = 6; | |
39 BINARY_MALWARE_CONTENT = 7; | |
Nathan Parker
2015/11/03 20:51:57
Is there a BINARY_UNWANTED_CONTENT?
Jialiu Lin
2015/11/04 21:32:25
removed types that not related to interstitial or
| |
40 MALICIOUS_DOWNLOAD_RECOVERY = 8; | |
41 } | |
42 | |
43 message HTTPHeader { | |
44 required bytes name = 1; | |
45 optional bytes value = 2; | |
46 } | |
47 | |
48 message HTTPRequest { | |
49 message FirstLine { | |
50 optional bytes verb = 1; | |
51 optional bytes uri = 2; | |
52 optional bytes version = 3; | |
53 } | |
54 | |
55 optional FirstLine firstline = 1; | |
56 repeated HTTPHeader headers = 2; | |
57 optional bytes body = 3; | |
58 optional bytes bodydigest = 4; // 32-byte hex md5 digest of body. | |
59 optional int32 bodylength = 5; // length of body. | |
60 } | |
61 | |
62 message HTTPResponse { | |
63 message FirstLine { | |
64 optional int32 code = 1; | |
65 optional bytes reason = 2; | |
66 optional bytes version = 3; | |
67 } | |
68 | |
69 optional FirstLine firstline = 1; | |
70 repeated HTTPHeader headers = 2; | |
71 optional bytes body = 3; | |
72 optional bytes bodydigest = 4; // 32-byte hex md5 digest of body. | |
73 optional int32 bodylength = 5; // length of body. | |
74 optional bytes remote_ip = 6; // IP of the server. | |
75 } | |
76 | |
77 message Resource { | |
78 required int32 id = 1; | |
79 optional string url = 2; | |
80 optional HTTPRequest request = 3; | |
81 optional HTTPResponse response = 4; | |
82 optional int32 parent_id = 5; | |
83 repeated int32 child_ids = 6; | |
84 optional string tag_name = 7; | |
85 } | |
86 | |
87 optional ReportType type = 1; | |
88 optional string url = 2; | |
89 optional string page_url = 3; | |
90 optional string referrer_url = 4; | |
91 | |
92 repeated Resource resources = 6; | |
93 | |
94 // Whether the report is complete. | |
95 optional bool complete = 7; | |
96 | |
97 // The ASN and country of the client IP. These fields are filled up by | |
98 // csd_frontend | |
99 repeated string client_asn = 8; | |
100 optional string client_country = 9; | |
101 | |
102 // Whether user chose to proceed. | |
103 optional bool did_proceed = 10; | |
104 | |
105 // Whether user visited this url before. | |
Nathan Parker
2015/11/03 20:51:57
I think it's origin, not URL.
Jialiu Lin
2015/11/04 21:32:25
Done.
| |
106 optional bool repeat_visit = 11; | |
107 } | |
108 | |
109 // Deprecated!! | |
23 message ClientMalwareReportRequest { | 110 message ClientMalwareReportRequest { |
Nathan Parker
2015/11/03 20:51:57
Can remove this proto altogether.
Jialiu Lin
2015/11/04 21:32:25
Done.
| |
24 | 111 |
25 message HTTPHeader { | 112 message HTTPHeader { |
26 required bytes name = 1; | 113 required bytes name = 1; |
27 optional bytes value = 2; | 114 optional bytes value = 2; |
28 } | 115 } |
29 | 116 |
30 message HTTPRequest { | 117 message HTTPRequest { |
31 message FirstLine { | 118 message FirstLine { |
32 optional bytes verb = 1; // Also known as method, eg "GET" | 119 optional bytes verb = 1; // Also known as method, eg "GET" |
33 optional bytes uri = 2; | 120 optional bytes uri = 2; |
(...skipping 27 matching lines...) Expand all Loading... | |
61 optional int32 bodylength = 5; | 148 optional int32 bodylength = 5; |
62 optional bytes remote_ip = 6; | 149 optional bytes remote_ip = 6; |
63 } | 150 } |
64 | 151 |
65 message Resource { | 152 message Resource { |
66 required int32 id = 1; | 153 required int32 id = 1; |
67 optional string url = 2; | 154 optional string url = 2; |
68 optional HTTPRequest request = 3; | 155 optional HTTPRequest request = 3; |
69 optional HTTPResponse response = 4; | 156 optional HTTPResponse response = 4; |
70 | 157 |
71 optional int32 parent_id = 5; // Id of the parent, if known. | 158 optional int32 parent_id = 5; // Id of the parent, if known. |
Nathan Parker
2015/11/03 20:51:57
These comments seem useful. Can you copy them to
Jialiu Lin
2015/11/04 21:32:25
Done.
| |
72 | 159 |
73 // A list of children. The order of the children in this list is | 160 // A list of children. The order of the children in this list is |
74 // significant. The |parent_id| field for child nodes can be derived | 161 // significant. The |parent_id| field for child nodes can be derived |
75 // from this, but this allows us to be more flexible. | 162 // from this, but this allows us to be more flexible. |
76 repeated int32 child_ids = 6; | 163 repeated int32 child_ids = 6; |
77 | 164 |
78 // Tag that was used to include this resource, eg "iframe" | 165 // Tag that was used to include this resource, eg "iframe" |
79 optional string tag_name = 7; | 166 optional string tag_name = 7; |
80 } | 167 } |
81 | 168 |
82 // URL of the resource that matches the safe browsing list. | 169 // URL of the resource that matches the safe browsing list. |
83 optional string malware_url = 1; | 170 optional string malware_url = 1; |
84 | 171 |
85 // URL of the page in the address bar. | 172 // URL of the page in the address bar. |
86 optional string page_url = 2; | 173 optional string page_url = 2; |
87 | 174 |
88 optional string referrer_url = 3; | 175 optional string referrer_url = 3; |
89 repeated Resource resources = 4; | 176 repeated Resource resources = 4; |
90 | 177 |
91 // Whether the report has HTTP Responses. | 178 // Whether the report has HTTP Responses. |
92 optional bool complete = 5; | 179 optional bool complete = 5; |
93 | 180 |
94 // Whether user chose to proceed. | 181 // Whether user chose to proceed. |
95 optional bool did_proceed = 8; | 182 optional bool did_proceed = 8; |
96 | 183 |
97 // Whether user visited this origin before. | 184 // Whether user visited this origin before. |
98 optional bool repeat_visit = 9; | 185 optional bool repeat_visit = 9; |
99 } | 186 } |
OLD | NEW |