Re: [Rpm-maint] [rpm-software-management/rpm] [RFC] rpmbuild, check: verify file hashes (PR #3039)

2024-04-19 Thread Panu Matilainen
Rpm already hashes any packaged content cryptographically (SHA256 by default), 
any such mechanism should utilize that to minimize the extra cost.

But this seems like a big extra cost with limited benefit, we're more 
interested in *preventing* writes across the different stages.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3039#issuecomment-2065842355
You are receiving this because you are subscribed to this thread.

Message ID: ___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm-software-management/rpm] [RFC] rpmbuild, check: verify file hashes (PR #3039)

2024-04-16 Thread norbert manthey
@nmanthey pushed 1 commit.

2c26ff0d2f023e24c65b57b1bc25256b5e8846e8  rpmbuild,check: verify file hashes

-- 
View it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3039/files/9c34a39a7716123e3ad2adf755db12f5db83dc98..2c26ff0d2f023e24c65b57b1bc25256b5e8846e8
You are receiving this because you are subscribed to this thread.

Message ID: 
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [rpm-software-management/rpm] [RFC] rpmbuild, check: verify file hashes (PR #3039)

2024-04-15 Thread norbert manthey
```
During the %check target, no files that existed before are expected to be 
modified. This change adds a validation to the rpmbuild command, which will 
store file hashes, and compare them after compilation again.

Note: this is only a simple demonstrator that cannot handle large projects, and 
it is using a very simply hash function.
```

### Note

This is a demonstrator to steer discussions. A fully functional variant would 
likely use a dynamic container to store the hashes, handle errors better, and 
use a more sophisticated hash function.

We are aware that there are ways around this validation and still modify build 
files from the %check phase.

This is one way to implement the requirement to have an immutable build root 
during rpmbuilds %check phase, as described in 
https://github.com/rpm-software-management/rpm/issues/3010

### Testing Done

I compiled the xz-utils package of Amazon Linux 2 in an Amazon Linux 2 
container image with this change. We also tested a malicious RPM that modified 
its build files during `%check`.
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/3039

-- Commit Summary --

  * rpmbuild,check: verify file hashes

-- File Changes --

M build/build.c (130)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/3039.patch
https://github.com/rpm-software-management/rpm/pull/3039.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3039
You are receiving this because you are subscribed to this thread.

Message ID: rpm-software-management/rpm/pull/3...@github.com
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint