This change updates KMS v2 to not create a new DEK for every encryption. Instead, we re-use the DEK while the key ID is stable. Specifically: We no longer use a random 12 byte nonce per encryption. Instead, we use both a random 4 byte nonce and an 8 byte nonce set via an atomic counter. Since each DEK is randomly generated and never re-used, the combination of DEK and counter are always unique. Thus there can never be a nonce collision. AES GCM strongly encourages the use of a 12 byte nonce, hence the additional 4 byte random nonce. We could leave those 4 bytes set to all zeros, but there is no harm in setting them to random data (it may help in some edge cases such as live VM migration). If the plugin is not healthy, the last DEK will be used for encryption for up to three minutes (there is no difference on the behavior of reads which have always used the DEK cache). This will reduce the impact of a short plugin outage while making it easy to perform storage migration after a key ID change (i.e. simply wait ten minutes after the key ID change before starting the migration). The DEK rotation cycle is performed in sync with the KMS v2 status poll thus we always have the correct information to determine if a read is stale in regards to storage migration. Signed-off-by: Monis Khan <mok@microsoft.com> Kubernetes-commit: 832d6f0e19f13b9dd22b1fe9d705817e9e64f4f1 |
||
|---|---|---|
| .github | ||
| pkg | ||
| plugin/pkg | ||
| .import-restrictions | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| OWNERS | ||
| README.md | ||
| SECURITY_CONTACTS | ||
| code-of-conduct.md | ||
| doc.go | ||
| go.mod | ||
| go.sum | ||
README.md
apiserver
Generic library for building a Kubernetes aggregated API server.
Purpose
This library contains code to create Kubernetes aggregation server complete with delegated authentication and authorization,
kubectl compatible discovery information, optional admission chain, and versioned types. It's first consumers are
k8s.io/kubernetes, k8s.io/kube-aggregator, and github.com/kubernetes-incubator/service-catalog.
Compatibility
There are NO compatibility guarantees for this repository, yet. It is in direct support of Kubernetes, so branches will track Kubernetes and be compatible with that repo. As we more cleanly separate the layers, we will review the compatibility guarantee. We have a goal to make this easier to use in the future.
Where does it come from?
apiserver is synced from https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apiserver.
Code changes are made in that location, merged into k8s.io/kubernetes and later synced here.
Things you should NOT do
- Directly modify any files under
pkgin this repo. Those are driven fromk8s.io/kubernetes/staging/src/k8s.io/apiserver. - Expect compatibility. This repo is changing quickly in direct support of Kubernetes and the API isn't yet stable enough for API guarantees.