Skip to content

Require and verify file (IMA) signatures for selected platforms - #183

Open
anfimovdm wants to merge 1 commit into
masterfrom
issue-546-require-file-signatures
Open

Require and verify file (IMA) signatures for selected platforms#183
anfimovdm wants to merge 1 commit into
masterfrom
issue-546-require-file-signatures

Conversation

@anfimovdm

Copy link
Copy Markdown
Contributor

Summary

Part 2 of AlmaLinux/build-system#546. Requires AlmaLinux/albs-web-server#1252 to be deployed first.

New require_files_signature_platforms config 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

  • Force signing — if any RPM in a sign task belongs to a listed platform, file signing is forced even when the payload says sign_files: false.
  • Verify after signing_check_signature() gained a NO_FILE_SIGNATURE status: packages of listed platforms are checked for RPMTAG_FILESIGNATURES and the task fails before upload with Package … does not contain file (IMA) signatures. A task spanning listed and unlisted platforms only enforces the check on listed-platform packages.
  • No false positives — only regular, non-%ghost files must carry signatures, so metapackages (e.g. basesystem) pass.
  • Fail loudly on missing platform info — if the option is set but the payload carries no platform (older web server), the task fails with an explicit error instead of silently skipping the check.

Changes

  • sign_node/config.py — new require_files_signature_platforms option (list of strings, optional).
  • sign_node/signer.py_files_signature_required(), _check_file_signatures(), NO_FILE_SIGNATURE status, forced sign_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_signature error 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 makes rpmsign --signfiles fail the whole task. Upgrade order: web server first, then enable the option on the node.

🤖 Generated with Claude Code

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.
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.

1 participant