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