kubernetes/hack
Kubernetes Submit Queue f893cddfba Merge pull request #46460 from sakshamsharma/location_transformer
Automatic merge from submit-queue (batch tested with PRs 46550, 46663, 46816, 46820, 46460)

Add configuration for encryption providers

## Additions

Allows providing a configuration file (using flag `--experimental-encryption-provider-config`) to use the existing AEAD transformer (with multiple keys) by composing mutable transformer, prefix transformer (for parsing providerId), another prefix transformer (for parsing keyId), and AES-GCM transformers (one for each key). Multiple providers can be configured using the configuration file.

Example configuration:
```
kind: EncryptionConfig
apiVersion: v1
resources:
  - resources:
    - namespaces
    providers:
    - aes:
        keys:
        - name: key1
          secret: c2vjcmv0iglzihnly3vyzq==
        - name: key2
          secret: dghpcybpcybwyxnzd29yza==
    - identity: {}
```

Need for configuration discussed in:
#41939
[Encryption](3418b4e4c6/contributors/design-proposals/encryption.md)

**Pathway of a read/write request**:
1. MutableTransformer
2. PrefixTransformer reads the provider-id, and passes the request further if that matches.
3. PrefixTransformer reads the key-id, and passes the request further if that matches.
4. GCMTransformer tries decrypting and authenticating the cipher text in case of reads. Similarly for writes.

## Caveats
1. To keep the command line parameter parsing independent of the individual transformer's configuration, we need to convert the configuration to an `interface{}` and manually parse it in the transformer. Suggestions on better ways to do this are welcome.

2. Flags `--encryption-provider` and `--encrypt-resource` (both mentioned in [this document](3418b4e4c6/contributors/design-proposals/encryption.md) ) are not supported in this because they do not allow more than one provider, and the current format for the configuration file possibly supersedes their functionality.

3. Currently, it can be tested by adding `--experimental-encryption-provider-config=config.yml` to `hack/local-up-cluster.sh` on line 511, and placing the above configuration in `config.yml` in the root project directory.

Previous discussion on these changes:
https://github.com/sakshamsharma/kubernetes/pull/1

@jcbsmpsn @destijl @smarterclayton

## TODO
1. Investigate if we need to store keys on disk (per [encryption.md](3418b4e4c6/contributors/design-proposals/encryption.md (option-1-simple-list-of-keys-on-disk)))
2. Look at [alpha flag conventions](https://github.com/kubernetes/kubernetes/blob/master/pkg/features/kube_features.go)
3. Need to reserve `k8s:enc` prefix formally for encrypted data. Else find a better way to detect transformed data.
2017-06-05 16:43:48 -07:00
..
boilerplate Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
cmd/teststale
e2e-internal Split federation-{up,down} from e2e-{up,down}. 2017-02-24 14:27:31 -08:00
gen-swagger-doc update url information to prevent http 304 redirection 2017-05-25 14:05:02 +08:00
jenkins Export patch files to artifacts 2017-03-25 12:16:50 -07:00
lib Merge pull request #46388 from lavalamp/whitlockjc-generic-webhook-admission 2017-06-02 23:37:42 -07:00
make-rules Implement kubectl rollout history and undo for DaemonSet 2017-06-03 17:10:57 -07:00
testdata Implement kubectl rollout history and undo for DaemonSet 2017-06-03 17:10:57 -07:00
verify-flags Merge pull request #45919 from ericchiang/audit-webhook-backend 2017-06-01 13:41:59 -07:00
.linted_packages Merge pull request #46460 from sakshamsharma/location_transformer 2017-06-05 16:43:48 -07:00
autogenerated_placeholder.txt
benchmark-go.sh unify newline format for benchmark-go.sh 2016-12-10 01:15:30 -08:00
BUILD Add verify-gofmt as a Bazel test. 2017-02-10 17:00:28 -08:00
build-cross.sh
build-go.sh
build-ui.sh move swagger route to apiserver 2017-02-01 15:18:32 -05:00
cherry_pick_pull.sh hack/cherry_pick_pull.sh: cleanup patch files 2016-12-14 14:33:17 -08:00
dev-build-and-push.sh hack/dev-build-*: Run dev build instead of release build 2016-12-15 10:35:16 -07:00
dev-build-and-up.sh hack/dev-build-*: Run dev build instead of release build 2016-12-15 10:35:16 -07:00
dev-push-hyperkube.sh Rename build-tools/ back to build/ 2016-12-14 13:42:15 -08:00
e2e_test.go hack/e2e_test.go's tester shouldn't stat files from the future 2017-02-15 15:59:47 -08:00
e2e-node-test.sh
e2e.go return nil when err is nil 2017-05-27 14:34:45 +08:00
federated-ginkgo-e2e.sh Default FEDERATION_KUBE_CONTEXT to FEDERATION_NAME in federation e2e up/down scripts. 2017-04-05 18:47:03 -07:00
generate-bindata.sh Adding an installer script that installs Nvidia drivers in Container Optimized OS 2017-05-20 21:17:19 -07:00
generate-docs.sh Move .generated_docs to docs/ so docs OWNERS can review / approve 2017-02-16 10:11:57 -08:00
get-build.sh
ginkgo-e2e.sh e2e test: test azure disk volume 2017-04-28 18:51:34 +00:00
godep-restore.sh hack/godep-restore.sh: use godep v79 which works 2017-03-12 18:43:10 +01:00
godep-save.sh wire new staging repo 2017-05-02 08:43:31 -04:00
grab-profiles.sh Make all useage of sort deterministic 2016-10-20 16:47:20 -04:00
install-etcd.sh
list-feature-tests.sh Make all useage of sort deterministic 2016-10-20 16:47:20 -04:00
local-up-cluster.sh Add Initializers to all admission control paths by default 2017-06-02 22:09:04 -04:00
lookup_pull.py update url information to prevent http 304 redirection 2017-05-25 14:05:02 +08:00
OWNERS Merge pull request #45996 from cblecker/hack-owner 2017-05-19 16:06:27 -07:00
print-workspace-status.sh Use munged semantic version for side-loaded docker tag 2017-04-27 15:05:40 -07:00
run-in-gopath.sh
test-cmd.sh
test-go.sh
test-integration.sh hack/test-integration.sh: provide a recommended command and exit 2017-02-17 08:44:49 -08:00
test-update-storage-objects.sh Support storageclass storage upgrades to v1 2017-05-24 10:43:56 -04:00
update_owners.py Make update_owners.py also emit a JSON sig-owners list. 2017-05-11 17:01:29 -07:00
update-all.sh Add update-federation-* scripts to update-all.sh 2017-05-15 16:51:09 -07:00
update-api-reference-docs.sh update generation bash to handle vendor dir 2017-01-17 09:06:34 -05:00
update-bazel.sh Update gazel to v17 2017-04-27 15:01:34 -07:00
update-codecgen.sh Add internal audit API types 2017-05-18 10:30:21 -07:00
update-codegen.sh Enable client-gen for k8s.io/metrics 2017-05-10 13:33:18 -04:00
update-federation-api-reference-docs.sh update generation bash to handle vendor dir 2017-01-17 09:06:34 -05:00
update-federation-generated-swagger-docs.sh update generation bash to handle vendor dir 2017-01-17 09:06:34 -05:00
update-federation-openapi-spec.sh Fix hack/update-federation-openapi-spec.sh flakyness 2017-05-19 15:39:08 -07:00
update-federation-swagger-spec.sh Federation does not generate swagger spec correctly 2017-01-06 23:45:04 -05:00
update-generated-docs.sh Move .generated_docs to docs/ so docs OWNERS can review / approve 2017-02-16 10:11:57 -08:00
update-generated-protobuf-dockerized.sh spell check for test/* 2016-12-14 06:03:00 -08:00
update-generated-protobuf.sh Rename build-tools/ back to build/ 2016-12-14 13:42:15 -08:00
update-generated-runtime-dockerized.sh Reorganize kubelet tree so apis can be independently versioned 2017-05-12 10:02:33 -07:00
update-generated-runtime.sh Rename build-tools/ back to build/ 2016-12-14 13:42:15 -08:00
update-generated-swagger-docs.sh Add priority and condition to column definitions 2017-05-29 18:23:48 -04:00
update-godep-licenses.sh make godep licenses/copyright check case insensitive 2016-10-24 18:00:08 -07:00
update-gofmt.sh hack/*.sh: re-add staging dirs to verify+update scripts 2017-02-17 08:51:31 +01:00
update-openapi-spec.sh Fix race in service IP allocation repair loop 2016-12-26 21:59:27 -08:00
update-staging-client-go.sh Use "hack/godep-restore.sh" instead of godep restore 2017-03-28 04:05:47 -04:00
update-staging-godeps.sh move metrics to staging 2017-05-01 16:43:50 -07:00
update-swagger-spec.sh hack/update-swagger-spec.sh: use posix regex syntax 2017-05-31 11:57:03 +02:00
update-translations.sh Extract a bunch more strings from kubectl 2017-04-06 20:12:50 -07:00
verify-all.sh
verify-api-groups.sh add "admission" API group 2017-05-19 10:17:37 -06:00
verify-api-reference-docs.sh
verify-bazel.sh Update gazel to v17 2017-04-27 15:01:34 -07:00
verify-boilerplate.sh Add a build rule for the boilerplate unit test. 2017-01-01 22:54:32 -08:00
verify-cli-conventions.sh More cli sanity verifications 2017-05-18 15:44:49 -03:00
verify-codecgen.sh add apiregistration types 2016-12-06 13:45:10 -05:00
verify-codegen.sh Merge pull request #45184 from DirectXMan12/feature/metrics-client-gen-tweaks 2017-06-02 18:05:50 -07:00
verify-description.sh
verify-federation-api-reference-docs.sh Adding verify-federation-api-reference-docs.sh 2017-05-14 17:20:24 -07:00
verify-federation-generated-swagger-docs.sh Adding verify-federation-generated-swagger-docs.sh 2017-05-14 17:20:24 -07:00
verify-federation-openapi-spec.sh Add verify script federation OpenAPI spec generation 2016-11-07 02:41:50 -08:00
verify-federation-swagger-spec.sh Adding verify-federation-swagger-spec.sh 2017-05-14 17:15:41 -07:00
verify-flags-underscore.py check flag format in file known-flags.txt 2017-05-22 10:51:04 +08:00
verify-generated-docs.sh Move .generated_docs to docs/ so docs OWNERS can review / approve 2017-02-16 10:11:57 -08:00
verify-generated-protobuf.sh [go-to-protobuf] generate proto for k8s.io/metrics 2017-05-26 19:59:27 -04:00
verify-generated-runtime.sh Reorganize kubelet tree so apis can be independently versioned 2017-05-12 10:02:33 -07:00
verify-generated-swagger-docs.sh docs generation: Use macos compatible copy method 2016-10-18 11:11:03 +02:00
verify-godep-licenses.sh
verify-godeps.sh Export patch files to artifacts 2017-03-25 12:16:50 -07:00
verify-gofmt.sh hack/*.sh: re-add staging dirs to verify+update scripts 2017-02-17 08:51:31 +01:00
verify-golint.sh hack/verify-golint: enforce cleanup of old packages 2017-01-24 08:34:06 +01:00
verify-govet.sh
verify-import-boss.sh
verify-linkcheck.sh
verify-no-vendor-cycles.sh remove excpetion in verify-no-vendor-cycles.sh 2017-05-15 20:17:38 -07:00
verify-openapi-spec.sh verify-openapi-spec.sh should not ignore extra file in the spec folder api/openapi-spec 2016-11-01 01:13:11 -07:00
verify-pkg-names.sh add "admission" API group 2017-05-19 10:17:37 -06:00
verify-readonly-packages.sh hack/*.sh: re-add staging dirs to verify+update scripts 2017-02-17 08:51:31 +01:00
verify-staging-client-go.sh hack/verify-staging-client-go.sh: fail on changes 2017-02-27 14:11:41 +01:00
verify-staging-godeps.sh update-staging-{client-go,godeps}.sh: no godep-restore, pin godep, check workdir 2017-02-25 22:38:23 +01:00
verify-staging-imports.sh hack/verify-staging-imports.sh: simplify by negating package list 2017-06-01 14:49:13 +02:00
verify-swagger-spec.sh
verify-symbols.sh spell check for test/* 2016-12-14 06:03:00 -08:00
verify-test-images.sh Make all useage of sort deterministic 2016-10-20 16:47:20 -04:00
verify-test-owners.sh Disable verify-test-owners.sh and make go vet more obvious 2016-12-21 11:44:04 -08:00