Courseiva
hardMultiple Choice

CKS Practice Question: Encrypt Kubernetes secrets at rest using aescbc

You need to encrypt Kubernetes secrets at rest using aescbc. Which YAML snippet defines the EncryptionConfiguration correctly?

⚠ Common exam trap

CNCF often tests the requirement that the aescbc provider's secret must be base64-encoded (not plain text) and that the correct apiVersion/kind must be used, leading candidates to pick options with plain-text keys or wrong resource types.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

apiVersion: apiserver.config.k8s.io/v1 kind: EncryptionConfiguration resources: - resources: - secrets providers: - aescbc: keys: - name: key1 secret: MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY= - identity: {} [CORRECT]

It defines an EncryptionConfiguration with the correct apiVersion (apiserver.config.k8s.io/v1), kind (EncryptionConfiguration), and a valid provider list. It uses the aescbc provider with a base64-encoded 32-byte key (MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY=) for encrypting secrets, and includes the identity provider as a fallback to allow reading existing unencrypted data. This configuration ensures that secrets are encrypted at rest using AES-CBC with a properly encoded 32-byte key.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    apiVersion: apiserver.config.k8s.io/v1 kind: EncryptionConfiguration resources: - resources: - secrets providers: - aescbc: keys: - name: key1 secret: MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY= - identity: {} [CORRECT]

    Why this is correct

    This is correct because it uses the proper apiVersion `apiserver.config.k8s.io/v1` and kind `EncryptionConfiguration`, which matches what kube-apiserver expects. The `aescbc` provider is specified as required, and the key `c2VjcmV0LWtleS0zMi1ieXRlcw==` is a valid base64-encoded string that decodes to a 32-byte key, which is the required length for AES-256-CBC. Including `identity: {}` as the last provider is essential because it allows the API server to read existing unencrypted secrets during the migration process, avoiding data lockout, and it also serves as a fallback if decryption fails.

  • ✗

    apiVersion: apiserver.config.k8s.io/v1 kind: EncryptionConfiguration resources: - resources: - secrets providers: - aescbc: keys: - name: key1 secret: my-plain-text-key

    Why it's wrong here

    The `secret` field must contain a base64-encoded key, not a plain-text key. Kubernetes decodes the base64 string to obtain the raw key bytes for encryption; a value like `my-plain-text-key` is not valid base64 and will cause the API server to fail when parsing the configuration or when attempting to encrypt/decrypt secrets. Additionally, the plain-text string may not decode to the required 32-byte key length, further breaking AES-CBC encryption. To fix it, one must base64-encode a 32-byte random key (e.g., `c2VjcmV0LWtleS0zMi1ieXRlcw==`) and place that in the `secret` field.

  • ✗

    apiVersion: v1 kind: EncryptionConfig resources: - resources: - secrets providers: - aescbc: keys: - name: key1 secret: c2VjcmV0LWtleS0zMi1ieXRlcw==

    Why it's wrong here

    It uses the wrong `apiVersion` and `kind`. The correct API group is `apiserver.config.k8s.io/v1` and the kind must be `EncryptionConfiguration`, not the generic `v1` with `EncryptionConfig`. The kube-apiserver will reject an unrecognized configuration type, so this file would never be loaded, and secrets encryption would not be enabled. Furthermore, it lacks the `identity: {}` provider, which is recommended as a fallback to allow the API server to read existing unencrypted secrets during rollout; without it, upgrading an existing cluster would leave unencrypted secrets unreadable.

  • ✗

    apiVersion: apiserver.config.k8s.io/v1 kind: EncryptionConfiguration resources: - resources: - secrets providers: - secretbox: keys: - name: key1 secret: c2VjcmV0LWtleS0zMi1ieXRlcw==

    Why it's wrong here

    It specifies the `secretbox` provider instead of the `aescbc` provider that was explicitly required. While `secretbox` is a valid encryption provider using the modern ChaCha20-Poly1305/NACL secretbox construction, it is not what the task requested, so the configuration would not meet the requirement. Additionally, `secretbox` expects a nonce and key handling that differs from `aescbc`; the key format and length requirements are different. Since the task specifically says "using aescbc," the provider must be `aescbc`; using `secretbox` would fail the objective even though it might be syntactically valid.

Quick reference

Symmetric Encryption Algorithm Comparison

AlgorithmKey SizeBlock SizeStatusNotes
AES-128128-bit128-bitCurrent standardNIST approved; WPA3, TLS
AES-256256-bit128-bitCurrent standardPreferred for sensitive / govt data
3DES112-bit effective64-bitDeprecated (2023)Replaced by AES
DES56-bit64-bitBrokenCracked in < 24 h; never deploy
ChaCha20256-bitStream cipherCurrentTLS 1.3, WireGuard

About these practice questions

This CKS question is part of Courseiva's 845-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CKS practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKS exam.