Share E-Book
Scan to open this page

Scan with your phone to open this page

AuthorJosé Manuel Ortega Candel

Building and securely deploying container-based applications with Docker and Kubernetes using open source tools. KEY FEATURES ● Real-world examples of vulnerability analysis in Docker containers. ● Includes recommended practices for Kubernetes and Docker with real execution of commands. ● Includes essential monitoring tools for Docker containers and Kubernetes configuration. DESCRIPTION This book discusses many strategies that can be used by developers to improve their DevSecOps and container security skills. It is intended for those who are active in software development. After reading this book, readers will discover how Docker and Kubernetes work from a security perspective. The book begins with a discussion of the DevSecOps tools ecosystem, the primary container platforms and orchestration tools that you can use to manage the lifespan and security of your apps. Among other things, this book discusses best practices for constructing Docker images, discovering vulnerabilities, and better security. The book addresses how to examine container secrets and networking. Backed with examples, the book demonstrates how to manage and monitor container-based systems, including monitoring and administration in Docker. In the final section, the book explains

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
# Implementing DevSecOps with Docker and Kubernetes — Reading Guide ## 【One-Line Pitch】 A practical, command-driven handbook for developers who want to embed security into every stage of the container lifecycle—from building Docker images to orchestrating Kubernetes clusters—using open source tools and real-world vulnerability analysis. ## 【Book Arc】 - **Opening (~0%–9%)**: Introduces DevSecOps as a cultural and methodological shift from traditional DevOps, covering CI/CD pipelines, security testing types (SAST/DAST), and the open source tool ecosystem that supports decentralized security ownership. - **Early (~9%–26%)**: Surveys container platforms and orchestration tools (Docker, Podman, Kubernetes, Nomad), then dives into Docker image construction—layers, Dockerfile instructions, image inspection, and the security implications of image size and base image choices. - **Early-to-Middle (~26%–43%)**: Focuses on hardening containers at the host and runtime level—Linux capabilities, SELinux, AppArmor, seccomp, privileged mode risks—and introduces private registries, Notary for image signing, and registry alternatives like Quay and Harbor. - **Middle (~43%–52%)**: Moves into vulnerability analysis and threat modeling—CVSS metrics, CVE databases, scanning tools (Anchore, Deepfence), and real-world Docker vulnerabilities with patching timelines and detection scripts. - **Late (~52%–end)**: Covers secrets management, container networking security, monitoring, and administration practices for Docker and Kubernetes, closing with operational guidance for running secure container-based systems in production. ## 【Key Takeaways】 - **DevSecOps is a cultural shift, not just a toolchain** (Early): Security must be decentralized into every developer's workflow rather than gated by a separate security team—the book cites GitLab survey data showing 45% of developers still find security tests happen too late in the lifecycle. - **Image size is a security surface** (Early): Distroless images (e.g., Python at ~50MB vs. 885MB official) strip out package managers and unnecessary binaries, reducing attack surface and supply chain risk—a concrete trade-off between debuggability and security. - **Dockerfile hygiene reduces layer bloat** (Early): Combining multiple RUN instructions into a single layer (e.g., `RUN apt-get update && apt-get install vim`) is a recommended practice that minimizes image layers and simplifies vulnerability tracking. - **Root inside a container is not host root—but privileged mode changes that** (Middle): Docker containers run with limited Linux capabilities by default, but `--privileged=true` grants excessive kernel access; the book demonstrates how this allows MAC address changes and hardware access, advising capability-specific grants instead. - **Linux security modules are complementary, not optional** (Middle): AppArmor, SELinux, and seccomp each regulate different aspects—filesystem permissions, kernel access controls, and system calls—and should be layered for defense in depth. - **Vulnerability scoring is multi-dimensional** (Middle): CVSS metrics like access complexity, authentication requirements, confidentiality, and integrity impact determine severity; understanding these helps prioritize which container vulnerabilities to fix first. - **Image signing and private registries prevent tampering** (Middle): Notary enables content verification, while private registries like Quay and Harbor give teams control over image distribution—critical for production trust chains. - **Real CVEs illustrate concrete attack patterns** (Middle): The book dissects CVE-2018-8115 (Docker for Windows RCE via path validation) and older Docker daemon issues, showing how layer inspection scripts can detect vulnerable images before deployment. ## 【Reading Tips】 - **Skim the tool surveys** (Chapters 1–2): The CI/CD and container platform comparisons (Codeship, TeamCity, Nomad, etc.) are useful reference material but not the core value—read for awareness, not mastery. - **Deep-read the Dockerfile and image sections** (Early): The layer model, `docker inspect` JSON output, and distroless comparisons are foundational; practice these commands yourself to internalize the concepts. - **Pay special attention to the capability and privileged-mode discussion** (Middle): This is where the book earns its keep—the MAC address manipulation example vividly shows why `--privileged=true` is dangerous and why granular capabilities are preferred. - **Use the vulnerability chapters as a playbook** (Middle): The Anchore and Deepfence command examples are copy-paste ready; run them against your own images to build a baseline vulnerability database. - **Don't expect deep Kubernetes security** (Late): The book covers Kubernetes architecture and monitoring but is Docker-centric; supplement with dedicated Kubernetes security resources if that's your primary platform. ## 【Coverage Limits】 This guide synthesizes the first ~52% of the book in detail; the later sections on secrets management, networking, and Kubernetes monitoring are summarized from the book's stated objectives but not fully excerpted here. ##
Excerpt 1
security ends up being one more element of the organization culture through the DevSecOps methodology. According to a survey carried out by GitLab, 30% of us...
View in text
Excerpt 2
ute our containers as root, which is an advantage as we can execute our containers with different users who have different privileges. This happens without t...
View in text
Excerpt 3
state … link/ether 02:42:0a:00:00:04 brd ff:ff:ff:ff:ff:ff root@88d9d17dc13c:/# ip link set eth0 address 02:0a:03:0b:04:0c root@88d9d17dc13c:/# ip link ls 1:...
View in text
Excerpt 4
6”}, “layers”: [{“mediaType”: “application/vnd.docker.image. rootfs.diff.tar.gzip”, “size”: 50432971, “digest”: “sha256:bd8f6a7501ccbe80b95c82519 ed6fd4f7236...
View in text
Excerpt 5
43 1b29d1f Status: Downloaded newer image for debian:latest root@6f11ae04ecf2:/# ping 127.0.0.1 PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data. 64 bytes fro...
View in text
Excerpt 6
x spec: containers: - name: nginx image: nginx:1.7.9 ports: - containerPort: 80 Here, you can see an example of these YAML files with the description of a de...
View in text
Excerpt 7
nformation on the use of resources through the CLI kubectl. For example, kube-state-metrics exposes the data obtained by the Kubernetes API so that other too...
View in text
Excerpt 8
orization 345 building, into k8s 346 worker node, processes container runtime 315 kubelet 315 kube-proxy 315 Y YAML file 343 Z Zabbix URL 26
View in text
Tags
AI categories
Cloud NativeDevOpsCybersecurity
ISBN: 9355511183
Publisher: BPB Publications
Publish Year: 2022
Language: English
Pages: 480
File Format: PDF
File Size: 12.5 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…