Commit c039cb66 authored by Xida Chen's avatar Xida Chen Committed by Commit Bot

Revert "Define protobuf for enterprise connectors."

This reverts commit b6b99e74.

Reason for revert:
Causing build failure:
https://ci.chromium.org/p/chromium/builders/ci/GPU%20Linux%20Builder/208156

Original change's description:
> Define protobuf for enterprise connectors.
> 
> This CL also adds a new enterprise component under //components.
> 
> Bug: 1069026
> Change-Id: I7d696cf39beff070e242b1221ba4b13419ef6eb7
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2219009
> Commit-Queue: Roger Tawa <rogerta@chromium.org>
> Reviewed-by: Cait Phillips <caitkp@chromium.org>
> Reviewed-by: Daniel Rubery <drubery@chromium.org>
> Reviewed-by: Dominique Fauteux-Chapleau <domfc@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#776059}

TBR=rogerta@chromium.org,mad@chromium.org,caitkp@chromium.org,drubery@chromium.org,domfc@chromium.org,sukwanlee@chromium.org

Change-Id: I5ff6e47a8a0196b24204a8a1a9a6209f6b36499e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1069026
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2235978Reviewed-by: default avatarXida Chen <xidachen@chromium.org>
Commit-Queue: Xida Chen <xidachen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776063}
parent 37796303
...@@ -2082,7 +2082,6 @@ static_library("browser") { ...@@ -2082,7 +2082,6 @@ static_library("browser") {
"//components/download/public/background_service:public", "//components/download/public/background_service:public",
"//components/embedder_support", "//components/embedder_support",
"//components/encrypted_messages", "//components/encrypted_messages",
"//components/enterprise/common/proto:connectors_proto",
"//components/error_page/common", "//components/error_page/common",
"//components/favicon/content", "//components/favicon/content",
"//components/favicon/core", "//components/favicon/core",
...@@ -3852,6 +3851,7 @@ static_library("browser") { ...@@ -3852,6 +3851,7 @@ static_library("browser") {
"//base/util/memory_pressure", "//base/util/memory_pressure",
"//base/util/timer", "//base/util/timer",
"//chrome/app/vector_icons", "//chrome/app/vector_icons",
"//chrome/browser/enterprise/connectors:connectors_proto",
"//chrome/browser/policy:path_parser", "//chrome/browser/policy:path_parser",
"//chrome/browser/profile_resetter:profile_reset_report_proto", "//chrome/browser/profile_resetter:profile_reset_report_proto",
"//chrome/browser/resource_coordinator:intervention_policy_database_proto", "//chrome/browser/resource_coordinator:intervention_policy_database_proto",
......
include_rules = [
"+components/enterprise",
]
...@@ -5,8 +5,5 @@ ...@@ -5,8 +5,5 @@
import("//third_party/protobuf/proto_library.gni") import("//third_party/protobuf/proto_library.gni")
proto_library("connectors_proto") { proto_library("connectors_proto") {
proto_in_dir = "//"
sources = [ "connectors.proto" ] sources = [ "connectors.proto" ]
deps = [ "//components/safe_browsing/core:csd_proto" ]
} }
...@@ -25,9 +25,6 @@ const char* ConnectorPref(AnalysisConnector connector) { ...@@ -25,9 +25,6 @@ const char* ConnectorPref(AnalysisConnector connector) {
return kOnFileDownloadedPref; return kOnFileDownloadedPref;
case AnalysisConnector::FILE_ATTACHED: case AnalysisConnector::FILE_ATTACHED:
return kOnFileAttachedPref; return kOnFileAttachedPref;
case AnalysisConnector::ANALYSIS_CONNECTOR_UNSPECIFIED:
NOTREACHED() << "Using unspecified analysis connector";
return "";
} }
} }
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <set> #include <set>
#include <string> #include <string>
#include "components/enterprise/common/proto/connectors.pb.h"
#include "url/gurl.h" #include "url/gurl.h"
namespace enterprise_connectors { namespace enterprise_connectors {
...@@ -24,6 +23,14 @@ constexpr char kKeyBlockPasswordProtected[] = "block_password_protected"; ...@@ -24,6 +23,14 @@ constexpr char kKeyBlockPasswordProtected[] = "block_password_protected";
constexpr char kKeyBlockLargeFiles[] = "block_large_files"; constexpr char kKeyBlockLargeFiles[] = "block_large_files";
constexpr char kKeyBlockUnsupportedFileTypes[] = "block_unsupported_file_types"; constexpr char kKeyBlockUnsupportedFileTypes[] = "block_unsupported_file_types";
// Enums representing each connector to be used as arguments so the appropriate
// policies/settings can be read.
enum class AnalysisConnector {
FILE_DOWNLOADED,
FILE_ATTACHED,
BULK_DATA_ENTRY,
};
enum class ReportingConnector { enum class ReportingConnector {
SECURITY_EVENT, SECURITY_EVENT,
}; };
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// 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 enterprise_connectors;
enum AnalysisConnector {
ANALYSIS_CONNECTOR_UNSPECIFIED = 0;
ON_FILE_DOWNLOADED = 1;
ON_FILE_ATTACHED = 2;
ON_BULK_DATA_ENTRY = 3;
}
// Scanning request sent from Chrome to an analysis service.
message ContentAnalysisRequest {
optional AnalysisConnector analysis_connector = 1;
// The TokenID for Enterprise-enrolled devices. This identifies a specific
// chrome instance.
optional string device_token = 2;
// Firebase Cloud Messaging token used to notify this client of the verdict.
// This identifies a specific chrome instance.
optional string fcm_notification_token = 3;
// Token used to correlate requests and responses. This is different than the
// FCM token, in that it is unique for each request.
optional string request_token = 4;
// The tags configured for the URL that triggered the content analysis.
repeated string tags = 5;
}
// Scanning response sent from an analysis service to Chrome.
message ContentAnalysisResponse {
// Token used to correlate requests and responses. Corresponds to field in
// ContentAnalysisRequest with the same name.
optional string request_token = 1;
// The status of the response.
enum Status {
STATUS_UNKNOWN = 0;
SUCCESS = 1;
FAILURE = 2;
}
optional Status status = 2;
// Identifies the kind of detection that caused a trigger.
message MatchedDetector {
// Unique identifier for this detector.
optional string detector_id = 1;
// Display name of this detector.
optional string display_name = 2;
// Type of this detector.
optional string detector_type = 3;
}
// Identifies the detection rules that were triggered by the content uploaded
// with the analysis request.
message TriggeredRule {
enum Action {
ACTION_UNKNOWN = 0;
REPORT_ONLY = 1;
WARN = 2;
BLOCK = 3;
}
optional Action action = 1;
optional string rule_name = 2;
optional int64 rule_id = 3;
optional string rule_resource_name = 4;
optional string rule_severity = 5;
repeated MatchedDetector matched_detectors = 6;
// The tag of the analysis that triggered this rule.
optional string tag = 7;
}
// Only relevant when status is SUCCESS above.
repeated TriggeredRule triggered_rules = 3;
}
include_rules = [
"+components/safe_browsing/core/proto",
]
domfc@chromium.org
emaxx@chromium.org
nicolaso@chromium.org
pastarmovj@chromium.org
pmarko@chromium.org
rogerta@chromium.org
ydago@chromium.org
zmin@chromium.org
# COMPONENT: Enterprise
// Copyright 2020 The Chromium Authors. All rights reserved.
// 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 enterprise_connectors;
// For ClientDownloadRequest.
import "components/safe_browsing/core/proto/csd.proto";
// Which connector is calling BinaryUploadService so that the proper rules can
// be triggered. BinaryUploadService also uses this value to find the URL that
// the payload should be uploaded to.
//
// The values in this enum can be extended in future versions of Chrome to
// support new analysis connectors.
enum AnalysisConnector {
ANALYSIS_CONNECTOR_UNSPECIFIED = 0;
FILE_DOWNLOADED = 1;
FILE_ATTACHED = 2;
BULK_DATA_ENTRY = 3;
}
message ContentMetaData {
// The URL containing the file download/upload or to which web content is
// being uploaded.
optional string url = 1;
// Name of file on user system (if applicable).
optional string filename = 2;
// Sha256 digest of file.
optional string digest = 3;
// Specifically for the download case.
optional safe_browsing.ClientDownloadRequest csd = 4;
}
// Analysis request sent from chrome to backend.
message ContentAnalysisRequest {
// The TokenID for Enterprise-enrolled devices. This identifies a specific
// chrome instance.
optional string device_token = 1;
// Firebase Cloud Messaging token used to notify this client of the verdict.
// This identifies a specific chrome instance.
optional string fcm_notification_token = 2;
// Which enterprise connector fired this request.
optional AnalysisConnector analysis_connector = 9;
// Information about the data that triggered the content analysis request.
optional ContentMetaData request_data = 10;
// Token used to correlate requests and responses. This is different than the
// FCM token in that it is unique for each request.
optional string request_token = 5;
// The tags configured for the URL that triggered the content analysis.
repeated string tags = 11;
// Reserved to make sure there is no overlap with DeepScanningClientRequest.
reserved 3, 4, 6 to 8;
}
// Scanning response sent from backend to Chrome.
message ContentAnalysisResponse {
// Token used to correlate requests and responses. Corresponds to field in
// ContentAnalysisRequest with the same name.
optional string request_token = 1;
// Represents the analysis result from a given tag.
message Result {
optional string tag = 1;
// The status of this result.
enum Status {
STATUS_UNKNOWN = 0;
SUCCESS = 1;
FAILURE = 2;
}
optional Status status = 2;
// Identifies the detection rules that were triggered by the analysis.
// Only relevant when status is SUCCESS.
message TriggeredRule {
enum Action {
ACTION_UNSPECIFIED = 0;
REPORT_ONLY = 1;
WARN = 2;
BLOCK = 3;
}
optional Action action = 1;
optional string rule_name = 2;
optional string rule_id = 3;
}
repeated TriggeredRule triggered_rules = 3;
}
repeated Result results = 4;
// Reserved to make sure there is no overlap with DeepScanningClientResponse.
reserved 2 to 3;
}
...@@ -16,17 +16,7 @@ static_library("features") { ...@@ -16,17 +16,7 @@ static_library("features") {
] ]
} }
# Because csd.proto is included from a proto file outside its own directory,
# proto_in_dir is required so that import can follow the Chromium style guide
# that all imports start from the source root.
#
# However, due to the way that protoc generates C++ code, this directive is
# also required in all build targets for protos that import csd.proto, including
# the protos in the same directory. Those protos also need to import csd.proto
# using a path from the source root, otherwise they won't compile.
proto_library("csd_proto") { proto_library("csd_proto") {
proto_in_dir = "//"
sources = [ "proto/csd.proto" ] sources = [ "proto/csd.proto" ]
} }
...@@ -35,7 +25,6 @@ proto_library("webui_proto") { ...@@ -35,7 +25,6 @@ proto_library("webui_proto") {
} }
proto_library("realtimeapi_proto") { proto_library("realtimeapi_proto") {
proto_in_dir = "//"
sources = [ "proto/realtimeapi.proto" ] sources = [ "proto/realtimeapi.proto" ]
deps = [ ":csd_proto" ] deps = [ ":csd_proto" ]
} }
...@@ -45,7 +34,6 @@ proto_library("webprotect_proto") { ...@@ -45,7 +34,6 @@ proto_library("webprotect_proto") {
} }
proto_library("client_model_proto") { proto_library("client_model_proto") {
proto_in_dir = "//"
sources = [ "proto/client_model.proto" ] sources = [ "proto/client_model.proto" ]
deps = [ ":csd_proto" ] deps = [ ":csd_proto" ]
} }
......
...@@ -18,7 +18,7 @@ option optimize_for = LITE_RUNTIME; ...@@ -18,7 +18,7 @@ option optimize_for = LITE_RUNTIME;
package safe_browsing; package safe_browsing;
import "components/safe_browsing/core/proto/csd.proto"; import 'csd.proto';
// This protocol buffer represents a machine learning model that is used in // This protocol buffer represents a machine learning model that is used in
// client-side phishing detection (in Chrome). The client extracts a set // client-side phishing detection (in Chrome). The client extracts a set
......
...@@ -11,7 +11,7 @@ option optimize_for = LITE_RUNTIME; ...@@ -11,7 +11,7 @@ option optimize_for = LITE_RUNTIME;
package safe_browsing; package safe_browsing;
import "components/safe_browsing/core/proto/csd.proto"; import "csd.proto";
message RTLookupRequest { message RTLookupRequest {
// If applicable, URL submitted from Chrome. // If applicable, URL submitted from Chrome.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment