-
Notifications
You must be signed in to change notification settings - Fork 166
https by default #615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
https by default #615
Conversation
debos doesn't actually set a default if the user doesn't provide one; clarify that the current default mirror for mmdebstrap is defined in that tool and avoid referring to the current effective default as it might change in mmdebstrap. Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
While the current man page and examples showcase deb.debian.org with https, debos defaults to http for the Debian debootstrap mirror. This default made sense for Debian and debos years ago for client performance, server load and caching friendliness, but it compromised privacy and can be seen under a bad light when looking at it from a cybersecurity standpoint. Change the default Debian mirror (deb.debian.org) from http to https. Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
Use secure https:// links instead of http:// links wherever possible. Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
|
For mmdebstrap, we could actually override its defaults to have debos guarantee https sources.list in its default configuration – let me know if you want me to send that change. |
|
I realize this PR might seem petty, I'm sending this because of the result of an actual cybersecurity assessment of an image based of qcom-deb-images :) |
|
The suggested url by deb.debian.org is http, not https ; I'd be curious to know what the assesments is, in the end the signing/validation is done by the gpg checks tracking back to the packages file, not by the network transport. when building for non-native architectures using https can also cause image builds to be quite a bit slower as the whole encryption is emulated |
When you say the suggested url, you reference the text file hosted on deb.debian.org itself? Pretty much all Debian tools had defaulted to http in the past, it's the only effective way to get caching: with https, apt has to establish an end to end encryption to a hostname with that cert's subject name, so either one has some use some tricks like http://HTTPS/// (apt-cacher-ng) or setup a root CA to do SSL interception. Yes, the debian archive is securely delivered over http as the indices are GPG signed and there is a timestamp (valid until) to prevent replay attacks. What was brought up in the security assessment that trigger my proposed changes is a lack of confidentiality: I can observe the software being installed on this or that system. It's minor, but valid, and http traffic will generally trigger alerts.
Yeah, SSL at a large scale is costly for client and server (I guess we don't care too much about Fastly), good point about QEMU. I guess it's a classical example of security vs practicality: http is generally nice for performance and caching, but will trigger security reviews and leak some data about systems. :-/ One thing we discussed with Robie for qcom-deb-images is to have an easy flag to override the mirror at build time, but keep https in the target images. |
Yeah; Also:
The reason we set a default mirror for debootstrap is mostly historical as some versions would misbehave without it (iirc invalid apt sources list). That's something we could probably drop now so we just use the defaults for mmdebstrap/debootstrap.
Ack; it's also why debos support propagate proxy environment settings as some use that for caching.
Agreed; This is one of those fuzzy areas and i can see both sides of. Though I'd prefer Debian to take the lead here and debos following the defaults.
That makes total sense!. For this PR, we can merge the non-debootstrap commits. Is not setting a default debootstrap mirror something you'd like to look at? |
obbardc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
following Sjoerd's comments
| - mirror -- URL with Debian-compatible repository | ||
| If no mirror is specified debos will use http://deb.debian.org/debian as default. | ||
| If no mirror is specified debos will use https://deb.debian.org/debian as default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| If no mirror is specified debos will use https://deb.debian.org/debian as default. | |
| If no mirror is specified the default mirror of debootstrap will be used |
| d.Components = []string{"main"} | ||
| // Set generic default mirror | ||
| d.Mirror = "http://deb.debian.org/debian" | ||
| d.Mirror = "https://deb.debian.org/debian" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use debootstrap default mirror
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but there is also the part where we write /etc/apt/sources.list using this mirror which needs some attention.
This mainly changes the default Debian mirror for the debootstrap action to use https instead of http, and switches to https in a few more places.
The only remaining file with http:// URLs is the Apache 2.0 license, but it's probably a bad idea to patch it for compliance tooling to work.