Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 52 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Lint
Expand All @@ -35,7 +35,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Test
Expand All @@ -47,7 +47,7 @@ jobs:
needs: [lint, test]
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: build-package/package
Expand All @@ -61,7 +61,7 @@ jobs:
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Build Docker Image for AMD64
Expand All @@ -75,7 +75,7 @@ jobs:
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Build Docker Image for ARM64
Expand All @@ -92,12 +92,12 @@ jobs:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Setup Chainguard
uses: chainguard-dev/setup-chainctl@v0.4.0
uses: chainguard-dev/setup-chainctl@c125f765e82b09a42af3185f3214465314d75c5d # v0.5.0
with:
identity: ${{ secrets.CHAINGUARD_IDENTITY }}

Expand All @@ -115,12 +115,12 @@ jobs:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Setup Chainguard
uses: chainguard-dev/setup-chainctl@v0.4.0
uses: chainguard-dev/setup-chainctl@c125f765e82b09a42af3185f3214465314d75c5d # v0.5.0
with:
identity: ${{ secrets.CHAINGUARD_IDENTITY }}

Expand All @@ -134,32 +134,46 @@ jobs:
if: github.actor != 'dependabot[bot]'
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Setup Chainguard
uses: chainguard-dev/setup-chainctl@v0.4.0
uses: chainguard-dev/setup-chainctl@c125f765e82b09a42af3185f3214465314d75c5d # v0.5.0
with:
identity: ${{ secrets.CHAINGUARD_IDENTITY }}

- name: Build FIPS Docker image for scanning
run: make build-image-fips-amd64-with-tags

- name: Run Grype vulnerability scanner
uses: anchore/scan-action@7037fa011853d5a11690026fb85feee79f4c946c # v7.3.2
with:
image: "mattermost/mattermost-push-proxy-fips:${{ github.ref == 'refs/heads/master' && 'master' || format('dev-{0}', github.sha) }}"
output-format: table
fail-build: false

security-scan:
name: Security Scan
runs-on: ubuntu-latest
needs: [lint, test]
if: github.actor != 'dependabot[bot]'
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Build Docker image for scanning
run: make build-image-amd64-with-tags

- name: Run Grype vulnerability scanner
uses: anchore/scan-action@7037fa011853d5a11690026fb85feee79f4c946c # v7.3.2
with:
image: "mattermost-push-proxy:${{ github.ref == 'refs/heads/master' && 'master' || format('dev-{0}', github.sha) }}"
output-format: table
fail-build: false

pr-deploy-amd64:
name: PR Deploy AMD64
runs-on: ubuntu-latest
Expand All @@ -170,12 +184,12 @@ jobs:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Login to Docker Hub
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: matterbuild
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -203,12 +217,12 @@ jobs:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Login to Docker Hub
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: matterbuild
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -236,7 +250,7 @@ jobs:
id-token: write
steps:
- name: Login to Docker Hub
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: matterbuild
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -266,17 +280,17 @@ jobs:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Setup Chainguard Identity
uses: chainguard-dev/setup-chainctl@v0.4.0
uses: chainguard-dev/setup-chainctl@c125f765e82b09a42af3185f3214465314d75c5d # v0.5.0
with:
identity: ${{ secrets.CHAINGUARD_IDENTITY }}

- name: Login to Docker Hub
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: matterbuild
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -304,17 +318,17 @@ jobs:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Setup Chainguard Identity
uses: chainguard-dev/setup-chainctl@v0.4.0
uses: chainguard-dev/setup-chainctl@c125f765e82b09a42af3185f3214465314d75c5d # v0.5.0
with:
identity: ${{ secrets.CHAINGUARD_IDENTITY }}

- name: Login to Docker Hub
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: matterbuild
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -342,7 +356,7 @@ jobs:
id-token: write
steps:
- name: Login to Docker Hub
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: matterbuild
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -374,12 +388,12 @@ jobs:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Login to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: matterbuild
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -404,12 +418,12 @@ jobs:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Login to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: matterbuild
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -434,12 +448,12 @@ jobs:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Login to Docker Hub
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: matterbuild
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down Expand Up @@ -498,17 +512,17 @@ jobs:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Setup Chainguard Identity
uses: chainguard-dev/setup-chainctl@v0.3.2
uses: chainguard-dev/setup-chainctl@c125f765e82b09a42af3185f3214465314d75c5d # v0.5.0
with:
identity: ${{ secrets.CHAINGUARD_IDENTITY }}

- name: Login to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: matterbuild
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -533,17 +547,17 @@ jobs:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Setup Chainguard Identity
uses: chainguard-dev/setup-chainctl@v0.3.2
uses: chainguard-dev/setup-chainctl@c125f765e82b09a42af3185f3214465314d75c5d # v0.5.0
with:
identity: ${{ secrets.CHAINGUARD_IDENTITY }}

- name: Login to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: matterbuild
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -568,12 +582,12 @@ jobs:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Login to Docker Hub
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: matterbuild
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
31 changes: 30 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,28 @@ scan-fips: ## Scan FIPS Docker image for vulnerabilities using Docker Scout
fi
docker scout cves $(APP_NAME_FIPS):$(APP_VERSION_NO_V)

.PHONY: grype
grype: ## Scan Docker image for vulnerabilities using Grype
@echo Running Grype vulnerability scan
@if ! docker images -q ${APP_NAME}:${APP_VERSION_NO_V} | grep -q .; then \
echo "❌ Image ${APP_NAME}:${APP_VERSION_NO_V} not found locally. Please build it first with:"; \
echo " make build-image-amd64-with-tags (or build-image-arm64-with-tags)"; \
exit 1; \
fi
grype docker:${APP_NAME}:${APP_VERSION_NO_V} -o table --only-fixed

.PHONY: grype-fips
grype-fips: ## Scan FIPS Docker image for vulnerabilities using Grype
@echo Running Grype vulnerability scan for FIPS image
@if ! docker images -q $(APP_NAME_FIPS):$(APP_VERSION_NO_V) | grep -q .; then \
echo "❌ Image $(APP_NAME_FIPS):$(APP_VERSION_NO_V) not found locally. Please build it first with:"; \
echo " make build-image-fips-amd64-with-tags (or build-image-fips-arm64-with-tags)"; \
exit 1; \
fi
grype docker:$(APP_NAME_FIPS):$(APP_VERSION_NO_V) -o table --only-fixed

.PHONY: security-all
security-all: ## Run all vulnerability scans (Docker Scout) for both regular and FIPS images
security-all: ## Run all vulnerability scans (Docker Scout and Grype) for both regular and FIPS images
@echo "🔍 Running comprehensive security scans for all images..."
@echo ""
@echo "=========================================="
Expand All @@ -756,6 +776,15 @@ security-all: ## Run all vulnerability scans (Docker Scout) for both regular and
$(MAKE) scan-fips
@echo ""
@echo "=========================================="
@echo "🛡️ Grype - Regular Image"
@echo "=========================================="
$(MAKE) grype
@echo ""
@echo "=========================================="
@echo "🛡️ Grype - FIPS Image"
@echo "=========================================="
$(MAKE) grype-fips
@echo ""
@echo "✅ All security scans completed!"

.PHONY: security-build-and-scan
Expand Down
Loading