@@ -496,6 +496,41 @@ format-web: install-web-linters
496496 " mcpgateway/static/**/*.js"
497497
498498
499+ # ###############################################################################
500+ # 🛡️ OSV-SCANNER ▸ vulnerabilities scanner
501+ # ###############################################################################
502+ # help: osv-install - Install/upgrade osv-scanner (Go)
503+ # help: osv-scan-source - Scan source & lockfiles for CVEs
504+ # help: osv-scan-image - Scan the built container image for CVEs
505+ # help: osv-scan - Run all osv-scanner checks (source, image, licence)
506+
507+ .PHONY : osv-install osv-scan-source osv-scan-image osv-scan
508+
509+ osv-install : # # Install/upgrade osv-scanner
510+ go install github.com/google/osv-scanner/v2/cmd/osv-scanner@latest
511+
512+ # ─────────────── Source directory scan ────────────────────────────────────────
513+ osv-scan-source :
514+ @echo " 🔍 osv-scanner source scan…"
515+ @osv-scanner scan source --recursive .
516+
517+ # ─────────────── Container image scan ─────────────────────────────────────────
518+ osv-scan-image :
519+ @echo " 🔍 osv-scanner image scan…"
520+ @CONTAINER_CLI=$$(command -v docker || command -v podman ) ; \
521+ if [ -n " $$ CONTAINER_CLI" ]; then \
522+ osv-scanner scan image $(DOCKLE_IMAGE ) || true ; \
523+ else \
524+ TARBALL=$$(mktemp /tmp/$(PROJECT_NAME ) -osvscan-XXXXXX.tar ) ; \
525+ podman save --format=docker-archive $(DOCKLE_IMAGE ) -o " $$ TARBALL" ; \
526+ osv-scanner scan image --archive " $$ TARBALL" ; \
527+ rm -f " $$ TARBALL" ; \
528+ fi
529+
530+ # ─────────────── Umbrella target ─────────────────────────────────────────────
531+ osv-scan : osv-scan-source osv-scan-image
532+ @echo " ✅ osv-scanner checks complete."
533+
499534# =============================================================================
500535# 📡 SONARQUBE ANALYSIS (SERVER + SCANNERS)
501536# =============================================================================
@@ -983,7 +1018,7 @@ docker-shell:
9831018# help: compose-pull - Pull the latest images only
9841019# help: compose-logs - Tail logs from all services (Ctrl-C to exit)
9851020# help: compose-ps - Show container status table
986- # help: compose-shell - Open an interactive shell in the “ gateway” container
1021+ # help: compose-shell - Open an interactive shell in the " gateway" container
9871022# help: compose-stop - Gracefully stop the stack (keep containers)
9881023# help: compose-down - Stop & remove containers (keep named volumes)
9891024# help: compose-rm - Remove *stopped* containers
0 commit comments