# yaml-language-server: $schema=../../schemas/dsomm-schema-build-and-deployment.json --- Build and Deployment: Patch Management: A patch policy is defined: uuid: 99415139-6b50-441b-89e1-0aa59accd43d description: | A patch policy defines how and when software components, images, and dependencies are updated. A patch policy ensures that all these artifacts are regularly reviewed and updated, reducing the window of exposure to known threats. The policy should specify the frequency, responsibilities, and documentation requirements for patching. risk: Vulnerabilities in running artifacts may persist for a long time and might be exploited. measure: Define a patch policy for all artifacts (e.g. in images) is defined. How often is an image rebuilt? assessment: | - Patch policy is documented and accessible to relevant staff. - The policy defines patch frequency and responsible roles. - Patch actions and exceptions are logged and reviewed. - Evidence of regular patching and policy review is available. level: 1 difficultyOfImplementation: knowledge: 3 time: 1 resources: 2 usefulness: 4 implementation: [] references: samm2: - O-EM-B-1 iso27001-2017: - 12.6.1 - 12.5.1 - 14.2.5 iso27001-2022: - 8.8 - 8.19 - 8.27 comments: "" tags: - patching Automated PRs for patches: uuid: 8ae0b92c-10e0-4602-ba22-7524d6aed488 description: | Automated PRs for patches ensure that updates for outdated or vulnerable dependencies are created and proposed without manual intervention. Tools continuously monitor for new versions or security advisories and immediately generate pull requests to update affected components in code, container images, or infrastructure. This process ensures that available patches are quickly visible to developers and can be reviewed and merged with minimal delay, reducing the risk window for known vulnerabilities. risk: | Components with known vulnerabilities might persist for a long time and be exploited, even when a patch is available. measure: | Fast patching of third-party components is needed. The DevOps way is to have an automated pull request for new components. This includes: * Applications * Virtualized operating system components (e.g., container images) * Operating systems * Infrastructure as Code/GitOps (e.g., ArgoCD based on a git repository or Terraform) assessment: | - Automated PR tooling is enabled for all relevant repositories. - PRs are created automatically for outdated or vulnerable dependencies. - PRs are reviewed and merged according to the defined patch policy. - Evidence of automated PRs and patching activity is available. level: 1 difficultyOfImplementation: knowledge: 2 time: 2 resources: 2 usefulness: 4 implementation: - $ref: src/assets/YAML/default/implementations.yaml#/implementations/dependabot - $ref: src/assets/YAML/default/implementations.yaml#/implementations/jenkins # - $ref: src/assets/YAML/default/implementations.yaml#/implementations/argocd TODO - $ref: src/assets/YAML/default/implementations.yaml#/implementations/terraform - $ref: src/assets/YAML/default/implementations.yaml#/implementations/renovate references: samm2: - O-EM-B-1 iso27001-2017: - 12.6.1 - 14.2.5 iso27001-2022: - "8.8" - "8.27" comments: "" tags: - patching Nightly build of images (base images): uuid: 34869eaf-f2e1-4926-b0bd-28c43402f057 description: |- A base image is a pre-built image that serves as a starting point for building new images or containers. These base images usually include an operating system, necessary dependencies, libraries, and other components that are required to run a specific application or service. Nightly builds of custom base images refer to an automated process that occurs daily or on a scheduled basis, usually during nighttime or off-peak hours, to create updated versions of custom base images. risk: Vulnerabilities in running containers stay for too long and might get exploited. measure: Custom base images are getting build at least nightly. In case the packages in the base image e.g. centos has changed, the build server triggers the build of depending images. difficultyOfImplementation: knowledge: 3 time: 2 resources: 2 usefulness: 3 level: 2 implementation: [] references: samm2: - O-EM-B-2 iso27001-2017: - 12.6.1 iso27001-2022: - 8.8 comments: "" tags: - patching Reduction of the attack surface: uuid: 16e39c8f-5336-4001-88ed-a552d2447531 description: |- Distroless images are minimal, stripped-down base images that contain only the essential components required to run your application. They do not include package managers, shells, or any other tools that are commonly found in standard Linux distributions. Using distroless images can help reduce the attack surface and overall size of your container images. risk: Components, dependencies, files or file access rights might have vulnerabilities, but the they are not needed. measure: Removal of unneeded components, dependencies, files or file access rights. For container images the usage of distroless images is recommended. difficultyOfImplementation: knowledge: 3 time: 3 resources: 2 usefulness: 3 level: 2 implementation: - $ref: src/assets/YAML/default/implementations.yaml#/implementations/distroless - $ref: src/assets/YAML/default/implementations.yaml#/implementations/fedora-coreos - $ref: src/assets/YAML/default/implementations.yaml#/implementations/distroless-usage references: samm2: - I-SB-B-2 iso27001-2017: - hardening is missing in ISO 27001 - 14.2.1 iso27001-2022: - 8.25 comments: "" tags: - patching Usage of a maximum lifetime for images: uuid: 485a3383-7f2e-4dba-bb84-479377070904 description: |- The maximum lifetime for a Docker container refers to the duration a container should be allowed to run before it is considered outdated, stale, or insecure. There is not a fixed, universally applicable maximum lifetime for a Docker container, as it varies depending on the specific use case, application requirements, and security needs. As a best practice, it is essential to define a reasonable maximum lifetime for containers to ensure that you consistently deploy the most recent, patched, and secure versions of both your custom base images and third-party images. risk: Vulnerabilities in images of running containers stay for too long and might get exploited. Long running containers have potential memory leaks. A compromised container might get killed by restarting the container (e.g. in case the attacker has not reached the persistence layer). measure: A short maximum lifetime for images is defined, e.g. 30 days. The project images, based on the nightly builded images, are deployed at leased once within the defined lifetime. Third Party images are deployed at leased once within the defined lifetime. difficultyOfImplementation: knowledge: 3 time: 4 resources: 2 usefulness: 3 level: 2 implementation: [] references: samm2: - O-EM-B-1 iso27001-2017: - 12.6.1 iso27001-2022: - 8.8 comments: "" tags: - patching Usage of a short maximum lifetime for images: uuid: 6b96e5a0-ce34-4ea4-a88f-469d3b84546e description: |- The maximum lifetime for a Docker container refers to the duration a container should be allowed to run before it is considered outdated, stale, or insecure. There is not a fixed, universally applicable maximum lifetime for a Docker container, as it varies depending on the specific use case, application requirements, and security needs. As a best practice, it is essential to define a reasonable maximum lifetime for containers to ensure that you consistently deploy the most recent, patched, and secure versions of both your custom base images and third-party images. risk: Vulnerabilities in running containers stay for too long and might get exploited. measure: | A good practice is to perform the build and deployment daily or even just-in-time, when a new component (e.g. package) for the image is available. difficultyOfImplementation: knowledge: 3 time: 4 resources: 2 usefulness: 3 level: 4 implementation: - $ref: src/assets/YAML/default/implementations.yaml#/implementations/sample-concept-1 references: samm2: - O-EM-B-2 iso27001-2017: - 12.6.1 iso27001-2022: - 8.8 comments: "" tags: - patching Automated merge of automated PRs: &automerge-PR uuid: f2594f8f-1cd6-45f9-af29-eaf3315698eb description: |- Automated merges of automated created PRs for outdated dependencies. risk: Vulnerabilities in running artifacts stay for too long and might get exploited. measure: | A good practice is to merge trusted dependencies (e.g. spring boot) after a grace period like one week. Often, patches, fixes and minor updates are automatically merged. Be aware that automated merging requires a high automated test coverage. Enforcement of merging of pull requests after a grace period. difficultyOfImplementation: knowledge: 2 time: 1 resources: 1 usefulness: 3 level: 2 dependsOn: - 8ae0b92c-10e0-4602-ba22-7524d6aed488 # Automated PRs for patches implementation: - $ref: src/assets/YAML/default/implementations.yaml#/implementations/dependabot - $ref: src/assets/YAML/default/implementations.yaml#/implementations/renovate references: samm2: - O-EM-B-2 iso27001-2017: - 12.6.1 iso27001-2022: - 8.8 comments: "" tags: - patching Minimum release age: uuid: 594d9d39-b79f-4975-b3a7-ad3eca032087 description: | Automated dependency updates adopt new versions within minutes of their publication. Supply chain attacks exploit exactly this window: a hijacked maintainer account publishes a malicious version that is downloaded, installed and executed before the registry, the maintainer or any advisory feed can react. Compromised versions are typically detected and yanked within hours to a few days. A configured waiting period lets a new version age before it may enter a build, so that most malicious releases are already withdrawn when the update is proposed. risk: | A compromised version of a legitimate dependency is pulled into the build automatically and executes malicious code during installation, stealing registry tokens and cloud credentials, before the version is withdrawn or any advisory exists. measure: | Configure the automated update tooling to ignore versions that are younger than a defined age, e.g. `minimumReleaseAge` in Renovate or `cooldown` in Dependabot. A period of three to seven days covers the typical detection and takedown time of compromised packages. Define the period in the patch policy and allow a documented exception path for security fixes that must be adopted immediately. The waiting period is the client side of the measure; enforcing it for all consumers additionally requires a managed artifact repository. assessment: | - A minimum release age is configured in the automated update tooling of all relevant repositories. - The chosen period and the exception path for urgent security fixes are documented in the patch policy. - Updates younger than the configured period are demonstrably not proposed or merged. level: 2 difficultyOfImplementation: knowledge: 2 time: 1 resources: 1 usefulness: 4 dependsOn: - 8ae0b92c-10e0-4602-ba22-7524d6aed488 # Automated PRs for patches implementation: - $ref: src/assets/YAML/default/implementations.yaml#/implementations/dependabot - $ref: src/assets/YAML/default/implementations.yaml#/implementations/renovate references: samm2: - O-EM-B-2 iso27001-2017: - 12.6.1 - 15.1.1 iso27001-2022: - "8.8" - "5.19" comments: "" tags: - patching - supply-chain Automated deployment of automated PRs: &automerge-PR uuid: 08f27c26-2c6a-47fe-9458-5e88f188085d <<: *automerge-PR risk: Even if automated dependencies PRs are merged, they might not be deployed. This results in vulnerabilities in running artifacts stay for too long and might get exploited. measure: | After merging of an automated dependency PR, automated deployment is needed, difficultyOfImplementation: knowledge: 3 time: 3 resources: 1 usefulness: 3 level: 3 dependsOn: - f2594f8f-1cd6-45f9-af29-eaf3315698eb # Automated merge of automated PRs implementation: - $ref: src/assets/YAML/default/implementations.yaml#/implementations/terraform - $ref: src/assets/YAML/default/implementations.yaml#/implementations/argocd