A security audit reveals that default service account tokens are being automatically mounted in all Pods, posing a credential exposure risk. How can you configure a Pod spec to prevent the automatic mounting of the default ServiceAccount token?

Direct Answer (Verified)Reviewed by Sunny (Senior Cloud Engineer)

Correct Answer: Set automountServiceAccountToken: false in the Pod spec or ServiceAccount spec

By default, Kubernetes automatically mounts a ServiceAccount token inside containers at /var/run/secrets/kubernetes.io/serviceaccount. To disable this behavior for security hardeni...

Real Exam ScenarioKubernetes Core

A security audit reveals that default service account tokens are being automatically mounted in all Pods, posing a credential exposure risk. How can you configure a Pod spec to prevent the automatic mounting of the default ServiceAccount token?

✓ Correct Answer & ExplanationKubernetes Core

Correct Answer

Set automountServiceAccountToken: false in the Pod spec or ServiceAccount spec

Why This Answer Is Correct

By default, Kubernetes automatically mounts a ServiceAccount token inside containers at /var/run/secrets/kubernetes.io/serviceaccount. To disable this behavior for security hardening, you can set automountServiceAccountToken: false in either the Pod or ServiceAccount configuration.

📚 What This Question Tests

This question evaluates your knowledge of Kubernetes Core — a core concept tested in cloud certification exams. Understanding Kubernetes Core is essential for designing scalable, secure, and cost-effective cloud architectures. Mastery of this topic will help you answer scenario-based questions confidently on exam day.