Skip to content

Commit 7dc40ec

Browse files
feat: add Docker Hub authentication for Docker Scout
- Add docker/login-action before Scout scan for authentication - Update documentation to explain Scout requires Docker Hub auth - Clarify DOCKER_USERNAME and DOCKERHUB_TOKEN are used by security.yml - Scout will work properly when Docker Hub secrets are configured
1 parent 2b6aa1e commit 7dc40ec

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

.github/SECRETS_AND_VARIABLES.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,18 @@ If you want to deploy images to Docker Hub, you need these secrets:
7777

7878
**Impact if not set:**
7979

80-
- CI workflows (lint, test, build, security) will work fine
80+
- CI workflows (lint, test, build) will work fine
81+
- Security workflow will work with limitations (Docker Scout may fail)
8182
- Only CD workflow (deployment) will fail
8283
- You can skip these if you don't need to push images to Docker Hub
8384

85+
**Docker Scout Note:**
86+
87+
- Docker Scout requires authentication to work properly
88+
- The same `DOCKER_USERNAME` and `DOCKERHUB_TOKEN` are used for Scout
89+
- Without these secrets, Scout will show "not entitled" error
90+
- The workflow continues with graceful fallback (doesn't block CI)
91+
8492
---
8593

8694
## 🔐 Automatic Secrets
@@ -486,12 +494,14 @@ git push origin v1.0.0
486494
| Secret | Required | Used By | Purpose | Get From |
487495
| ------------------------ | ----------- | ------------------ | --------------------------- | ------------------- |
488496
| `GITHUB_TOKEN` | ✅ Auto | All workflows | GitHub API access | Automatic |
489-
| `DOCKER_USERNAME` | ✅ For CD | cd.yml | Docker Hub login | hub.docker.com |
490-
| `DOCKERHUB_TOKEN` | ✅ For CD | cd.yml | Docker Hub push access | hub.docker.com |
497+
| `DOCKER_USERNAME` | ✅ For CD | cd.yml, security.yml | Docker Hub login | hub.docker.com |
498+
| `DOCKERHUB_TOKEN` | ✅ For CD | cd.yml, security.yml | Docker Hub push access | hub.docker.com |
491499
| `DOCKERHUB_PROJECT_NAME` | ✅ For CD | cd.yml | Docker Hub project name | hub.docker.com |
492500
| `SNYK_TOKEN` | ⚠️ Optional | security.yml | Snyk vulnerability scanning | snyk.io |
493501
| `OPENAI_API_KEY` | ⚠️ Optional | ai-code-review.yml | AI-powered code reviews | platform.openai.com |
494502

503+
> **Note:** `DOCKER_USERNAME` and `DOCKERHUB_TOKEN` are also used by `security.yml` to authenticate Docker Scout scans.
504+
495505
---
496506

497507
## 🎯 Workflow Capabilities by Setup Level

.github/workflows/security.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ jobs:
2727
- name: Set up Docker Buildx
2828
uses: docker/setup-buildx-action@v3
2929

30+
- name: Log in to Docker Hub (for Docker Scout)
31+
uses: docker/login-action@v3
32+
continue-on-error: true
33+
with:
34+
username: ${{ secrets.DOCKER_USERNAME }}
35+
password: ${{ secrets.DOCKERHUB_TOKEN }}
36+
3037
- name: Build production image for scanning
3138
run: docker compose build react-prod
3239

0 commit comments

Comments
 (0)