OpenParable
Skip to content
← Back to skills

Cis Docker 4.7

DevOps & Security
cis-docker-4.7

Cis Docker 4.7 is an Agent Skill for devops & security published in the CyberStrikeus/CyberStrike repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Ensure update instructions are not used alone in Dockerfiles

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/CyberStrikeus/CyberStrike/blob/HEAD/.cyberstrike/skill/CIS_benchmarks/Server_Software/Docker/CIS_Docker_Benchmark_v1.8.0/cis-docker-4.7/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/cis-docker-4-7, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

4.7 Ensure update instructions are not used alone in Dockerfiles (Manual)

Profile Applicability

  • Level 1 - Docker - Linux

Description

You should not use OS package manager update instructions such as apt-get update or yum update either alone or in a single line in any Dockerfiles used to generate images under review.

Rationale

Adding update instructions in a single line on the Dockerfile will cause the update layer to be cached. When you then build any image later using the same instruction, this will cause the previously cached update layer to be used, potentially preventing any fresh updates from being applied to later builds.

Impact

None

Audit Procedure

Step 1: Run the command below to get the list of images:

docker images

Step 2: Run the command below against each image in the list above, looking for any update instructions which are incorporated in a single line:

docker history <Image_ID>

Alternatively, if you have access to the Dockerfile for the image, you should verify that there are no update instructions configured as described above.

Remediation

You should use update instructions together with install instructions and version pinning for packages while installing them. This will prevent caching and force the extraction of the required versions.

Alternatively, you could use the --no-cache flag during the docker build process to avoid using cached layers.

Default Value

By default, Docker does not enforce any restrictions on using update instructions.

References

  1. https://docs.docker.com/develop/develop-images/dockerfile_best-practices/

CIS Controls

v8

16.7 Use Standard Hardening Configuration Templates for Application Infrastructure

Use standard, industry-recommended hardening configuration templates for application infrastructure components. This includes underlying servers, databases, and web servers, and applies to cloud containers, Platform as a Service (PaaS) components, and SaaS components. Do not allow in-house developed software to weaken configuration hardening.

v7

5.2 Maintain Secure Images

Maintain secure images or templates for all systems in the enterprise based on the organization's approved configuration standards. Any new system deployment or existing system that becomes compromised should be imaged using one of those images or templates.