# When you encrypt a Kubernetes Secret with SOPS for Flux, which fields should you encrypt?

Flux CD, Easy (Beginner), Security. https://k8wiz.com/uquiz/when-you-encrypt-a-kubernetes-secret-with-sops-for-flux-which-fields-should-you-encrypt

- A. The whole file, including apiVersion and kind
- B. Only metadata.name and metadata.namespace
- C. Only the data and stringData fields
- D. Only the sops block that SOPS adds at the end

**Answer:** Only the data and stringData fields

**Explanation:** kustomize-controller needs apiVersion, kind and metadata in plain text, and encrypting them is not supported. The usual way is encrypted_regex: ^(data|stringData)$ in .sops.yaml, or the --encrypted-regex flag on sops encrypt.
