Kubernetes Secrets Management: Best Practices
Assess your understanding of best practices for managing secrets in Kubernetes environments.
Questions in this quiz
12 questions on Kubernetes Secrets Management: Best Practices. Work through them here, then start the quiz to answer them and see your score.
1.What is the primary advantage of using Kubernetes Secrets over ConfigMaps for sensitive data?
- ASecrets are encrypted at rest and in transit.
- BSecrets can be shared across namespaces.
- CSecrets automatically rotate keys every 24 hours.
- DSecrets are stored in plain text for easy access.
2.Which command is used to create a secret from a literal value in Kubernetes?
- Akubectl set secret
- Bkubectl create secret generic
- Ckubectl create secret literal
- Dkubectl apply secret
3.How can you ensure that a Kubernetes Secret is only accessible by a specific pod?
- AUse RBAC to restrict access.
- BMount the secret as a volume only in the specific pod.
- CStore the secret in a ConfigMap.
- DEncrypt the secret with a pod-specific key.
4.Which of the following is a best practice for managing Kubernetes Secrets?
- AUse external secret management tools like HashiCorp Vault.
- BUse a version control system to manage secrets.
- CHard-code secrets in application code.
- DStore secrets in environment variables.
5.What is the default storage backend for Kubernetes Secrets?
- ARedis
- BPostgreSQL
- CMySQL
- Detcd
6.Why is it important to enable encryption at rest for etcd in Kubernetes?
- ATo enable faster data retrieval.
- BTo secure sensitive data like secrets.
- CTo reduce storage costs.
- DTo improve performance.
7.What is a potential risk of using Kubernetes Secrets without additional security measures?
- ASecrets are automatically rotated.
- BSecrets can be accessed by any pod in the cluster.
- CSecrets cannot be deleted once created.
- DSecrets are stored in a non-encrypted format.
8.Which Kubernetes feature can be used to control access to secrets at a granular level?
- AService Accounts
- BRole-Based Access Control (RBAC)
- CNetwork Policies
- DPod Security Policies
9.How can you update a Kubernetes Secret without downtime?
- ADirectly edit the etcd database.
- BRestart all pods using the secret.
- CUse 'kubectl apply' with the updated secret definition.
- DDelete the secret and recreate it.
10.What is the purpose of the 'immutable' field in a Kubernetes Secret?
- ATo prevent accidental deletion.
- BTo automatically encrypt the secret.
- CTo allow sharing across namespaces.
- DTo prevent updates to the secret once created.
11.Which of the following is NOT a recommended practice for Kubernetes Secrets management?
- AUse namespaces to isolate secrets.
- BStore secrets in plaintext in the source code.
- CAudit access to secrets regularly.
- DRegularly rotate secrets.
12.What is the benefit of using Kubernetes Secrets with environment variables?
- AEnvironment variables provide a simple way to inject secrets into applications.
- BEnvironment variables are automatically encrypted.
- CSecrets are easier to rotate.
- DSecrets are automatically logged for auditing.