notification_config.proto 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. syntax = "proto3";
  15. package google.cloud.securitycenter.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/api/annotations.proto";
  19. option csharp_namespace = "Google.Cloud.SecurityCenter.V1";
  20. option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1;securitycenter";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "NotificationConfigProto";
  23. option java_package = "com.google.cloud.securitycenter.v1";
  24. option php_namespace = "Google\\Cloud\\SecurityCenter\\V1";
  25. option ruby_package = "Google::Cloud::SecurityCenter::V1";
  26. option (google.api.resource_definition) = {
  27. type: "pubsub.googleapis.com/Topic"
  28. pattern: "projects/{project}/topics/{topic}"
  29. };
  30. // Cloud Security Command Center (Cloud SCC) notification configs.
  31. //
  32. // A notification config is a Cloud SCC resource that contains the configuration
  33. // to send notifications for create/update events of findings, assets and etc.
  34. message NotificationConfig {
  35. option (google.api.resource) = {
  36. type: "securitycenter.googleapis.com/NotificationConfig"
  37. pattern: "organizations/{organization}/notificationConfigs/{notification_config}"
  38. };
  39. // The config for streaming-based notifications, which send each event as soon
  40. // as it is detected.
  41. message StreamingConfig {
  42. // Expression that defines the filter to apply across create/update events
  43. // of assets or findings as specified by the event type. The expression is a
  44. // list of zero or more restrictions combined via logical operators `AND`
  45. // and `OR`. Parentheses are supported, and `OR` has higher precedence than
  46. // `AND`.
  47. //
  48. // Restrictions have the form `<field> <operator> <value>` and may have a
  49. // `-` character in front of them to indicate negation. The fields map to
  50. // those defined in the corresponding resource.
  51. //
  52. // The supported operators are:
  53. //
  54. // * `=` for all value types.
  55. // * `>`, `<`, `>=`, `<=` for integer values.
  56. // * `:`, meaning substring matching, for strings.
  57. //
  58. // The supported value types are:
  59. //
  60. // * string literals in quotes.
  61. // * integer literals without quotes.
  62. // * boolean literals `true` and `false` without quotes.
  63. string filter = 1;
  64. }
  65. // The relative resource name of this notification config. See:
  66. // https://cloud.google.com/apis/design/resource_names#relative_resource_name
  67. // Example:
  68. // "organizations/{organization_id}/notificationConfigs/notify_public_bucket".
  69. string name = 1;
  70. // The description of the notification config (max of 1024 characters).
  71. string description = 2;
  72. // The Pub/Sub topic to send notifications to. Its format is
  73. // "projects/[project_id]/topics/[topic]".
  74. string pubsub_topic = 3 [(google.api.resource_reference) = {
  75. type: "pubsub.googleapis.com/Topic"
  76. }];
  77. // Output only. The service account that needs "pubsub.topics.publish"
  78. // permission to publish to the Pub/Sub topic.
  79. string service_account = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  80. // The config for triggering notifications.
  81. oneof notify_config {
  82. // The config for triggering streaming-based notifications.
  83. StreamingConfig streaming_config = 5;
  84. }
  85. }