Auto DevOps: image digest in container spec
What does this MR do?
Until #18984 (closed) is implemented, a user with the developer role can deploy thier code to production environment without the maintainer approval by updating production container image in registry, and this is a security risk. This and related MRs prevents such situations by adding the image digest to the container spec when deploying to k8s. The developer can still update (or delete) the production container image in registry, but the updated image will not be deployed to the production environment.
Screenshots or Screencasts (strongly suggested)
How to setup and validate locally (strongly suggested)
nclude:
- template: Auto-DevOps.gitlab-ci.yml
variables:
AUTO_BUILD_IMAGE_VERSION: v1.5.0
build:
artifacts:
reports:
dotenv: gl-auto-build-variables.env
.auto-deploy:
dependencies: [build]
dast_environment_deploy:
dependencies: [build]
citemplates Manual QA
-
.gitlab-ci.yml
(identical to above) - Pipeline
- Additional verification step: Verified that the deployed image has
image: registry.gitlab.com/hfyngvason/minimal-ruby-app/main:d33e7ccf5aec2c3f473ba04b7d1b57da8e5b6412@sha256:1919656e3b9b89f256c96e238e1430a5eb79a584ba634b6d068a180feb250ca2
@sha256:...
suffix.
Does this MR meet the acceptance criteria?
Conformity
-
I have included changelog trailers, or none are needed. (Does this MR need a changelog?) -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have added information for database reviewers in the MR description, or it's not needed. (Does this MR have database related changes?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides. -
This change is backwards compatible across updates, or this does not apply.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.) -
I have tested this MR in all supported browsers, or it's not needed. -
I have informed the Infrastructure department of a default or new setting change per definition of done, or it's not needed.
Security
Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Hordur Freyr Yngvason