Skip to content

fix: add package signing - #28

Merged
jnfrati merged 3 commits into
mainfrom
feat/add-package-signing
Jul 22, 2026
Merged

fix: add package signing#28
jnfrati merged 3 commits into
mainfrom
feat/add-package-signing

Conversation

@jnfrati

@jnfrati jnfrati commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Description

Added signing for packages on fedora and debian registries

Fixes #27


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • RPM packages can now be cryptographically signed for both snapshot and tagged releases when GPG signing credentials are configured.
    • Tagged releases verify the produced RPMs before publishing.
  • Bug Fixes

    • Tagged builds now fail fast if required upload or signing credentials are missing.
    • Snapshot builds continue gracefully when signing credentials aren’t available, and any temporary signing materials are reliably cleaned up.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jnfrati, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 66f0cc83-342d-4a90-a164-cbf1590b0d8c

📥 Commits

Reviewing files that changed from the base of the PR and between 447ff15 and ee7d8ed.

📒 Files selected for processing (2)
  • .github/workflows/release.yml
  • scripts/verify-rpm-signatures.sh
📝 Walkthrough

Walkthrough

The release configuration now supports GPG-signed RPM artifacts. Snapshot and tagged workflows decode signing keys, pass signing credentials to GoReleaser, verify RPM signatures in Fedora 41, and clean up temporary key files.

Changes

RPM signing and release validation

Layer / File(s) Summary
GoReleaser RPM signing configuration
.goreleaser.yml
The RPM package definition reads the signing key path from GPG_RPM_KEY_FILE.
RPM signature verification
scripts/verify-rpm-signatures.sh
A configurable containerized script imports the repository public key and verifies that every binary RPM has a valid signature.
Snapshot and tagged release signing
.github/workflows/release.yml
Snapshot builds conditionally decode signing keys, while tagged releases require signing secrets; both pass credentials to GoReleaser, verify RPMs, and clean up temporary keys.

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

Sequence Diagram(s)

sequenceDiagram
  participant ReleaseWorkflow
  participant GoReleaser
  participant FedoraContainer
  ReleaseWorkflow->>GoReleaser: provide GPG_RPM_KEY_FILE and NFPM_PASSPHRASE
  GoReleaser->>ReleaseWorkflow: produce signed RPMs
  ReleaseWorkflow->>FedoraContainer: run rpm -K on produced RPMs
  FedoraContainer->>ReleaseWorkflow: return verification results
Loading

Poem

A rabbit signs RPMs bright,
Keys hop safely out of sight.
GoReleaser sends them on their way,
Fedora checks each one today,
Cleanup leaves the burrow light.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding package signing support.
Description check ✅ Passed The description states the signing change and links the issue, but it omits the required Validation section.
Linked Issues check ✅ Passed The changes address issue #27 by signing Fedora RPMs and verifying signatures during release.
Out of Scope Changes check ✅ Passed The added workflow, GoReleaser, and verification script changes are all directly related to package signing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-package-signing

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.

@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 (1)
.goreleaser.yml (1)

150-159: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Enable GoReleaser Pro for SRPMs
srpm: is Pro-only, so the OSS distribution: goreleaser release job won’t produce these packages until it runs with the Pro license/distribution.

🤖 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 @.goreleaser.yml around lines 150 - 159, Update the GoReleaser configuration
around the srpm section so SRPM packaging runs through a GoReleaser Pro-enabled
distribution or release job. Ensure the job uses the Pro license/distribution
while preserving the existing SRPM package name, spec_file, import_path, and
signing configuration.
🤖 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/release.yml:
- Around line 393-423: Ensure RPM signature verification fails when no .rpm
files are present, rather than exiting successfully with status 0. Update both
duplicated “Verify RPM signatures” flows, preferably by extracting the logic
into a shared scripts/verify-rpm-signatures.sh invoked by each job; track
whether at least one RPM was checked and set a nonzero exit status when none are
found, while preserving existing invalid-signature failures.

---

Outside diff comments:
In @.goreleaser.yml:
- Around line 150-159: Update the GoReleaser configuration around the srpm
section so SRPM packaging runs through a GoReleaser Pro-enabled distribution or
release job. Ensure the job uses the Pro license/distribution while preserving
the existing SRPM package name, spec_file, import_path, and signing
configuration.
🪄 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: CHILL

Plan: Pro

Run ID: 912270d4-76dd-4975-a278-8a98fb46345f

📥 Commits

Reviewing files that changed from the base of the PR and between cee948a and 14542d5.

📒 Files selected for processing (2)
  • .github/workflows/release.yml
  • .goreleaser.yml

Comment thread .github/workflows/release.yml
jnfrati added 2 commits July 20, 2026 17:46
The SRPM is only attached to the GitHub release and never published to
the yum repository, so it does not need a signature for gpgcheck. Drop
its signing config and skip src.rpm files in the verification step.
The inline verify loop exited 0 when dist/ contained no RPMs at all: an
unmatched glob stays literal, fails the -f test, and the loop body never
runs, so an empty dist "passed" while verifying nothing. Extract the
duplicated snapshot/release step into scripts/verify-rpm-signatures.sh
and fail unless at least one binary RPM was checked.
@jnfrati
jnfrati force-pushed the feat/add-package-signing branch from 447ff15 to ee7d8ed Compare July 22, 2026 07:18
@jnfrati
jnfrati merged commit 1c1e87d into main Jul 22, 2026
2 of 3 checks passed

@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

🤖 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 `@scripts/verify-rpm-signatures.sh`:
- Line 17: Update scripts/verify-rpm-signatures.sh to validate the downloaded
RPM signing key against a pinned fingerprint or digest before invoking rpm
--import. Apply the check to the key source selected by RPM_PUBLIC_KEY_URL,
reject mismatches, and preserve the existing import flow only for the verified
key.
🪄 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: CHILL

Plan: Pro

Run ID: 919745f9-da3d-4730-9cee-5da7de06e448

📥 Commits

Reviewing files that changed from the base of the PR and between 1089298 and 447ff15.

📒 Files selected for processing (2)
  • .github/workflows/release.yml
  • scripts/verify-rpm-signatures.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/release.yml

repo_root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
dist_dir=${1:-$repo_root/dist}
fedora_image=${FEDORA_IMAGE:-fedora:41}
key_url=${RPM_PUBLIC_KEY_URL:-https://pkgs.netbird.io/yum/repodata/repomd.xml.key}

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 | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

git ls-files scripts/verify-rpm-signatures.sh
wc -l scripts/verify-rpm-signatures.sh
cat -n scripts/verify-rpm-signatures.sh | sed -n '1,120p'

Repository: netbirdio/network-manager-vpn-plugin

Length of output: 2994


🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n --hidden --no-heading -S 'RPM_PUBLIC_KEY_URL|repomd\.xml\.key|rpm --import|gpg|fingerprint|sha256|signing key|NetBird yum repository key' .

Repository: netbirdio/network-manager-vpn-plugin

Length of output: 1727


Pin the RPM signing key identity before import. RPM_PUBLIC_KEY_URL is trusted as-is, so a bad redirect or compromised endpoint can make forged RPMs pass this gate. Validate a pinned fingerprint or digest before rpm --import.

🤖 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 `@scripts/verify-rpm-signatures.sh` at line 17, Update
scripts/verify-rpm-signatures.sh to validate the downloaded RPM signing key
against a pinned fingerprint or digest before invoking rpm --import. Apply the
check to the key source selected by RPM_PUBLIC_KEY_URL, reject mismatches, and
preserve the existing import flow only for the verified key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Package is not signed on Fedora

1 participant