notification_config.proto 3.9 KB

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