1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268
|
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
syntax = "proto2";
option optimize_for = LITE_RUNTIME;
package dlp;
// Which restriction should be applied by the rule.
enum DlpRuleLevel {
// Should not be used.
UNSPECIFIED = 0;
// The action will be allowed (overwrites BLOCK).
ALLOW = 1;
// The action won't be allowed.
BLOCK = 2;
}
// A representation of destinations to which transferring files can be
// restricted.
enum DlpComponent {
// Should not be used.
UNKNOWN_COMPONENT = 0;
// To represent internal Chrome OS transfers.
SYSTEM = 1;
// ARC++ as a Guest OS.
ARC = 2;
// Crostini as a Guest OS.
CROSTINI = 3;
// Plugin VM (Parallels/Windows) as a Guest OS.
PLUGIN_VM = 4;
// Removable disk.
USB = 5;
// Google drive for file storage.
GOOGLE_DRIVE = 6;
// Microsoft OneDrive for file storage.
MICROSOFT_ONEDRIVE = 7;
}
// A representation of possible file actions.
enum FileAction {
// File transfer (the default if none of the actions below is specified).
TRANSFER = 0;
// File upload.
UPLOAD = 1;
// File open.
OPEN = 2;
// File copy.
COPY = 3;
// File move.
MOVE = 4;
// File share.
SHARE = 5;
}
// Restriction level that was evaluated in Chrome.
enum RestrictionLevel {
// Default
LEVEL_UNSPECIFIED = 0;
// Action allowed.
LEVEL_ALLOW = 1;
// Action allowed and reported.
LEVEL_REPORT = 2;
// User allowed the action after warning.
LEVEL_WARN_PROCEED = 3;
// User blocked the action after warning.
LEVEL_WARN_CANCEL = 4;
// Action blocked.
LEVEL_BLOCK = 5;
}
message DlpFilesRule {
// Defines where from the file was originated.
// URL patterns according to this format
// ( https://www.chromium.org/administrators/url-blacklist-filter-format )
repeated string source_urls = 1;
// Defines where to the file is targeted.
// URL patterns according to this format
// ( https://www.chromium.org/administrators/url-blacklist-filter-format )
repeated string destination_urls = 2;
// Restriction level applied to files satisfying the pattern above.
optional DlpRuleLevel level = 3;
// Defines where to the file is targeted.
repeated DlpComponent destination_components = 4;
}
message SetDlpFilesPolicyRequest {
// List of rules applied to FILES class in DataLeakPreventionRules policy.
repeated DlpFilesRule rules = 1;
}
message SetDlpFilesPolicyResponse {
// Error message, empty if no error occurred.
optional string error_message = 1;
}
message AddFileRequest {
// Path to the downloaded file.
optional string file_path = 1;
// Downloaded file source URL (the URL it was downloaded from).
optional string source_url = 2;
// Downloaded file referrer URL (the URL the download process was initiated
// from).
optional string referrer_url = 3;
}
message AddFilesRequest {
// List of AddFileRequest messages corresponding to files to add to the
// daemon.
repeated AddFileRequest add_file_requests = 1;
}
message AddFileResponse {
// Error message, empty if no error occurred.
optional string error_message = 1;
}
message AddFilesResponse {
// Error message, empty if no error occurred.
optional string error_message = 1;
}
message RequestFileAccessRequest {
reserved 1;
// Process id for which an access is requested.
optional int32 process_id = 2;
// Destination where the files will be targeted by the process.
optional string destination_url = 3;
// Files paths to be transferred.
repeated string files_paths = 4;
// Destination component where the file will be transferred.
optional DlpComponent destination_component = 5;
}
message RequestFileAccessResponse {
// Error message, empty if no error occurred.
optional string error_message = 1;
// Whether file access for all requested files was approved.
optional bool allowed = 2;
}
message FileMetadata {
// File inode number.
optional uint64 inode = 1;
// URL from where the file was downloaded.
optional string source_url = 2;
// File path.
optional string path = 3;
// Referrer URL from which the download process was initiated.
optional string referrer_url = 4;
// File creation time.
optional uint64 crtime = 5;
}
// File metadata along with the restriction.
message FileRestriction {
// File info.
optional FileMetadata file_metadata = 1;
// Evaluated restriction level for the file.
optional RestrictionLevel restriction_level = 2;
}
message IsDlpPolicyMatchedRequest {
reserved 1;
// File metadata.
optional FileMetadata file_metadata = 2;
}
message IsDlpPolicyMatchedResponse {
// Whether a DLP rule exists that might prevent operation on the file.
optional bool restricted = 1;
}
message GetFilesSourcesRequest {
reserved 1;
// A list of paths to the files.
repeated string files_paths = 2;
}
message GetFilesSourcesResponse {
// Error message, empty if no error occurred.
optional string error_message = 1;
// A list of files source urls.
// Contains |path| only if it was provided in the request.
repeated FileMetadata files_metadata = 2;
}
message CheckFilesTransferRequest {
// Files paths to be transferred.
repeated string files_paths = 1;
// Destination url where the file will be transferred.
optional string destination_url = 2;
// Destination component where the file will be transferred.
optional DlpComponent destination_component = 3;
// Requested file action.
optional FileAction file_action = 4;
// I/O Task Id. Optional field needed to properly show warnings within the
// Files app.
optional uint64 io_task_id = 5;
}
message CheckFilesTransferResponse {
// Error message, empty if no error occurred.
optional string error_message = 1;
// Files paths restricted to be transferred.
repeated string files_paths = 2;
}
message IsFilesTransferRestrictedRequest {
reserved 1;
// Destination url where the file will be transferred.
optional string destination_url = 2;
// Files to be transferred.
repeated FileMetadata transferred_files = 3;
// Destination component where the file will be transferred.
optional DlpComponent destination_component = 4;
// Requested file action.
optional FileAction file_action = 5;
// I/O Task Id. Optional field needed to properly show warnings within the
// Files app.
optional uint64 io_task_id = 6;
}
message IsFilesTransferRestrictedResponse {
reserved 2, 3;
// Error message, empty if no error occurred.
optional string error_message = 1;
// Files restricted to be transferred.
// Check results for the files to be transferred.
repeated FileRestriction files_restrictions = 4;
}
message GetDatabaseEntriesResponse {
// Error message, empty if no error occurred.
optional string error_message = 1;
// Files entries.
repeated FileMetadata files_entries = 2;
}
|