From f54f48b76cf82308c617a385e82f234e609b9f2c Mon Sep 17 00:00:00 2001
From: andresanaya21 <alvaroandres.anayaamariles@telefonica.com>
Date: Wed, 15 Jan 2025 13:30:44 +0100
Subject: [PATCH] refactor: update docker login command in
 ci_staging.gitlab-ci.yml to use password-stdin for security

---
 capif/templates/ci_staging.gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/capif/templates/ci_staging.gitlab-ci.yml b/capif/templates/ci_staging.gitlab-ci.yml
index 0c39c89..94209bf 100644
--- a/capif/templates/ci_staging.gitlab-ci.yml
+++ b/capif/templates/ci_staging.gitlab-ci.yml
@@ -177,7 +177,7 @@ staging_grype_cvs:
       cd services/$IMAGE_NAME/
       
       # Login to Docker registry
-      docker login --username $CI_REGISTRY_USER --password $CAPIF_DOCKER_REGISTRY $CI_REGISTRY
+      echo "$CI_JOB_TOKEN" | docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin
       
       # Build Docker image
       docker build -t $CI_REGISTRY/ocf/capif/$CI_COMMIT_REF_SLUG/$IMAGE_LOWER:$CI_COMMIT_REF_SLUG .
-- 
GitLab