1// Copyright 2021 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.securitycenter.v1p1beta1; 18 19import "google/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21 22option csharp_namespace = "Google.Cloud.SecurityCenter.V1P1Beta1"; 23option go_package = "cloud.google.com/go/securitycenter/apiv1p1beta1/securitycenterpb;securitycenterpb"; 24option java_multiple_files = true; 25option java_package = "com.google.cloud.securitycenter.v1p1beta1"; 26option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1"; 27option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1"; 28option (google.api.resource_definition) = { 29 type: "pubsub.googleapis.com/Topic" 30 pattern: "projects/{project}/topics/{topic}" 31}; 32 33// Security Command Center notification configs. 34// 35// A notification config is a Security Command Center resource that contains the 36// configuration to send notifications for create/update events of findings, 37// assets and etc. 38message NotificationConfig { 39 option (google.api.resource) = { 40 type: "securitycenter.googleapis.com/NotificationConfig" 41 pattern: "organizations/{organization}/notificationConfigs/{notification_config}" 42 }; 43 44 // The config for streaming-based notifications, which send each event as soon 45 // as it is detected. 46 message StreamingConfig { 47 // Expression that defines the filter to apply across create/update events 48 // of assets or findings as specified by the event type. The expression is a 49 // list of zero or more restrictions combined via logical operators `AND` 50 // and `OR`. Parentheses are supported, and `OR` has higher precedence than 51 // `AND`. 52 // 53 // Restrictions have the form `<field> <operator> <value>` and may have a 54 // `-` character in front of them to indicate negation. The fields map to 55 // those defined in the corresponding resource. 56 // 57 // The supported operators are: 58 // 59 // * `=` for all value types. 60 // * `>`, `<`, `>=`, `<=` for integer values. 61 // * `:`, meaning substring matching, for strings. 62 // 63 // The supported value types are: 64 // 65 // * string literals in quotes. 66 // * integer literals without quotes. 67 // * boolean literals `true` and `false` without quotes. 68 string filter = 1; 69 } 70 71 // The type of events. 72 enum EventType { 73 // Unspecified event type. 74 EVENT_TYPE_UNSPECIFIED = 0; 75 76 // Events for findings. 77 FINDING = 1; 78 } 79 80 // The relative resource name of this notification config. See: 81 // https://cloud.google.com/apis/design/resource_names#relative_resource_name 82 // Example: 83 // "organizations/{organization_id}/notificationConfigs/notify_public_bucket". 84 string name = 1; 85 86 // The description of the notification config (max of 1024 characters). 87 string description = 2; 88 89 // The type of events the config is for, e.g. FINDING. 90 EventType event_type = 3; 91 92 // The Pub/Sub topic to send notifications to. Its format is 93 // "projects/[project_id]/topics/[topic]". 94 string pubsub_topic = 4 [(google.api.resource_reference) = { 95 type: "pubsub.googleapis.com/Topic" 96 }]; 97 98 // Output only. The service account that needs "pubsub.topics.publish" 99 // permission to publish to the Pub/Sub topic. 100 string service_account = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; 101 102 // The config for triggering notifications. 103 oneof notify_config { 104 // The config for triggering streaming-based notifications. 105 StreamingConfig streaming_config = 6; 106 } 107} 108