Skip to Content
Certified Kubernetes Application Developer (CKAD) Study Guide, 2nd Edition
book

Certified Kubernetes Application Developer (CKAD) Study Guide, 2nd Edition

by Benjamin Muschko
May 2024
Intermediate to advanced
366 pages
7h 43m
English
O'Reilly Media, Inc.
Content preview from Certified Kubernetes Application Developer (CKAD) Study Guide, 2nd Edition

Chapter 20. Security Contexts

Running a Pod in Kubernetes without implementing more restrictive security measures can pose a security risk. Without these measures, an attacker can potentially gain access to the host system or perform malicious activities, such as accessing files containing sensitive data. A security context defines privilege and access control settings for containers as part of a Pod specification. The following list provides some examples for security-related parameters:

  • The user ID that should be used to run the Pod and/or container

  • The group ID that should be used for filesystem access

  • Granting a running process inside the container some privileges of the root user but not all of them

This chapter will give you an overview of defining security contexts and seeing their runtime effects in practice. Given the wide range of security settings, we won’t be able to discuss all of them. You will find additional use cases and configuration options in the Kubernetes documentation.

Working with Security Contexts

The security context is not a Kubernetes primitive. It is modeled as a set of attributes under the directive securityContext within the Pod specification. Security settings defined on the Pod level apply to all containers running in the Pod. When applied to a single container, it will have no effects on other containers running ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Certified Kubernetes Application Developer (CKAD) Study Guide

Certified Kubernetes Application Developer (CKAD) Study Guide

Benjamin Muschko

Publisher Resources

ISBN: 9781098152857Errata PageSupplemental Content