Skip to content

refactor: streamline ephemeral GPG key generation and signing process#49

Open
alexlovelltroy wants to merge 6 commits intomainfrom
feature/refactor-signing
Open

refactor: streamline ephemeral GPG key generation and signing process#49
alexlovelltroy wants to merge 6 commits intomainfrom
feature/refactor-signing

Conversation

@alexlovelltroy
Copy link
Copy Markdown
Member

This pull request updates the RPM build GitHub Actions workflow to improve security and automation by switching to ephemeral GPG keys for signing and modernizing variable usage and output handling. The changes eliminate the need for long-lived signing credentials and streamline the build and release process.

Security and GPG Key Management:

  • Replaces importing a static GPG private key with generating an ephemeral GPG key for each build using the OpenCHAMI/gpg-signing-manager action. The ephemeral key is configured with a 1-day expiration and unique metadata per run. [1] [2]
  • Updates all signing steps (source tarball and RPMs) to use the ephemeral key's fingerprint, removing dependencies on static secrets and passphrases.
  • Adds a step to export the ephemeral public key for distribution, replacing the previous export of a static public key. [1] [2]

Workflow Modernization and Output Handling:

  • Refactors output variable usage to use the new GITHUB_OUTPUT mechanism instead of deprecated set-output, and consistently uses the dynamically determined version from the get_version step. [1] [2]
  • Updates conditional steps and asset naming to reference the dynamically determined version, ensuring consistency throughout the workflow.

Build Process Improvements:

  • Simplifies the source tarball creation by removing unnecessary transformations and using the correct version variable.

These changes increase the security of the RPM build pipeline and align the workflow with current GitHub Actions best practices.

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
…GPG configurations

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
…t and documentation

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
Copy link
Copy Markdown
Contributor

@synackd synackd left a comment

Choose a reason for hiding this comment

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

I might be missing something, but I don't see gpg-ephemeral-key used here. Was that intentional?

…and removing subkey expiration check

Signed-off-by: Alex Lovell-Troy <alovelltroy@lanl.gov>
@alexlovelltroy
Copy link
Copy Markdown
Member Author

It is using parts from the gpg signing machinery. At this point, it is not doing ephemeral keys and is instead signing with the repo key. See build-rpm.yaml:

Copy link
Copy Markdown
Contributor

@synackd synackd left a comment

Choose a reason for hiding this comment

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

At this point, it is not doing ephemeral keys and is instead signing with the repo key.

Got it, just wanted to make sure.

This looks reasonable to me. Just one comment below.

Comment on lines -83 to +75
mkdir -p ~/rpmbuild/SOURCES/openchami-${{ env.VERSION }}
cp -r ./* ~/rpmbuild/SOURCES/openchami-${{ env.VERSION }}/
tar -czf ~/rpmbuild/SOURCES/openchami-${{ env.VERSION }}.tar.gz \
-C ~/rpmbuild/SOURCES openchami-${{ env.VERSION }} \
--transform "s|openchami-${{ env.VERSION }}-${{ env.COMMIT_SHA }}|openchami-${{ env.VERSION }}|"
mkdir -p ~/rpmbuild/SOURCES/openchami-${VERSION}
cp -r ./* ~/rpmbuild/SOURCES/openchami-${VERSION}/
tar -czf ~/rpmbuild/SOURCES/openchami-${VERSION}.tar.gz \
-C ~/rpmbuild/SOURCES openchami-${VERSION}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we want to replace ${VERSION} here with ${{ steps.get_version.outputs.version }} here so we can get rid of the echo "VERSION=${VERSION}" >> $GITHUB_ENV above? Just to reduce redundancy. I noticed that the latter is used below, but there is still some mixing of the two.

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.

2 participants