Commit Graph

373 Commits

Author SHA1 Message Date
Monis Khan 9bbffa3c76 kmsv1: attempt AES-GCM before AES-CBC on reads
Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: 5137fb00b6fb47445727a1fa2897e0eaaadaeeb8
2023-07-17 16:22:17 -04:00
Monis Khan 6cfe489651 Clear front proxy headers after authentication is complete
This matches the logic we have for the Authorization header as well
as the impersonation headers.

Signed-off-by: Monis Khan <mok@microsoft.com>

Kubernetes-commit: 7b711c5cf4d6721e9742baf5ebfafee42f645789
2023-03-20 13:11:38 -04:00
Jordan Liggitt b3ad9fb4e3 Generate and format files
- Run hack/update-codegen.sh
- Run hack/update-generated-device-plugin.sh
- Run hack/update-generated-protobuf.sh
- Run hack/update-generated-runtime.sh
- Run hack/update-generated-swagger-docs.sh
- Run hack/update-openapi-spec.sh
- Run hack/update-gofmt.sh

Replay of a9593d634c6a053848413e600dadbf974627515f

Kubernetes-commit: 15d9d196476d64482189f00f1cf1a2061aea5b35
2022-11-16 11:39:18 -05:00
Vladimir Nachev 7013f45ebc Ensure the dir of --audit-log-path exists
Signed-off-by: Vladimir Nachev <vladimir.nachev@sap.com>

Kubernetes-commit: b83d6aa37d152a3728eb041faefe0ec83be6bb32
2022-06-27 17:21:02 +03:00
Anish Ramasekar e442eafb33 feat: prepare KMS data encryption for migration to AES-GCM
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
Co-authored-by: Monis Khan <mok@vmware.com>
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>

Kubernetes-commit: 90b42f91fd904b71fd52ca9ae55a5de73e6b779a
2022-03-16 17:54:10 +00:00
Ravi Gudimetla 1ee261d219 API Server Changes
This commit includes all the changes needed for APIServer. Instead of modifying the existing signatures for the methods which either generate or return stopChannel, we generate a context from the channel and use the generated context to be passed to the controllers which are started in APIServer. This ensures we don't have to touch APIServer dependencies.

Kubernetes-commit: 8b84a793b39fed2a62af0876b2eda461a68008c9
2022-03-07 09:20:45 -05:00
ialidzhikov 38f395ca57 apiserver: Remove the deprecated `--deserialization-cache-size` flag
Signed-off-by: ialidzhikov <i.alidjikov@gmail.com>

Kubernetes-commit: ee2530ffd4db0cdc8384f7d4acb014e79bb224e9
2022-03-02 15:33:21 +02:00
carlory 871a4b7200 remove audit.k8s.io/v1[alpha|beta]1 versions
Kubernetes-commit: fcc282f9f2050aaa4007d6f0444b0f4972925fea
2022-02-13 13:23:49 +08:00
ialidzhikov bce3488a65 apiserver: Remove the deprecated `--target-ram-mb` flag
Signed-off-by: ialidzhikov <i.alidjikov@gmail.com>

Kubernetes-commit: bdbc7501293eac721ea6f77b55918652f2cd6aab
2022-03-02 18:52:46 +02:00
ialidzhikov aa165d392e apiserver: Remove the deprecated `--experimental-encryption-provider-config` flag
Signed-off-by: ialidzhikov <i.alidjikov@gmail.com>

Kubernetes-commit: 244bf1bd69c962041ba5cabc3c9e92f3f94a3ba4
2022-03-01 19:21:18 +02:00
Steve Kuznetsov af1cb1cefe storage: transformers: pass a context.Context
When an envelope transformer calls out to KMS (for instance), it will be
very helpful to pass a `context.Context` to allow for cancellation. This
patch does that, while passing the previously-expected additional data
via a context value.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>

Kubernetes-commit: 27312feb9983c18d1daf00afba788727d024cdd0
2022-02-17 07:29:44 -08:00
Pingan2017 41eb079182 Remove args enable-swagger-ui since no effect from 1.14
Kubernetes-commit: 206f3aeec2748ef149a36a9c69329b5be2953ecb
2021-09-15 10:32:35 +08:00
William Zhang c0fcf30dd4 cleanup(apiserver): delete the --max-resource-write-bytes & --json-patch-max-copy-bytes description.
Change-Id: I0fe27dce27db6a1e186bd44a968c6e931de88dd8
Signed-off-by: William Zhang <warmchang@outlook.com>

Kubernetes-commit: 584165cfcc861bc0c8911e11347734cfc8feb8c8
2021-12-08 17:12:37 +08:00
Davanum Srinivas b840d63feb Cleanup OWNERS files (No Activity in the last year)
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 497e9c1971c9e7d0193bc6d11503ec4ad527f1d5
2021-12-10 15:18:50 -05:00
Davanum Srinivas 56a3a30ae1 Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 9405e9b55ebcd461f161859a698b949ea3bde31d
2021-12-09 21:31:26 -05:00
astraw99 2e5bed6053 fix typo `registry`
Kubernetes-commit: 6d16238fe53bf1135d781c73d3df4283ecef7fed
2021-08-08 18:37:16 +08:00
Anish Ramasekar 1e3c9bfcdb fix typo in kms encryption config logs
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>

Kubernetes-commit: 63295a126e316fb7b8630dbc57e98041e747cbed
2021-09-16 18:18:59 +00:00
Abu Kashem db8aff032b apf: update apf logic to use v1beta2
Kubernetes-commit: 28f2b42a4116a9223113e8b152e02a4f1e602ff4
2021-08-16 17:53:57 -04:00
Mike Spreitzer b225af44fe Introduce storagebackend.ConfigForResource
This is a Config specialized for a GroupResource.
It will support generating new resource-specific metrics.

Kubernetes-commit: 85bcd243aa3c8769a5904a1aea44ce704f5e7174
2021-08-29 01:06:12 -04:00
Abu Kashem 033ff70436 Revert "Merge pull request #104281 from tkashem/not-ready-429"
This reverts commit fc5863b8b276e0789f717859e8cce58d7d060181, reversing
changes made to 027fe2554fd18343b8be39eddc8ff6570a6c390f.

Kubernetes-commit: f9f08725907b7db2104ee5fe9f82ab0752726533
2021-08-31 10:10:46 -04:00
Abu Kashem a687b3b7a9 Revert "Merge pull request #104630 from tkashem/remove-option"
This reverts commit edb0a72cff0e43bab72a02cada8486d562ee1cd5, reversing
changes made to 80feff6f407be9f0898c449ba3f9d4d013f05ec9.

Kubernetes-commit: 8844d3092a46a40915b4df6e3b9944d5081f8268
2021-08-31 10:06:12 -04:00
Abu Kashem ee2c906b05 apiserver: remove server option startup-send-retry-after-until-ready
Kubernetes-commit: 7adc79a4ea33cc44aa8d694c4949e01219e016de
2021-08-27 10:29:37 -04:00
Stephen Augustus 771ffe6475 generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>

Kubernetes-commit: 481cf6fbe753b9eb2a47ced179211206b0a99540
2021-08-12 17:13:11 -04:00
Antonio Ojea 38c6ad936b run hack/update-netparse-cve.sh
Kubernetes-commit: 0cd75e8fec62a2531637e80bb950ac9983cac1b0
2021-08-20 01:16:14 +02:00
Abu Kashem 450b7e8f12 rename audit Checker interface
Kubernetes-commit: 27f150351475adaef416bd893403e7066b70d33a
2021-03-24 13:07:21 -04:00
Abu Kashem f3ae70d0cf send retry-after until ready
Kubernetes-commit: 6e3923d0a4f4720d2d9f628eb9c073d2d3ee291a
2021-08-10 12:03:21 -04:00
Abu Kashem ffb869e08f apiserver: add a new mode for graceful termination
add a new mode for graceful termination with the new server run option
'shutdown-send-retry-after'
- shutdown-send-retry-after=true: we initiate shutdown of the
  HTTP Server when all in-flight request(s) have been drained. during
  this window all incoming requests are rejected with status code
  429 and the following response headers:
    - 'Retry-After: N' - client should retry after N seconds
    - 'Connection: close' - tear down the TCP connection
- shutdown-send-retry-after=false: we initiate shutdown of the
  HTTP Server as soon as shutdown-delay-duration has elapsed. This
  is in keeping with the current behavior.

Kubernetes-commit: 3182b69e970bd1fd036ff839fdf811f14e790244
2021-07-14 10:39:29 -04:00
Abu Kashem feb4eefe1c apiserver: add callback to get notified of object count
Kubernetes-commit: 2c60feffbee690af4632d068158e640abe10f678
2021-07-14 16:44:34 -04:00
Alexi Kessler 80b28d7c2c Update doc description for --audit-log-maxbackup
Per https://pkg.go.dev/gopkg.in/natefinch/lumberjack.v1 a value of 0 will retain all logs. Not understanding this led to an outage for my team.

Kubernetes-commit: 94977dce8d13ec1e8b4bd8b449f555af685c3ab6
2021-07-22 09:42:30 -04:00
Andrew Rynhard bfbd0aaa7d Do not try to create an audit log file named "-"
That PR fixes --audit-log-path=- support.
It now logs to stdout as in 1.21.

Kubernetes-commit: 7728428f017350d5fb9a91e6e5dc3ccf86348478
2021-07-23 14:26:28 +00:00
Ryan Phillips 7afffd8ef3 Revert "apiserver: add callback to get notified of object count"
Kubernetes-commit: d95b14e1abfb5ec87248e5dd826b89d0c738af42
2021-07-08 13:56:39 -05:00
David Ashpole fe620be9c7 change tracing service from kube-apiserver to apiserver
Kubernetes-commit: 8972efc65fe7f4d2ed840ba1a2bd8ff31e829a7a
2021-07-02 07:04:26 -07:00
Abu Kashem d929410e13 apiserver: add callback to get notified of object count
Kubernetes-commit: 1002b0d163dd948334f10b0e25d0e91d253791e8
2021-06-18 10:44:07 -04:00
David Ashpole 71612b014d move tracing instantiation further up, and check for nil
Kubernetes-commit: b0ffaa93f5c607325203f978c1ae685d6b64d053
2021-07-01 10:42:11 -07:00
David Ashpole 5053bddd06 add tracing to the apiserver's client-go requests
Kubernetes-commit: 79d400c4416f903af604fb2cf07d2c34bb4b98f7
2021-06-26 09:16:32 -07:00
Lukasz Szaszkiewicz 9ff2637133 adds metrics for authorization webhook
Kubernetes-commit: 4a2aef00d6dd2543b011aa7e5af28df598a0cd72
2021-03-17 16:30:40 +01:00
Lukasz Szaszkiewicz 69433684ce adds metrics for authentication webhook
Kubernetes-commit: 322c18c147da08dd2eea25ba3c2b9630a228cf5f
2021-02-23 08:39:25 +01:00
David Ashpole 5927da0040 Add distributed tracing to the apiserver using OpenTelemetry
Kubernetes-commit: 79550ed40c67a70534c1cb697e1fb7e7dbf96335
2021-06-25 05:20:16 -07:00
Mike Spreitzer feae5f3e79 Add config checking for inflight limits
When API Priority and Fairness is enabled, the inflight limits must
add up to something positive.
This rejects the configuration that prompted
https://github.com/kubernetes/kubernetes/issues/102885

Update help for max inflight flags

Kubernetes-commit: 0762f492c5b850471723a305cfa7390e44851145
2021-06-21 16:53:07 -04:00
Jordan Liggitt 84ac736f8e Fix audit unit test file location
Kubernetes-commit: 91e5d98b572a74bf827a575559238cc0a4be6c57
2021-06-04 17:23:34 -04:00
Chao Xu 218926b065 Switch the order of adding SNICert and creating LoopbackClientConfig
Kubernetes-commit: 1df4503b859a2b7b2b7f9c5bcf400f61cc29d349
2021-04-22 23:17:39 +00:00
Juan Antonio Osorio Robles 332add01ef Ensure audit log permissions are restricted
While the apiserver audit options merely use the lumberjack logger in
order to write the appropriate log files, this library has very loose
permissions by default for these files [1]. However, this library will
respect the permissions that the file has, if it exists already. This is
also the most tested scenario in the library [2].

So, let's follow the pattern marked in the library's tests and
pre-create the audit log file with an appropriate mode.

[1] https://github.com/natefinch/lumberjack/blob/v2.0/lumberjack.go#L280
[2] https://github.com/natefinch/lumberjack/blob/v2.0/linux_test.go

Signed-off-by: Juan Antonio Osorio Robles <jaosorior@redhat.com>

Kubernetes-commit: 42df7bc5b3aa26bf545b6392b557833c7162c472
2020-10-08 09:38:57 +03:00
Mike Danese a6a121887a force implementors of dyanmiccertificates providers to think about notify
Right now, `_, ok := provider.(Notifier); !ok` can mean one of two
things:

1. The provider does not support notification because the provided
   content is static.
2. The implementor of the provider hasn't gotten around to implementing
   Notifier yet.

These have very different implications. We should not force consumers of
these interfaces to have to figure out the static of Notifier across
sometimes numerous different implementations. Instead, we should force
implementors to implement Notifier, even if it's a noop.

Change-Id: Ie7a26697a9a17790bfaa58d67045663bcc71e3cb

Kubernetes-commit: 9b7d654a08d694d20226609f7075b112fb18639b
2021-04-09 16:59:17 -07:00
Lukasz Szaszkiewicz 49d90ce0ad DelegatingAuthenticationOptions TokenReview request timeout
it turns out that setting a timeout on HTTP client affect watch requests made by the delegated authentication component.
with a 10 second timeout watch requests are being re-established exactly after 10 seconds even though the default request timeout for them is ~5 minutes.

this is because if multiple timeouts were set, the stdlib picks the smaller timeout to be applied, leaving other useless.
for more details see a937729c2c/src/net/http/client.go (L364)

instead of setting a timeout on the HTTP client we should use context for cancellation.

Kubernetes-commit: d690d71d27c78f2f7981b286f5b584455ff30246
2021-04-09 13:20:51 +02:00
Lukasz Szaszkiewicz b5be45a80f DelegatingAuthOptions: allows for specifying a middleware function for custom HTTP behaviour for the auth webhook client
Kubernetes-commit: ea7d94497b5fef2fe7b925d378f425b94448f01b
2021-03-04 12:35:09 +01:00
xiongzhongliang fbe8ccc9bd Optimize some codes
Kubernetes-commit: 4a24a08f936a295bf332b9567bea182e2feff554
2021-02-28 01:00:09 +08:00
Monis Khan 63ca1f6039 delegated authn: allow client CA override based on non-empty opts
Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: 6686d8b846546f682d1a449cc9cd0e3c0de977b4
2021-03-09 22:53:04 -05:00
carlory 146083d06b deprecate audit.k8s.io/v1[alpha|beta]1 versions
Kubernetes-commit: cad9c245b84fd16cbb5bf240622af07ce7bc3585
2021-02-08 11:22:29 +08:00
yue9944882 d3f04fd7c9 support storage encryption for aa server
Kubernetes-commit: dcf4821cd4c798aa08e6b31c5474717c7164945a
2021-02-18 19:10:50 +08:00
Maurizio Drocco 353b45e333 Update etcd.go
Kubernetes-commit: f6ac24bfd86d9dfce6a8ff0d611b4fdabc7bc504
2020-04-13 13:29:18 -04:00