Replace clearsigned checksum files with detached signatures. #13177
Labels
No labels
after freeze
automation
backlog
blocked
change-ack
change-nak
change-noreleng
changes
Closed As
Can't Fix
Closed As
Duplicate
Closed As
Fixed
Closed As
Fixed with Explanation
Closed As
Get back later
Closed As
Grooming
Closed As
Insufficient data
Closed As
Invalid
Closed As
It's all good
Closed As
taiga
Closed As
upstream
day-to-day
dev
docs
easyfix
epel
f26
f27
f28
f29
f30
f31
f32
f33
f34
f35
f36
f37
f38
f39
f40
f41
f42
f43
f44
f45
fedora
groomed
high-gain
high-trouble
in-progress
in-review
investigation
legal
low-gain
low-trouble
mass rebuild
medium-gain
medium-trouble
meeting
mini-initiative
new_artifact
ops
pdc_retirement
rawhide
RCA
review
script
sidetarget
sprint-0
sprint-1
sprint-2
sprint-3
sprint-4
sprint-5
unfrozen
waiting on external
Backlog Status
Needs Review
Backlog Status
Ready
chore
documentation
points
01
points
02
points
03
points
05
points
08
points
13
Priority
High
Priority
Low
Priority
Medium
Sprint Status
Blocked
Sprint Status
Done
Sprint Status
In Progress
Sprint Status
Review
Sprint Status
To Do
Technical Debt
Work Item
Bug
Work Item
Epic
Work Item
Spike
Work Item
Task
Work Item
User Story
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
releng/tickets#13177
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the issue
For verifying downloaded ISO files and other installation images, the Fedora Project offers *-CHECKSUM files where a hash is signed with a so-called cleartext signature. These checksum files should be replaced with detached signatures.
Why cleartext signatures should not be used
It has long been known that cleartext signatures are full of pitfalls. They're called "clear" because you can read the text without running it through a crypto program first – but the text you see might not be the text that was actually signed. There are various ways to trick a non-expert or a script into accepting an unsigned piece of text as signed and trustworthy. Now https://gpg.fail/notsoclear adds to the pile, showing a way to construct a malicious text that looks virtually indistinguishable from a genuine clearsigned text even to an experienced user.
Verification of a cleartext signature must be done exactly right to be secure. The intuitive way is not the secure way. Pretty much everybody gets it wrong. And the secure way negates the cleartext aspect, making the whole clearsigning concept pointless.
Werner Koch also tells you to avoid cleartext signatures:
https://gnupg.org/blog/20251226-cleartext-signatures.html
Unnecessary complexity
A PGP signature is a signature of a hash of the data. The added
sha256sumstep makes it a signature of a hash of a hash of the ISO file. Double hashing is unnecessary. Users have to do two verification steps instead of one for no good reason.What to do instead
Instead of hashing an ISO file and signing the hash, make a detached signature of the ISO file. Detached signatures are much easier to verify correctly. The basic command is:
(Or use some equivalent Sequoia command.) Keep the same
--keyringor--local-useror whatever options that are currently used to specify the signing key.The verification instructions on the website will become simpler and safer. Instead of telling users to do
the website will tell them to do
That's easier for the user, with much lower risk of getting it wrong in insecure ways.
It's acceptable to also present a hash value for users who want to disregard security but check for accidental file corruption. The hash should not be signed, because users who want security should verify the ISO file with the detached signature.
When do you need this?
Preferably next time some installation images are released. Would that be F44 beta? Otherwise, the next release after that, and so on.
When is this no longer needed or useful?
N/A
If we cannot complete this, what is the impact?
The Fedora Project continues to participate in the cargo cult of clearsigned checksum files. Verifying downloads continues to be unnecessarily difficult, which causes security risks for users.
Checklist
I don't think there's anything wrong with also signing the CHECKSUM files. But yes, signing the actual images makes sense.
These should be relatively easy to do since Sigul is supposed to support detached signatures. I believe @jcline has this working with siguldry.
@ngompa wrote in #13177 (comment):
It's bad because it promotes the notion that all the cool kids do clearsigned checksum files. Everybody should stop clearsigning.
I suppose detached signatures of checksum files wouldn't hurt, but what would anyone use that for if there's a signature of the image file itself?
There's no need to wait for siguldry... sigul as it is supports it:
We need to make sure there's no gotchas/investigate why this wasn't done a long time ago...
@kevin wrote in #13177 (comment):
Indeed, and it definitely works (see, for example, #13176). W just need to wire it up in robosignatory to happen automatically. I could probably slap something together if someone with write access to https://pagure.io/robosignatory/ is open to merge it.
Well, we currently do not autosign CHECKSUM files, we only sign them when there's going to be a release using them.
That uses this script:
https://forge.fedoraproject.org/releng/tooling/src/branch/main/release-process/staging/stage_release_checksum_sign.sh
My worry here is that sigul has to transfer the entire image over to generate the signature and thats a lot of data to sling around.
@kevin wrote in #13177 (comment):
Even easier, then. Yeah. It'll definitely be slow, but I didn't spot any obvious gotchas (it should stream the image to a temporary file and so on). I've got a CI setup for sigul so I can test it if you've not got an easy test environment available; obviously it'll all be local but that should give you an idea of how it'll perform.
FWIW I believe this won't be a problem with siguldry as I've implemented a PKCS11 module for siguldry that hashes the content client-side. It just sends the digest over the network, and in theory Sequoia is getting support for signing via PKCS11 so you'll be able to sign directly with the
sqCLI.If you have a setup easily able to test that would be great!
@kevin wrote in #13177 (comment):
Okay, I wrote a quick test and checked this. You'll need to change the server configuration for
max-file-payload-size(which is set in bytes and defaults to 1GB). It's horribly slow, a 4GB file took 284.295s, but the CI environment turns on debug level logs for the server and it definitely spent a large amount of effort writing logs.Yeah, it's going to be slow and a compose has... a lot of large images, etc.
I guess the next test would be to test signing a large image in our infra and see how bad it is there.
@jnsamyak can you do that?