-
Notifications
You must be signed in to change notification settings - Fork 78
DAT-21009: Add Supply Chain Security to Liquibase Secure Docker Images #485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add SBOM generation, SLSA Level 3 provenance attestation, and Cosign keyless image signing for Liquibase Secure Docker images only. Changes: - Add SBOM and provenance to docker/build-push-action for secure images - Install Cosign and sign images on Docker Hub, GHCR, and ECR - Add "Verifying Secure Images" documentation to README.md Community images remain unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
📝 WalkthroughWalkthroughThis PR implements supply chain security features for Liquibase Secure Docker images by enabling SBOM generation and provenance attestation in the build process, adding Cosign-based keyless image signing for Docker Hub, GHCR, and ECR, and documenting verification procedures in the README. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–25 minutes
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| # Install Cosign for keyless image signing (Secure images only) | ||
| - name: Install Cosign | ||
| if: ${{ matrix.type == 'liquibase-secure-release' }} | ||
| uses: sigstore/cosign-installer@v3 |
Check warning
Code scanning / CodeQL
Unpinned tag for a non-immutable Action in workflow Medium
Uses Step
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive supply chain security features to Liquibase Secure Docker images to achieve SLSA Level 3 compliance. The implementation includes SBOM generation, build provenance attestations, and keyless image signing using Cosign with GitHub OIDC, ensuring image authenticity and transparency without storing private keys.
Key changes:
- Supply chain security features (SBOM, provenance, Cosign signing) for secure images only
- Keyless signing via GitHub OIDC across all registries (Docker Hub, GHCR, ECR)
- Comprehensive documentation for verifying image authenticity and viewing attestations
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/create-release.yml |
Adds Cosign installation, SBOM/provenance generation in build step, and registry-specific signing steps with proper conditionals for secure images only |
README.md |
Adds "Verifying Secure Images" section with command examples for signature verification, SBOM inspection, and provenance viewing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/create-release.yml (1)
369-369: Critical: Fix typo in AWS credentials reference.Line 369 and 380 have a typo:
steps.configure-aws-credentials-prodoutputsshould besteps.configure-aws-credentials-prod.outputs(missing dot afterprod).Apply this diff to fix the typo:
- password: ${{ steps.configure-aws-credentials-prodoutputs.aws_secret_access_key }} + password: ${{ steps.configure-aws-credentials-prod.outputs.aws_secret_access_key }}Also applies to: 380-380
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
.github/workflows/create-release.yml(4 hunks)README.md(1 hunks)
🧰 Additional context used
🧠 Learnings (13)
📓 Common learnings
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Applies to DockerfileSecure : Docker Secure images should use distinct tagging strategy: Git tag format `v{version}-SECURE` (e.g., `v5.0.1-SECURE`), GitHub Release labeled `v{version}-SECURE`, and Docker image tags `liquibase/liquibase-secure:{version}`, `liquibase/liquibase-secure:{major.minor}`, and `liquibase/liquibase-secure:latest`
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Secure Docker images should be published to Docker Hub as `liquibase/liquibase-secure`, GitHub Container Registry as `ghcr.io/liquibase/liquibase-secure*`, and Amazon ECR Public as `public.ecr.aws/liquibase/liquibase-secure*`
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Applies to {Dockerfile,DockerfileSecure,Dockerfile.alpine} : Validate Liquibase and LPM binary SHA256 checksums for security in Dockerfile builds
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Applies to {Dockerfile,docker-compose.yml} : Docker Community images should use distinct tagging strategy: Git tag format `v{version}` (e.g., `v5.0.1`), GitHub Release labeled `v{version}`, and Docker image tags `liquibase/liquibase:{version}`, `liquibase/liquibase:{major.minor}`, and `liquibase/liquibase:latest`
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Applies to DockerfileSecure : Secure Liquibase versions should be sourced from repo.liquibase.com and controlled via `LIQUIBASE_PRO_VERSION` ARG
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Applies to **/Dockerfile* : When extending Secure images, use `FROM liquibase/liquibase-secure:latest` as the base and set `LIQUIBASE_LICENSE_KEY` environment variable
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Applies to {Dockerfile,DockerfileSecure,Dockerfile.alpine} : When adding tools or runtime dependencies to images, switch to root user, run apt-get operations, and switch back to non-root `liquibase` user in multi-step processes
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Applies to Dockerfile : Community Liquibase versions should be sourced from GitHub releases and controlled via `LIQUIBASE_VERSION` ARG
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Community Docker images should be published to Docker Hub as `liquibase/liquibase`, GitHub Container Registry as `ghcr.io/liquibase/liquibase*`, and Amazon ECR Public as `public.ecr.aws/liquibase/liquibase*`
📚 Learning: 2025-11-24T16:48:37.150Z
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Applies to DockerfileSecure : Docker Secure images should use distinct tagging strategy: Git tag format `v{version}-SECURE` (e.g., `v5.0.1-SECURE`), GitHub Release labeled `v{version}-SECURE`, and Docker image tags `liquibase/liquibase-secure:{version}`, `liquibase/liquibase-secure:{major.minor}`, and `liquibase/liquibase-secure:latest`
Applied to files:
.github/workflows/create-release.ymlREADME.md
📚 Learning: 2025-11-24T16:48:37.150Z
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Secure Docker images should be published to Docker Hub as `liquibase/liquibase-secure`, GitHub Container Registry as `ghcr.io/liquibase/liquibase-secure*`, and Amazon ECR Public as `public.ecr.aws/liquibase/liquibase-secure*`
Applied to files:
.github/workflows/create-release.ymlREADME.md
📚 Learning: 2025-11-24T16:48:37.150Z
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Applies to {Dockerfile,DockerfileSecure,Dockerfile.alpine} : Validate Liquibase and LPM binary SHA256 checksums for security in Dockerfile builds
Applied to files:
.github/workflows/create-release.ymlREADME.md
📚 Learning: 2025-11-24T16:48:37.150Z
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Applies to DockerfileSecure : Secure Liquibase versions should be sourced from repo.liquibase.com and controlled via `LIQUIBASE_PRO_VERSION` ARG
Applied to files:
.github/workflows/create-release.ymlREADME.md
📚 Learning: 2025-11-24T16:48:37.150Z
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Applies to {Dockerfile,DockerfileSecure,Dockerfile.alpine} : When adding tools or runtime dependencies to images, switch to root user, run apt-get operations, and switch back to non-root `liquibase` user in multi-step processes
Applied to files:
.github/workflows/create-release.ymlREADME.md
📚 Learning: 2025-11-24T16:48:37.150Z
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Applies to {Dockerfile,docker-compose.yml} : Docker Community images should use distinct tagging strategy: Git tag format `v{version}` (e.g., `v5.0.1`), GitHub Release labeled `v{version}`, and Docker image tags `liquibase/liquibase:{version}`, `liquibase/liquibase:{major.minor}`, and `liquibase/liquibase:latest`
Applied to files:
.github/workflows/create-release.ymlREADME.md
📚 Learning: 2025-11-24T16:48:37.150Z
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Applies to Dockerfile : Community Liquibase versions should be sourced from GitHub releases and controlled via `LIQUIBASE_VERSION` ARG
Applied to files:
.github/workflows/create-release.ymlREADME.md
📚 Learning: 2025-11-24T16:48:37.150Z
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Applies to **/Dockerfile* : When extending Secure images, use `FROM liquibase/liquibase-secure:latest` as the base and set `LIQUIBASE_LICENSE_KEY` environment variable
Applied to files:
.github/workflows/create-release.ymlREADME.md
📚 Learning: 2025-11-24T16:48:37.150Z
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Applies to {Dockerfile,DockerfileSecure,Dockerfile.alpine} : LPM (Liquibase Package Manager) version should be specified via `LPM_VERSION` ARG in all Dockerfiles
Applied to files:
.github/workflows/create-release.yml
📚 Learning: 2025-11-24T16:48:37.150Z
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Community Docker images should be published to Docker Hub as `liquibase/liquibase`, GitHub Container Registry as `ghcr.io/liquibase/liquibase*`, and Amazon ECR Public as `public.ecr.aws/liquibase/liquibase*`
Applied to files:
.github/workflows/create-release.yml
📚 Learning: 2025-11-24T16:48:37.150Z
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Applies to **/Dockerfile* : When extending Community images, use `FROM liquibase/liquibase:latest` as the base and add database drivers using LPM (e.g., `lpm add mysql --global`)
Applied to files:
.github/workflows/create-release.ymlREADME.md
📚 Learning: 2025-11-24T16:48:37.150Z
Learnt from: CR
Repo: liquibase/docker PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T16:48:37.150Z
Learning: Applies to {Dockerfile,DockerfileSecure,Dockerfile.alpine} : Set working directory to `/liquibase` in all Docker images
Applied to files:
README.md
🪛 GitHub Check: CodeQL
.github/workflows/create-release.yml
[warning] 322-322: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Release Extension (v2)' step Uses Step uses 'sigstore/cosign-installer' with ref 'v3', not a pinned commit hash
🔇 Additional comments (4)
.github/workflows/create-release.yml (3)
451-453: SBOM and provenance configuration is correct.The conditional SBOM and provenance settings properly apply only to
liquibase-secure-releaseimages. The provenance mode is set tomaxfor comprehensive SLSA Level 3 compliance.
475-495: Cosign signing steps are properly gated and structured.The three signing steps (Docker Hub, GHCR, ECR) correctly target only secure releases, respect dry-run flags, and use the digest from the build-and-push step. Assuming the
COSIGN_EXPERIMENTALenvironment variable is added, the implementation aligns with keyless signing requirements.Please verify that keyless signing operates correctly with the GitHub OIDC token available in GitHub Actions, once the missing environment variable is added.
475-495: Remove recommendation to add COSIGN_EXPERIMENTAL environment variable — it is obsolete.As of Cosign 2.0, the
COSIGN_EXPERIMENTAL=1environment variable is no longer required for keyless signing. Keyless signing via GitHub OIDC is enabled by default in modern Cosign releases. The current workflow configuration is correct and does not need modification on this front.If keyless signing fails at runtime, the issue would be due to missing
id-token: writepermissions in the job/workflow configuration, not the absence ofCOSIGN_EXPERIMENTAL.Likely an incorrect or invalid review comment.
README.md (1)
244-276: Excellent documentation for supply chain security verification.The new "Verifying Secure Images" section (lines 244-276) is well-structured and provides clear, actionable instructions for verifying image signatures, inspecting SBOMs, and viewing build provenance. The explanation of keyless signing via GitHub OIDC is concise, and the emphasis that these features apply only to Secure images prevents user confusion.
| # Install Cosign for keyless image signing (Secure images only) | ||
| - name: Install Cosign | ||
| if: ${{ matrix.type == 'liquibase-secure-release' }} | ||
| uses: sigstore/cosign-installer@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
sigstore cosign-installer GitHub releases v3 commit hash
💡 Result:
Do you mean a specific v3.x release (e.g., v3.10.1, v3.9.2)? The releases page shows each v3 tag with its commit short hash (for example: v3.10.1 → 7e8b541, v3.10.0 → d7543c9, v3.9.2 → d58896d). Which exact tag do you need the full commit SHA for? (github.com)
Citations:
🏁 Script executed:
# Check for other uses of this action in the repository
rg "cosign-installer" --type yamlRepository: liquibase/docker
Length of output: 42
🌐 Web query:
sigstore cosign-installer v3.10.1 latest release commit hash github
💡 Result:
The v3.10.1 release points to commit 7e8b541. [1][2]
Sources:
[1] sigstore/cosign-installer release v3.10.1 (GitHub).
[2] sigstore/cosign-installer commit 7e8b541 (GitHub).
🌐 Web query:
site:github.com/sigstore/cosign-installer releases v3
💡 Result:
I searched the repo. Key results:
- cosign-installer releases page on GitHub (Releases listing). [1]
- README in sigstore/cosign-installer showing example use with cosign v3 (example uses cosign-release: 'v3.0.2'). [2]
Sources:
[1] https://github.com/sigstore/cosign-installer/releases
[2] https://github.com/sigstore/cosign-installer (README)
🌐 Web query:
sigstore/cosign-installer commit 7e8b541 full SHA
💡 Result:
I couldn't find that commit hash with the info given. Do you mean the GitHub repo sigstore/cosign-installer on GitHub and the commit prefix 7e8b541 on branch main (or another branch/tag)? If so I can search GitHub directly — confirm the repo/branch and I'll return the full SHA.
🌐 Web query:
"sigstore/cosign-installer" "v3.10.1" full commit SHA github
💡 Result:
The full commit SHA for sigstore/cosign-installer tag v3.10.1 is 7e8b541eb2e61bf99390e1afd4be13a184e9ebc5. [1][2]
Sources:
[1] GitHub release v3.10.1 (sigstore/cosign-installer).
[2] Commit patch for 7e8b541 (shows full SHA).
Pin Cosign installer action to a commit hash.
The sigstore/cosign-installer@v3 action uses a floating tag instead of a commit hash, weakening supply chain security guarantees. Pin to the full commit SHA of the latest v3 release: sigstore/cosign-installer@7e8b541eb2e61bf99390e1afd4be13a184e9ebc5 (v3.10.1).
🧰 Tools
🪛 GitHub Check: CodeQL
[warning] 322-322: Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Release Extension (v2)' step Uses Step uses 'sigstore/cosign-installer' with ref 'v3', not a pinned commit hash
🤖 Prompt for AI Agents
.github/workflows/create-release.yml around line 322: the workflow references
sigstore/cosign-installer@v3 (a floating tag); update the action reference to
the provided pinned commit SHA by replacing sigstore/cosign-installer@v3 with
sigstore/cosign-installer@7e8b541eb2e61bf99390e1afd4be13a184e9ebc5 (v3.10.1) so
the workflow uses the exact commit; commit the change and rerun CI to ensure the
workflow executes correctly.
Summary
Adds supply chain security features to Liquibase Secure Docker images for SLSA Level 3 compliance:
Changes
.github/workflows/create-release.yml- Add SBOM, provenance, and Cosign signing for secure images onlyREADME.md- Add "Verifying Secure Images" documentation sectionKey Details
liquibase-secure-release(Community images unchanged)Verification Commands
🤖 Generated with Claude Code