notification_config.proto 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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.v1p1beta1;
  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.V1P1Beta1";
  20. option go_package = "google.golang.org/genproto/googleapis/cloud/securitycenter/v1p1beta1;securitycenter";
  21. option java_multiple_files = true;
  22. option java_package = "com.google.cloud.securitycenter.v1p1beta1";
  23. option php_namespace = "Google\\Cloud\\SecurityCenter\\V1p1beta1";
  24. option ruby_package = "Google::Cloud::SecurityCenter::V1p1beta1";
  25. option (google.api.resource_definition) = {
  26. type: "pubsub.googleapis.com/Topic"
  27. pattern: "projects/{project}/topics/{topic}"
  28. };
  29. // Security Command Center notification configs.
  30. //
  31. // A notification config is a Security Command Center resource that contains the
  32. // configuration to send notifications for create/update events of findings,
  33. // 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 type of events.
  66. enum EventType {
  67. // Unspecified event type.
  68. EVENT_TYPE_UNSPECIFIED = 0;
  69. // Events for findings.
  70. FINDING = 1;
  71. }
  72. // The relative resource name of this notification config. See:
  73. // https://cloud.google.com/apis/design/resource_names#relative_resource_name
  74. // Example:
  75. // "organizations/{organization_id}/notificationConfigs/notify_public_bucket".
  76. string name = 1;
  77. // The description of the notification config (max of 1024 characters).
  78. string description = 2;
  79. // The type of events the config is for, e.g. FINDING.
  80. EventType event_type = 3;
  81. // The Pub/Sub topic to send notifications to. Its format is
  82. // "projects/[project_id]/topics/[topic]".
  83. string pubsub_topic = 4 [(google.api.resource_reference) = {
  84. type: "pubsub.googleapis.com/Topic"
  85. }];
  86. // Output only. The service account that needs "pubsub.topics.publish"
  87. // permission to publish to the Pub/Sub topic.
  88. string service_account = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  89. // The config for triggering notifications.
  90. oneof notify_config {
  91. // The config for triggering streaming-based notifications.
  92. StreamingConfig streaming_config = 6;
  93. }
  94. }