Skip to content

security: pin all dependencies and add Renovatebot#228

Open
mipselqq wants to merge 4 commits into
mainfrom
security/217-actions-sha-pinning
Open

security: pin all dependencies and add Renovatebot#228
mipselqq wants to merge 4 commits into
mainfrom
security/217-actions-sha-pinning

Conversation

@mipselqq

@mipselqq mipselqq commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Related Issues

Closes #217

Summary

This PR pins all dependencies used in project:

    • GitHub Actions
    • Docker and Compose
    • TypeScript exact versions
    • Go, Python, Ansible Galaxy are already immutable
  • Replaces Dependabot with Renovatebot, which is more flexible and has better pinning suport.

  • Adds automatic dependency updates for Ansible, Python, TypeScript

Verification

  • Tests are green
  • No functional or versioning changes

Checklist

  • Code follows the style guidelines
  • Unit, E2E, integration tests, load/race tests added or updated
  • Documentation updated
  • No sensitive data committed

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request replaces Dependabot with Renovate, pins GitHub Actions to commit SHAs, and pins Docker images to SHA256 digests across build, deployment, and Compose configurations.

Changes

Dependency and Artifact Pinning

Layer / File(s) Summary
Renovate dependency management
.github/dependabot.yml, .github/renovate.json
Removes Dependabot rules and adds Renovate scheduling, update grouping, vulnerability handling, and custom Ansible dependency managers.
GitHub Actions SHA pinning
.github/workflows/deploy.yml, .github/workflows/generic-deploy.yml, .github/workflows/quality-check.yml, .github/workflows/release-drafter.yml
Replaces floating action tags with pinned commit SHAs across deployment, quality, and release workflows.
Container image digest pinning
Dockerfile, docker-compose.yml, docker-compose.prod.yml
Pins the Go builder image and Compose service images to SHA256 digests.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The workflows shown in the summary pin the GitHub Actions to SHAs, satisfying issue #217's acceptance criteria.
Out of Scope Changes check ✅ Passed The Renovate config and image pinning align with the stated PR goals, so no clear out-of-scope changes stand out.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title matches the main change: replacing Dependabot with Renovate and pinning dependencies for security.
Description check ✅ Passed The description is on-topic and summarizes the dependency pinning and Renovate changes, even if some details are broad.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mipselqq mipselqq added the security Hardening change label Jul 21, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 (2)
.github/workflows/generic-deploy.yml (1)

27-34: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Include the workflow file in the Ansible cache key.

Because the Ansible core and collection versions are defined directly in this workflow file (lines 39-40), Renovate will update them here. However, the current cache key only hashes infra/ansible/server-setup-ubuntu.yml.

When Renovate bumps the versions in this workflow, the cache key will not change, leading to a cache hit that restores the old, stale dependencies and silently skips the installation of the new versions. Hash this workflow file alongside the playbook to ensure cache invalidation on dependency updates.

🐛 Proposed fix for the cache key
       - name: Cache Ansible
         id: cache-ansible
         uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9
         with:
           path: |
             ~/.local
             ~/.ansible/collections
-          key: ${{ runner.os }}-ansible-${{ hashFiles('infra/ansible/server-setup-ubuntu.yml') }}
+          key: ${{ runner.os }}-ansible-${{ hashFiles('infra/ansible/server-setup-ubuntu.yml', '.github/workflows/generic-deploy.yml') }}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/generic-deploy.yml around lines 27 - 34, Update the cache
key in the “Cache Ansible” step to hash both the workflow file containing the
Ansible version definitions and infra/ansible/server-setup-ubuntu.yml, ensuring
dependency version changes invalidate the cached Ansible dependencies.
.github/workflows/quality-check.yml (1)

63-64: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Pin the gofumpt version.

The PR objective states that Go dependencies are immutable, but gofumpt is installed using the @latest floating tag. This violates the pinning objective and introduces the risk of unexpected CI failures if a new version of gofumpt is released with updated formatting rules.

Please pin this to a specific version (e.g., @v0.7.0) to ensure deterministic formatting checks.

📌 Proposed fix
       - name: Install gofumpt
-        run: go install mvdan.cc/gofumpt@latest
+        run: go install mvdan.cc/gofumpt@v0.7.0
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/quality-check.yml around lines 63 - 64, Update the
“Install gofumpt” workflow step to replace the floating `@latest` tag with a
specific immutable gofumpt version, such as `@v0.7.0`, while preserving the
existing installation command.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/deploy.yml:
- Around line 30-33: Disable checkout credential persistence by adding
persist-credentials: false to the actions/checkout steps in
.github/workflows/deploy.yml lines 30-33 and 120-120,
.github/workflows/generic-deploy.yml line 15, and
.github/workflows/quality-check.yml lines 13, 26, 39, and 57; add or extend each
step’s with block as needed.

---

Outside diff comments:
In @.github/workflows/generic-deploy.yml:
- Around line 27-34: Update the cache key in the “Cache Ansible” step to hash
both the workflow file containing the Ansible version definitions and
infra/ansible/server-setup-ubuntu.yml, ensuring dependency version changes
invalidate the cached Ansible dependencies.

In @.github/workflows/quality-check.yml:
- Around line 63-64: Update the “Install gofumpt” workflow step to replace the
floating `@latest` tag with a specific immutable gofumpt version, such as `@v0.7.0`,
while preserving the existing installation command.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d2769a60-8ee8-4b93-a2aa-6405eb6b5fe8

📥 Commits

Reviewing files that changed from the base of the PR and between 939ea9a and 0bbb35d.

📒 Files selected for processing (9)
  • .github/dependabot.yml
  • .github/renovate.json
  • .github/workflows/deploy.yml
  • .github/workflows/generic-deploy.yml
  • .github/workflows/quality-check.yml
  • .github/workflows/release-drafter.yml
  • Dockerfile
  • docker-compose.prod.yml
  • docker-compose.yml
💤 Files with no reviewable changes (1)
  • .github/dependabot.yml

Comment on lines +30 to 33
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
fetch-depth: 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Disable credential persistence in checkout actions.

By default, actions/checkout persists the GITHUB_TOKEN to the local .git/config (persist-credentials: true). This is a security risk because any subsequent compromised step or malicious dependency inside the workflow could exfiltrate the token. Since these CI and deployment workflows do not need to push code back to the repository, you should disable this persistence to harden the pipeline against supply-chain attacks.

  • .github/workflows/deploy.yml#L30-L33: add persist-credentials: false under the with block.
  • .github/workflows/deploy.yml#L120-L120: add a with block containing persist-credentials: false.
  • .github/workflows/generic-deploy.yml#L15-L15: add a with block containing persist-credentials: false.
  • .github/workflows/quality-check.yml#L13-L13: add a with block containing persist-credentials: false.
  • .github/workflows/quality-check.yml#L26-L26: add a with block containing persist-credentials: false.
  • .github/workflows/quality-check.yml#L39-L39: add a with block containing persist-credentials: false.
  • .github/workflows/quality-check.yml#L57-L57: add a with block containing persist-credentials: false.
🧰 Tools
🪛 zizmor (1.26.1)

[warning] 30-32: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

📍 Affects 3 files
  • .github/workflows/deploy.yml#L30-L33 (this comment)
  • .github/workflows/deploy.yml#L120-L120
  • .github/workflows/generic-deploy.yml#L15-L15
  • .github/workflows/quality-check.yml#L13-L13
  • .github/workflows/quality-check.yml#L26-L26
  • .github/workflows/quality-check.yml#L39-L39
  • .github/workflows/quality-check.yml#L57-L57
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/deploy.yml around lines 30 - 33, Disable checkout
credential persistence by adding persist-credentials: false to the
actions/checkout steps in .github/workflows/deploy.yml lines 30-33 and 120-120,
.github/workflows/generic-deploy.yml line 15, and
.github/workflows/quality-check.yml lines 13, 26, 39, and 57; add or extend each
step’s with block as needed.

Source: Linters/SAST tools

@mipselqq mipselqq changed the title secirity: pin all dependencies and add Renovatebot security: pin all dependencies and add Renovatebot Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security Hardening change

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Pin CI actions with SHA

1 participant