feat(deploy): implement signed packages verification and hardened extraction security - #1173
Conversation
|
thank you for your PR, I still saw you were working on this feature few weeks ago. It is definitively interesting. I took a quick look by now and I see few problems:
|
6cb207e to
4af59a0
Compare
|
Thanks for your quick feedbacks, we kindly took care of the contributing section of the project before pushing this MR. Concerning your feedbacks:
=> we reviewed the commits included in the branch and removed unwanted commits from develop.
=> My mistake.. this was a temporary file used to patch the spec file. I removed it. I force pushed the contrib branch with thoses changes, waited for green CI in my fork and returned to you with this comment. Regards |
|
I won't be able to review your PR before next release. But I'll do for possible inclusion in v1.19. |
|
I released v1.18 today. I'll now be able to take a deeper look on your PR. By now, this release includes few changes related to security issues in Deploy and even in Tools::Archive. I think the v1.18 changed code is not colliding yours, but can you rebase your PR against current develop branch and push forced again ? |
… packages This commit introduces cryptographic signature verification for deployment packages in the Deploy task. Key features: - Support for Ed25519 signatures using Crypt::Ed25519. - Added deploy-public-key configuration option. - Added tools/glpi-sign-package.pl to generate signed manifests. - Comprehensive test suite in t/tasks/deploy/signature.t. - Security checks against path traversal and hash mismatches.
This commit introduces the following security enhancements: - Added 'secure-extraction' configuration option (default to 'no'). - When 'secure-extraction' is enabled, the Archive tool rejects files with path traversal attempts (Zip Slip protection). - Hardened Deploy task: load the public key into memory before extraction to prevent archives from overwriting it and bypassing verification. - Added '--secure-extraction' support to the Linux installer. - Updated documentation in agent.cfg and Task/Deploy.pm. - Updated test suite to verify optional secure extraction.
…ign-package.pl - Fix argument order in Crypt::Ed25519::verify and sign calls. - Add support for PEM and PKCS#8 Ed25519 private keys in signing tool. - Fix path calculation bug in glpi-sign-package.pl during directory traversal. - Enhanced POD documentation for signing tool and Deploy task. - Added signing tool reference in CONTRIB.md. - Updated tests to match corrected argument order.
This ensures that the Crypt::Ed25519 module is included in the agent packages for macOS, Windows, Debian/Ubuntu, and RPM-based systems, enabling the signed packages verification feature out of the box.
If Crypt::Ed25519 is missing in the system Perl, the script will now automatically try to execute itself using the GLPI Agent bundled Perl (on Windows or macOS) to provide a seamless cross-platform experience.
…kages The libcrypt-ed25519-perl package is not available in older distributions (like Ubuntu Bionic 18.04), which breaks the AppImage build and prevents installation. Moved Crypt::Ed25519 from a strict Depends/Requires to Recommends/Suggests. The Deploy task already lazy-loads the module at runtime, so it will gracefully handle its absence unless package signature verification is actually used.
- Removed duplicated _movedll calls in Step 11 which caused 'movefile' to fail. - Cleaned up redundant module installation in Step 5. - Kept Crypt::Ed25519 for signature verification support.
- Extended glpi-sign-package.pl with --command option to sign shell commands. - Updated Deploy task to verify command signatures against signed manifest. - Fixed Windows build failure for Crypt::Rijndael by using -std=gnu17.
Added a "KEY GENERATION" section to the POD documentation explaining how to generate the required Ed25519 key pair using OpenSSL and extract the public key for the agent configuration.
Address review comments for Deploy.pm, SPEC, and test files.
4af59a0 to
9313c77
Compare
|
Hi @g-bougard, Thanks for your time and your feedback, I've just rebased and force pushed the branch as requested, |
Summary:
This Merge Request introduces a modern cryptographic signature verification mechanism for the Deploy task and enhances the security of the
package extraction process. It adds support for Ed25519 signatures to ensure the authenticity and integrity of deployment packages.
Key Features:
manifest before execution.
it on disk.
Technical Details:
bypass attempts, and path traversal).