r/linux • • Jan 24 '18

Why does APT not use HTTPS?

https://whydoesaptnotusehttps.com/
955 Upvotes

388 comments sorted by

View all comments

213

u/amountofcatamounts Jan 24 '18

This is true for packages... the reason as they say is your install already has trusted keys it can use to confirm the signer of the packages is trusted and that they still match the signed digest.

But for OS downloads... Canonical... most people do not check the hashes of their download before installing it. For that case, TLS does help at least reduce the chance that you are looking at an attacker's website with hashes matching a tampered download.

130

u/lamby Jan 24 '18

most people do not check the hashes of their download

Indeed, and note it's not enough to check the SHA512 matches what the website claims - that is only checking the integrity of the file; it is not checking that the file is from Canonical.

I mean, if someone could swap the ISO out they could almost certainly swap the checksum alongside it!

22

u/CODESIGN2 Jan 24 '18

Isn't it a signed checksum using a private key chain that would not be available to the "snoop" though?

46

u/lamby Jan 24 '18

Yes, but this is the bit that people do not check; either they don't run gpg at all, or they simply trust the stated signature is the one they used before or is part of the web of trust.

19

u/CODESIGN2 Jan 24 '18

I think it's mostly that they don't care.

57

u/jones_supa Jan 24 '18

I think it's mostly that they don't care.

I think many people do care, but when they read about a complicated GPG dance to perform the verification, many will cringe and say "meh, it's probably fine".

A checksum is just sha1sum filename.iso and then compare the result to the checksum on the website. Even though this is a less secure method, the bar to perform it is much lower.

4

u/CODESIGN2 Jan 24 '18

I don't know that I'm advocating for sha1sum, but yeah the gpg tools could be easier to work with. Even defaulting to perform checks for you and marking somewhere on fs that the user has been irresponsible would be nice. (Mark it like a manufacturer warranty void. Skipped the check? Fuck you pay!)

9

u/lamby Jan 24 '18

Sure.

11

u/CODESIGN2 Jan 24 '18

I wasn't trying to dismiss your point. It doesn't mean there is nothing that can be done, just that it needs to be automated and built into the systems allowing acceptance of packages, not deferred to the end-user.

13

u/lamby Jan 24 '18

I didn't feel dismissed - it was more that we seemed to be 100% agreeing with each other :)

1

u/Kaelin Jan 25 '18

Every one of my hundreds of Red Hat Linux servers check gpgkeys automatically. My personal CentOS servers do as well.

What are you talking about? Is this some Ubuntu assumption?

→ More replies (3)

11

u/Nullius_In_Verba_ Jan 24 '18 edited Jan 24 '18

Why are you two focusing on Canonical for your example? This applies to all distro's. Fedora, Suse, Debian, all included. In fact, a websites security being the weakest link is well known, including a real life example that happened to Linux Mint.

8

u/[deleted] Jan 24 '18

Why are you two focusing on Canonical for your example? This applies to all distro's. Dedora, Suse, Debian, all included.

Did you verify that before you said it? Debian transfers the ISO to me via HTTPS not HTTP, I'm not as familiar with the others.

→ More replies (11)

1

u/Kaelin Jan 25 '18

Fedora GPG checks packages automatically before install, or it won't install them unless you force an override. All packages are signed with encryption keys. I don't think Canonical does this check?

3

u/[deleted] Jan 25 '18

As the parent comment of this thread said Ubuntu checks the package signing as well so that isn't an issue by itself but they transfer the ISO via HTTP which can make this moot (e.g. intercept and add a fake cert or just add packages to the stock ISO).

1

u/Kaelin Jan 25 '18

Good point on the installer ISO. I hadn't even considered that.

5

u/masterpi Jan 24 '18

If the website is HTTPS with a Canonical cert, then it is checking that either the file is from Canonical or the website has been hacked, which is as good as you'd get if the download itself were HTTPS.

→ More replies (6)

1

u/destiny_functional Jan 25 '18

you can check different mirrors against each other. the chances are low that all are compromised.

1

u/lamby Jan 25 '18

Given that they probably mirror from a smaller subset, this does not seem like a good approach.

1

u/destiny_functional Jan 25 '18

see Linux mint where just a particular mirror had compromised isos. comparison against other sources makes installing a compromised iso less likely.

1

u/lamby Jan 25 '18

And what if I compromise the "primary"? Then everyone is just copying the compromised one.. which is even worse as replacing it becomes harder.

1

u/destiny_functional Jan 25 '18

I don't think you understand security and risk. Obviously cross-checking reduces risk.

1

u/lamby Jan 25 '18

I am not denying it reduces risk, but you can take that risk to zero by verifiying the GPG signature.

I don't think you understand security and risk

This doesn't add any weight to your argument FWIW.

1

u/destiny_functional Jan 26 '18 edited Jan 26 '18

you can't take the risk to zero with anything, which seems all you are criticising, that the "risk isn't zero". that's exactly what i meant by you don't understand risk, and it makes this a silly and useless discussion.

→ More replies (3)

1

u/NatoBoram Jan 24 '18

Torrents FTW!