kubernetes.proto 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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/cloud/securitycenter/v1/container.proto";
  17. import "google/cloud/securitycenter/v1/label.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 = "KubernetesProto";
  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. // Kubernetes related attributes.
  26. message Kubernetes {
  27. // Kubernetes Pod.
  28. message Pod {
  29. // Kubernetes Pod namespace.
  30. string ns = 1;
  31. // Kubernetes Pod name.
  32. string name = 2;
  33. // Pod labels. For Kubernetes containers, these are applied to the
  34. // container.
  35. repeated Label labels = 3;
  36. // Pod containers associated with this finding, if any.
  37. repeated Container containers = 4;
  38. }
  39. // Kubernetes Nodes associated with the finding.
  40. message Node {
  41. // Full Resource name of the Compute Engine VM running the
  42. // cluster node.
  43. string name = 1;
  44. }
  45. // Provides GKE Node Pool information.
  46. message NodePool {
  47. // Kubernetes Node pool name.
  48. string name = 1;
  49. // Nodes associated with the finding.
  50. repeated Node nodes = 2;
  51. }
  52. // Kubernetes Role or ClusterRole.
  53. message Role {
  54. // Types of Kubernetes roles.
  55. enum Kind {
  56. // Role type is not specified.
  57. KIND_UNSPECIFIED = 0;
  58. // Kubernetes Role.
  59. ROLE = 1;
  60. // Kubernetes ClusterRole.
  61. CLUSTER_ROLE = 2;
  62. }
  63. // Role type.
  64. Kind kind = 1;
  65. // Role namespace.
  66. string ns = 2;
  67. // Role name.
  68. string name = 3;
  69. }
  70. // Represents a Kubernetes RoleBinding or ClusterRoleBinding.
  71. message Binding {
  72. // Namespace for binding.
  73. string ns = 1;
  74. // Name for binding.
  75. string name = 2;
  76. // The Role or ClusterRole referenced by the binding.
  77. Role role = 3;
  78. // Represents the subjects(s) bound to the role. Not always available
  79. // for PATCH requests.
  80. repeated Subject subjects = 4;
  81. }
  82. // Represents a Kubernetes Subject.
  83. message Subject {
  84. // Auth types that can be used for Subject's kind field.
  85. enum AuthType {
  86. // Authentication is not specified.
  87. AUTH_TYPE_UNSPECIFIED = 0;
  88. // User with valid certificate.
  89. USER = 1;
  90. // Users managed by Kubernetes API with credentials stored as Secrets.
  91. SERVICEACCOUNT = 2;
  92. // Collection of users.
  93. GROUP = 3;
  94. }
  95. // Authentication type for subject.
  96. AuthType kind = 1;
  97. // Namespace for subject.
  98. string ns = 2;
  99. // Name for subject.
  100. string name = 3;
  101. }
  102. // Conveys information about a Kubernetes access review (e.g. kubectl auth
  103. // can-i ...) that was involved in a finding.
  104. message AccessReview {
  105. // Group is the API Group of the Resource. "*" means all.
  106. string group = 1;
  107. // Namespace of the action being requested. Currently, there is no
  108. // distinction between no namespace and all namespaces. Both
  109. // are represented by "" (empty).
  110. string ns = 2;
  111. // Name is the name of the resource being requested. Empty means all.
  112. string name = 3;
  113. // Resource is the optional resource type requested. "*" means all.
  114. string resource = 4;
  115. // Subresource is the optional subresource type.
  116. string subresource = 5;
  117. // Verb is a Kubernetes resource API verb, like: get, list, watch, create,
  118. // update, delete, proxy. "*" means all.
  119. string verb = 6;
  120. // Version is the API Version of the Resource. "*" means all.
  121. string version = 7;
  122. }
  123. // Kubernetes Pods associated with the finding. This field will contain Pod
  124. // records for each container that is owned by a Pod.
  125. repeated Pod pods = 1;
  126. // Provides Kubernetes Node information.
  127. repeated Node nodes = 2;
  128. // GKE Node Pools associated with the finding. This field will
  129. // contain NodePool information for each Node, when it is available.
  130. repeated NodePool node_pools = 3;
  131. // Provides Kubernetes role information for findings that involve
  132. // Roles or ClusterRoles.
  133. repeated Role roles = 4;
  134. // Provides Kubernetes role binding information for findings that involve
  135. // RoleBindings or ClusterRoleBindings.
  136. repeated Binding bindings = 5;
  137. // Provides information on any Kubernetes access reviews (i.e. privilege
  138. // checks) relevant to the finding.
  139. repeated AccessReview access_reviews = 6;
  140. }