generated.proto 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /*
  2. Copyright The Kubernetes Authors.
  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. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. // This file was autogenerated by go-to-protobuf. Do not edit it manually!
  14. syntax = 'proto2';
  15. package k8s.io.api.auditregistration.v1alpha1;
  16. import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto";
  17. import "k8s.io/apimachinery/pkg/runtime/generated.proto";
  18. import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto";
  19. // Package-wide variables from generator "generated".
  20. option go_package = "v1alpha1";
  21. // AuditSink represents a cluster level audit sink
  22. message AuditSink {
  23. // +optional
  24. optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1;
  25. // Spec defines the audit configuration spec
  26. optional AuditSinkSpec spec = 2;
  27. }
  28. // AuditSinkList is a list of AuditSink items.
  29. message AuditSinkList {
  30. // +optional
  31. optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1;
  32. // List of audit configurations.
  33. repeated AuditSink items = 2;
  34. }
  35. // AuditSinkSpec holds the spec for the audit sink
  36. message AuditSinkSpec {
  37. // Policy defines the policy for selecting which events should be sent to the webhook
  38. // required
  39. optional Policy policy = 1;
  40. // Webhook to send events
  41. // required
  42. optional Webhook webhook = 2;
  43. }
  44. // Policy defines the configuration of how audit events are logged
  45. message Policy {
  46. // The Level that all requests are recorded at.
  47. // available options: None, Metadata, Request, RequestResponse
  48. // required
  49. optional string level = 1;
  50. // Stages is a list of stages for which events are created.
  51. // +optional
  52. repeated string stages = 2;
  53. }
  54. // ServiceReference holds a reference to Service.legacy.k8s.io
  55. message ServiceReference {
  56. // `namespace` is the namespace of the service.
  57. // Required
  58. optional string namespace = 1;
  59. // `name` is the name of the service.
  60. // Required
  61. optional string name = 2;
  62. // `path` is an optional URL path which will be sent in any request to
  63. // this service.
  64. // +optional
  65. optional string path = 3;
  66. }
  67. // Webhook holds the configuration of the webhook
  68. message Webhook {
  69. // Throttle holds the options for throttling the webhook
  70. // +optional
  71. optional WebhookThrottleConfig throttle = 1;
  72. // ClientConfig holds the connection parameters for the webhook
  73. // required
  74. optional WebhookClientConfig clientConfig = 2;
  75. }
  76. // WebhookClientConfig contains the information to make a connection with the webhook
  77. message WebhookClientConfig {
  78. // `url` gives the location of the webhook, in standard URL form
  79. // (`scheme://host:port/path`). Exactly one of `url` or `service`
  80. // must be specified.
  81. //
  82. // The `host` should not refer to a service running in the cluster; use
  83. // the `service` field instead. The host might be resolved via external
  84. // DNS in some apiservers (e.g., `kube-apiserver` cannot resolve
  85. // in-cluster DNS as that would be a layering violation). `host` may
  86. // also be an IP address.
  87. //
  88. // Please note that using `localhost` or `127.0.0.1` as a `host` is
  89. // risky unless you take great care to run this webhook on all hosts
  90. // which run an apiserver which might need to make calls to this
  91. // webhook. Such installs are likely to be non-portable, i.e., not easy
  92. // to turn up in a new cluster.
  93. //
  94. // The scheme must be "https"; the URL must begin with "https://".
  95. //
  96. // A path is optional, and if present may be any string permissible in
  97. // a URL. You may use the path to pass an arbitrary string to the
  98. // webhook, for example, a cluster identifier.
  99. //
  100. // Attempting to use a user or basic auth e.g. "user:password@" is not
  101. // allowed. Fragments ("#...") and query parameters ("?...") are not
  102. // allowed, either.
  103. //
  104. // +optional
  105. optional string url = 1;
  106. // `service` is a reference to the service for this webhook. Either
  107. // `service` or `url` must be specified.
  108. //
  109. // If the webhook is running within the cluster, then you should use `service`.
  110. //
  111. // Port 443 will be used if it is open, otherwise it is an error.
  112. //
  113. // +optional
  114. optional ServiceReference service = 2;
  115. // `caBundle` is a PEM encoded CA bundle which will be used to validate the webhook's server certificate.
  116. // If unspecified, system trust roots on the apiserver are used.
  117. // +optional
  118. optional bytes caBundle = 3;
  119. }
  120. // WebhookThrottleConfig holds the configuration for throttling events
  121. message WebhookThrottleConfig {
  122. // ThrottleQPS maximum number of batches per second
  123. // default 10 QPS
  124. // +optional
  125. optional int64 qps = 1;
  126. // ThrottleBurst is the maximum number of events sent at the same moment
  127. // default 15 QPS
  128. // +optional
  129. optional int64 burst = 2;
  130. }