deckhouse / deckhouse/modules-gitlab-ci

CVE scan job fails in release branches

Open
#37 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3
Forks
1
Avg merge
13m
Merged PRs (30d)
38

Description

CSE Scan job tries to download module from PROD_REGISTRY instead of DEV_REGISTRY if branch has dots in the name (release-1.4, for example)

++ echo
++ echo =======================================================
++ echo
++ echo '$ echo "Setting up registry path for module" # collapsed multi-line command'
++ echo 'Setting up registry path for module'
++ PROD_REGISTRY_MODULE_BASEDIR=registry.deckhouse.io/deckhouse/fe/modules
++ DEV_REGISTRY_MODULE_BASEDIR=dev-registry.deckhouse.io/sys/deckhouse-oss/modules
++ severity=UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL
++ latest_releases_amount=3
++ '[' -z release-1.4 ']'
++ '[' -n '' ']'
++ module_tags=("${TAG}")
++ '[' push == schedule ']'
++ echo 'Getting tags to scan'
++ echo release-1.4
++ grep -q '[0-9]*\.[0-9]*'
++ module_tags=($(crane ls "${PROD_REGISTRY_MODULE_BASEDIR}/${MODULE_NAME}" | grep "^v${TAG}\.[0-9]*" | sort -V -r | head -n 1))
+++ grep '^vrelease-1.4\.[0-9]*'
+++ crane ls registry.deckhouse.io/deckhouse/fe/modules/commander-agent
+++ sort -V -r
+++ head -n 1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the CSE Scan job's registry setup, where PROD_REGISTRY_MODULE_BASEDIR and DEV_REGISTRY_MODULE_BASEDIR are selected, and inspect the branch-name and tag-selection logic using crane. Reproduce the scan for a dotted release branch such as release-1.4; done means it selects the development registry rather than the production registry for that branch.

Written by the indexing model from the issue text.

Assessment

Tech stack
gitlab, shell
Domain
ci-cd, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.