OLD | NEW |
(Empty) | |
| 1 syntax = "proto3"; |
| 2 package traffic_annotation; |
| 3 |
| 4 // TODO: include policies |
| 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 ////////////////////////////////////////// |
| 11 // Section 1: Location of what is audited. |
| 12 |
| 13 // Description of the call site that is audited. |
| 14 // An annotation is required for calls from net/ (or go/cronet) |
| 15 // 1) every call of net::URLFetcher::Create() |
| 16 // 2) every call of net::URLRequestContext::CreateRequest() |
| 17 // 3) every call of net::TCPClientSocket() |
| 18 // 4) every call of net::UDPClientSocket() |
| 19 // 5) every call of net::SSLClientSocket() |
| 20 // 6) every call of implementations of |
| 21 // net::ClientSocketFactory::Create.*ClientSocket |
| 22 // 7) every call of ResourceFetcher::Create() or |
| 23 // WebURLRequest::setRequestContext( |
| 24 // WebURLRequest::RequestContextInternal) |
| 25 // TODO: figure out how to deal with requests from the renderer |
| 26 // TODO: investigate ClientSocketPoolManager. |
| 27 // |
| 28 // An annotation is required for calls via native sockets. |
| 29 // A) every call of ::bind() |
| 30 // |
| 31 // For 1-6, the annotation needs to be assigned to the respective object |
| 32 // inline in the same function that triggers the call. If a function |
| 33 // contains K calls to functions 1-6, there need to be K annotations in |
| 34 // that function accordingly. |
| 35 // For A, it may be impossible to add the annotation inline, because |
| 36 // the call happens in a third_party library. In this case, the annotation |
| 37 // needs to be put into a special whitelist file. |
| 38 |
| 39 // This is a globally unique identifier that must stay unchanged while the |
| 40 // network request carries the same semantic meaning. If the network request |
| 41 // gets a new meaning, this ID needs to be changed. |
| 42 // The purpose of this ID is to give humans a chance to annotate specific |
| 43 // audit policies and keep the annotation assigned to the policy even when |
| 44 // that changes a little bit (e.g. adding a new piece of data that is sent |
| 45 // along with a network request). |
| 46 // IDs of one component should have a shared prefix so that sorting all |
| 47 // network requests by unique_id groups those policies that belong to the |
| 48 // same component together. |
| 49 // For example: |
| 50 // "spellchecker_lookup" |
| 51 string unique_id = 1; |
| 52 |
| 53 // Encapsulates information about the code location that generates this kind |
| 54 // of |
| 55 // network traffic. |
| 56 message TrafficSource { |
| 57 // File name where the network request is triggered. |
| 58 // This is typically filled by the extractor and does not need to be |
| 59 // specified |
| 60 // in the source code. For manual whitelisting this needs to be specified. |
| 61 string file = 1; |
| 62 |
| 63 // Function name where the network request is instantiated. |
| 64 // This is typically filled by the extractor and does not need to be |
| 65 // specified |
| 66 // in the source code. For manual whitelisting this needs to be specified. |
| 67 string function = 2; |
| 68 |
| 69 // __LINE__ in file, where the AuditPolicy object is instantiated. |
| 70 // This is typically filled by the extractor and does not need to be |
| 71 // specified |
| 72 // in the source code. |
| 73 // For whitelisted network requests in third_party that cannot be properly |
| 74 // annotated in the source code, this attribute is empty. |
| 75 int32 line = 3; |
| 76 |
| 77 // For whitelisted network requests in third_party that cannot be properly |
| 78 // annotated in the source code, this distinguishes between the first, |
| 79 // second, … annotated call. |
| 80 // For annotations in the source code, this is not used because the line |
| 81 // attribute uniquely identifies the network request. |
| 82 int32 call_number = 4; |
| 83 } |
| 84 |
| 85 TrafficSource source = 2; |
| 86 |
| 87 ///////////////////////////////////////////////////////// |
| 88 // Section 2: Meta information about the network request. |
| 89 message TrafficSemantics { |
| 90 // Justification for an empty AuditPolicy policy. |
| 91 // Typically this can be either a TODO or a hint that the annotation is |
| 92 // made upstream in the code. For example, if net::URLFetcher::Create() has |
| 93 // has annotation, the net::TCPClientSocket() that is used by the |
| 94 // URLFetcher does not need to be annotated as well. |
| 95 string empty_policy_justification = 1; |
| 96 |
| 97 // What component triggers the request. The components should be human |
| 98 // readable and don’t need to reflect the components/ directory. Avoid |
| 99 // abbreviations. |
| 100 // Examples: spellchecker, component updater, website |
| 101 string sender = 2; |
| 102 |
| 103 // Plaintext description of the network request in language that is |
| 104 // understandable by admins (ideally also users). Please avoid acronyms. |
| 105 // Examples: |
| 106 // - “Sends a sequence of three consecutive words from a user input field |
| 107 // to Google’s online spell checker.” |
| 108 // - “A network request that comes from web content (a page the user |
| 109 // visits)” |
| 110 string description = 3; |
| 111 |
| 112 // What triggered the network request. Use a textual description. This |
| 113 // should be a human readable string. |
| 114 // For things that are clearly part of the website (resource load, form |
| 115 // submission, fetch by a service worker,...), you *may* just put “website” |
| 116 // here. |
| 117 string trigger = 4; |
| 118 |
| 119 // What nature of data is being sent. This should be a human readable |
| 120 // string. Any user data and/or PII should be pointed out. |
| 121 // Examples: “log files from /var/...”, “statistics about foobar”, “the |
| 122 // signature of a form of a website”, “installed extensions and their |
| 123 // version”, “a word on a website the user tapped on” |
| 124 string data = 5; |
| 125 |
| 126 enum Destination { |
| 127 // A website the user visits (this may be google.com) or interacts with. |
| 128 // For example search engines of the omnibar (also the default search |
| 129 // engine) would be considered websites. |
| 130 WEBSITE = 0; |
| 131 // A Google owned service, like SafeBrowsing, spellchecking, ... |
| 132 GOOGLE_OWNED_SERVICE = 1; |
| 133 // Other endpoints, e.g. a service hosting a PAC script |
| 134 OTHER = 2; |
| 135 } |
| 136 Destination destination = 6; |
| 137 // Human readable description in case the destination points to OTHER. |
| 138 string destination_other = 7; |
| 139 } |
| 140 |
| 141 TrafficSemantics semantics = 3; |
| 142 |
| 143 message TrafficPolicy { |
| 144 // Whether cookies/channel IDs/... can be sent or saved (use true if at |
| 145 // least one is correct). |
| 146 bool cookies_allowed = 1; |
| 147 |
| 148 // If cookies_allowed is true and the request uses not the profile cookie |
| 149 // store, please specify this here. You may use “system” to indicate that |
| 150 // the System RequestContext and its cookie store are used or specify other |
| 151 // exceptions (e.g. SafeBrowsing uses a separate cookie store). |
| 152 string cookies_store_exceptions = 2; |
| 153 |
| 154 // Human readable description of how to enable/disable a feature that |
| 155 // triggers this network request by a user. Use “NA”, if no such setting |
| 156 // exists (e.g. “Disable ‘Use a web service to help resolve spelling |
| 157 // errors.’ in Chrome’s settings under Advanced”). |
| 158 string setting = 3; |
| 159 |
| 160 // Example policy configuration that disables this network request. |
| 161 // This would be a text serialized protobuf of any enterprise policy. |
| 162 // see out/Debug/gen/components/policy/cloud_policy.proto |
| 163 repeated string policy = 4; |
| 164 // TODO: repeated enterprise_management.CloudPolicySettings policy = 4; |
| 165 } |
| 166 |
| 167 TrafficPolicy policy = 4; |
| 168 |
| 169 // Justification for not having a policy that disables this feature. |
| 170 string policy_exception_justification = 5; |
| 171 }; |
| 172 |
| 173 message ExtractedAuditPolicies { |
| 174 repeated AuditPolicies audit_policies = 1; |
| 175 }; |
| 176 |
| 177 message WhitelistedAuditPolicies { |
| 178 repeated AuditPolicies audit_policies = 1; |
| 179 }; |
| 180 |
| 181 message AuditPolicies { |
| 182 ExtractedAuditPolicies extracted_audit_policies = 1; |
| 183 WhitelistedAuditPolicies whitelisted_audit_policies = 2; |
| 184 }; |
OLD | NEW |