Skip to content

Add API-level Secret verification to the Part 12 encryption smoke test #940

Description

@JNasri

While completing the Data Encryption section in docs/12-smoke-test.md, I successfully verified that the raw value stored in etcd begins with k8s:enc:aescbc:v1:key1.

It would also be helpful to verify that the API server can retrieve and decode the encrypted-at-rest Secret correctly.

I suggest adding this command after the etcd hexdump check:

kubectl get secret kubernetes-the-hard-way -o yaml

Example output:

apiVersion: v1
data:
  mykey: bXlkYXRh
kind: Secret
metadata:
  name: kubernetes-the-hard-way
  namespace: default
type: Opaque

The output should contain mykey: bXlkYXRh, which is the value mydata encoded using Base64.

Optionally, the original value can also be verified with:

kubectl get secret kubernetes-the-hard-way \
  -o jsonpath='{.data.mykey}' | base64 --decode
echo

Expected output:

mydata

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions