Require and verify file (IMA) signatures for selected platforms - #183
Open
anfimovdm wants to merge 1 commit into
Open
Require and verify file (IMA) signatures for selected platforms#183anfimovdm wants to merge 1 commit into
anfimovdm wants to merge 1 commit into
Conversation
New 'require_files_signature_platforms' config option listing platform names whose packages must carry file signatures. When a sign task touches a listed platform: - file signing is forced even when the task payload says 'sign_files: false'; - after signing, packages of listed platforms are verified to carry file signatures (RPMTAG_FILESIGNATURES) and the task fails before upload if they don't; - packages with no regular files (metapackages, %ghost-only) produce no false positives; - if the payload carries no platform info (older web server), the task fails with an explicit error instead of silently skipping the check. Absent or empty option keeps current behaviour. Part 2 of AlmaLinux/build-system#546, requires the web server side (platform info in the sign task payload) to be deployed first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part 2 of AlmaLinux/build-system#546. Requires AlmaLinux/albs-web-server#1252 to be deployed first.
New
require_files_signature_platformsconfig option listing platform names whose packages must carry file (IMA) signatures. Absent or empty keeps current behaviour, so dev and community deployments are unaffected.Behaviour
sign_files: false._check_signature()gained aNO_FILE_SIGNATUREstatus: packages of listed platforms are checked forRPMTAG_FILESIGNATURESand the task fails before upload withPackage … does not contain file (IMA) signatures. A task spanning listed and unlisted platforms only enforces the check on listed-platform packages.%ghostfiles must carry signatures, so metapackages (e.g.basesystem) pass.Changes
sign_node/config.py— newrequire_files_signature_platformsoption (list of strings, optional).sign_node/signer.py—_files_signature_required(),_check_file_signatures(),NO_FILE_SIGNATUREstatus, forcedsign_files, per-platform verification set in_sign_build.node-config/sign_node.yml— documented the option.Testing
15 new tests in
tests/sign_node/test_signer.py: signed/unsigned regular files, missing signature header, metapackage with no regular files, ghost files, platform listed/not listed, missing platform info, non-RPM packages, and_check_signatureerror reporting. Full suite: 50 passed.Prerequisite for enabling
/etc/pki/ima/ima-sign.key(files_sign_cert_path) must be provisioned on target sign nodes before the option is enabled — a missing key makesrpmsign --signfilesfail the whole task. Upgrade order: web server first, then enable the option on the node.🤖 Generated with Claude Code