OLD | NEW |
(Empty) | |
| 1 syntax = "proto3"; |
| 2 package traffic_annotation; |
| 3 |
| 4 import "components/policy/cloud_policy_full_runtime.proto"; |
| 5 |
| 6 // Describes a specific kind of network traffic based on a fine-grained |
| 7 // semantic classification of all network traffic generated by Chrome. |
| 8 // Used for auditing purposes. |
| 9 message NetworkTrafficAnnotation { |
| 10 // This is a globally unique identifier that must stay unchanged while the |
| 11 // network request carries the same semantic meaning. If the network request |
| 12 // gets a new meaning, this ID needs to be changed. |
| 13 // The purpose of this ID is to give humans a chance to reference |
| 14 // NetworkTrafficAnnotations externally even when those change a little bit |
| 15 // (e.g. adding a new piece of data that is sent along with a network |
| 16 // request). |
| 17 // IDs of one component should have a shared prefix so that sorting all |
| 18 // NetworkTrafficAnnotations by unique_id groups those that belong to the same |
| 19 // component together. |
| 20 // For example: |
| 21 // "spellchecker_lookup" |
| 22 string unique_id = 1; |
| 23 |
| 24 // Encapsulates information about the code location that generates this kind |
| 25 // of network traffic. |
| 26 message TrafficSource { |
| 27 // File name where the network request is triggered. |
| 28 // This is typically filled by the extractor and does not need to be |
| 29 // specified in the source code. For manual whitelisting this needs to be |
| 30 // specified. |
| 31 string file = 1; |
| 32 |
| 33 // Function name where the network request is instantiated. |
| 34 // This is typically filled by the extractor and does not need to be |
| 35 // specified in the source code. For manual whitelisting this needs to be |
| 36 // specified. |
| 37 string function = 2; |
| 38 |
| 39 // __LINE__ in file, where the AuditPolicy object is instantiated. |
| 40 // This is typically filled by the extractor and does not need to be |
| 41 // specified in the source code. |
| 42 // For whitelisted network requests in third_party/ that cannot be properly |
| 43 // annotated in the source code, this attribute is empty. |
| 44 int32 line = 3; |
| 45 |
| 46 // For whitelisted network requests in third_party/ that cannot be properly |
| 47 // annotated in the source code, this distinguishes between the first, |
| 48 // second, ... annotated call. |
| 49 // For annotations in the source code, this is not used because the line |
| 50 // attribute uniquely identifies the network request. |
| 51 int32 call_number = 4; |
| 52 } |
| 53 |
| 54 TrafficSource source = 2; |
| 55 |
| 56 // Meta information about the network request. |
| 57 message TrafficSemantics { |
| 58 // Justification for an empty AuditPolicy policy. |
| 59 // Typically this can be either a TODO or a hint that the annotation is |
| 60 // made upstream in the code. For example, if net::URLFetcher::Create() has |
| 61 // an annotation, the net::TCPClientSocket() that is used by the URLFetcher |
| 62 // does not need to be annotated as well. |
| 63 string empty_policy_justification = 1; |
| 64 |
| 65 // What component triggers the request. The components should be human |
| 66 // readable and don’t need to reflect the components/ directory. Avoid |
| 67 // abbreviations. |
| 68 // Examples: spellchecker, component updater, website |
| 69 string sender = 2; |
| 70 |
| 71 // Plaintext description of the network request in language that is |
| 72 // understandable by admins (ideally also users). Please avoid acronyms. |
| 73 // Please describe the feature and the feature's value proposition as well. |
| 74 // Examples: |
| 75 // - Google Chrome can provide smarter spell-checking by sending text you |
| 76 // type into the browser to Google's servers, allowing you to use the same |
| 77 // spell-checking technology used by Google products, such as Docs. |
| 78 // If the feature is enabled, Chrome will send the entire contents of text |
| 79 // fields as you type in them to Google along with the browser’s default |
| 80 // language. Google returns a list of suggested spellings, which will be |
| 81 // displayed in the context menu. |
| 82 // - A network request that comes from web content (a page the user visits) |
| 83 string description = 3; |
| 84 |
| 85 // What triggered the network request. Use a textual description. This |
| 86 // should be a human readable string. |
| 87 // For things that are clearly part of the website (resource load, form |
| 88 // submission, fetch by a service worker,...), you *may* just put “website” |
| 89 // here. |
| 90 string trigger = 4; |
| 91 |
| 92 // What nature of data is being sent. This should be a human readable |
| 93 // string. Any user data and/or PII should be pointed out. |
| 94 // Examples: “log files from /var/...”, “statistics about foobar”, “the |
| 95 // signature of a form of a website”, “installed extensions and their |
| 96 // version”, “a word on a website the user tapped on” |
| 97 string data = 5; |
| 98 |
| 99 enum Destination { |
| 100 // A website the user visits or interacts with. The distinction from a |
| 101 // google owned service can be difficult when the user navigates to |
| 102 // google.com or searches with the omnibar. Therefore follow the following |
| 103 // guideline: If the source code has hardcoded that the request goes to |
| 104 // Google (e.g. for ZeroSuggest), use GOOGLE_OWNED_SERVICE. If the request |
| 105 // can go to other domains and is perceived as a part of a website rather |
| 106 // than a native browser feature, use WEBSITE. In other cases use OTHER. |
| 107 WEBSITE = 0; |
| 108 // A Google owned service, like SafeBrowsing, spellchecking, ... |
| 109 GOOGLE_OWNED_SERVICE = 1; |
| 110 // Other endpoints, e.g. a service hosting a PAC script. In case of doubt, |
| 111 // use this category. We will audit it in the future to see whether we |
| 112 // need more categories. |
| 113 OTHER = 1000; |
| 114 } |
| 115 Destination destination = 6; |
| 116 |
| 117 // Human readable description in case the destination points to OTHER. |
| 118 string destination_other = 7; |
| 119 } |
| 120 |
| 121 TrafficSemantics semantics = 3; |
| 122 |
| 123 message TrafficPolicy { |
| 124 // Whether cookies/channel IDs/... can be sent or saved (use true if at |
| 125 // least one is correct). |
| 126 bool cookies_allowed = 1; |
| 127 |
| 128 // If cookies_allowed is true and the request uses not the profile cookie |
| 129 // store, please specify this here. You may use “system” to indicate that |
| 130 // the System RequestContext and its cookie store are used or specify other |
| 131 // exceptions (e.g. SafeBrowsing uses a separate cookie store). |
| 132 string cookies_store_exceptions = 2; |
| 133 |
| 134 // Human readable description of how to enable/disable a feature that |
| 135 // triggers this network request by a user. Use “NA”, if no such setting |
| 136 // exists (e.g. “Disable ‘Use a web service to help resolve spelling |
| 137 // errors.’ in Chrome’s settings under Advanced”). |
| 138 string setting = 3; |
| 139 |
| 140 // Example policy configuration that disables this network request. |
| 141 // This would be a text serialized protobuf of any enterprise policy. |
| 142 // see out/Debug/gen/components/policy/cloud_policy.proto |
| 143 repeated enterprise_management.CloudPolicySettings policy = 4; |
| 144 |
| 145 // Justification for not having a policy that disables this feature. |
| 146 string policy_exception_justification = 5; |
| 147 } |
| 148 |
| 149 TrafficPolicy policy = 4; |
| 150 }; |
| 151 |
| 152 // NetworkTrafficAnnotations that were extracted from the source code. |
| 153 message ExtractedNetworkTrafficAnnotation { |
| 154 repeated NetworkTrafficAnnotation network_traffic_annotation = 1; |
| 155 }; |
| 156 |
| 157 // NetworkTrafficAnnotations that had to go into a whitelist file because the |
| 158 // source code could not be annotated (e.g. because it is in a third-party |
| 159 // library). |
| 160 message WhitelistedNetworkTrafficAnnotations { |
| 161 repeated NetworkTrafficAnnotation network_traffic_annotation = 1; |
| 162 }; |
| 163 |
| 164 // All NetworkTrafficAnnotations from a Chromium configuration. |
| 165 message NetworkTrafficAnnotations { |
| 166 ExtractedNetworkTrafficAnnotation extracted_network_traffic_annotations = 1; |
| 167 WhitelistedNetworkTrafficAnnotations whitelisted_network_traffic_annotations = |
| 168 2; |
| 169 }; |
OLD | NEW |