FS#5331 - Signed packages
Attached to Project:
Pacman
Opened by Mikael (mhakali) - Friday, 01 September 2006, 11:08 GMT
Last edited by Dan McGee (toofishes) - Saturday, 11 February 2012, 21:52 GMT
Opened by Mikael (mhakali) - Friday, 01 September 2006, 11:08 GMT
Last edited by Dan McGee (toofishes) - Saturday, 11 February 2012, 21:52 GMT
|
Details
Hi!
I have noticed that the single most vulnerable point of archlinux (assuming you trust the developers) is that any mirror can be hacked and injected with various packages, and there would be virtually no way for an end user to notice this. As pacman would accept the local list of packages and the package downloaded/installed. And if someone noticed it it'd be too late either case. This also means that users need to have some sort of trust to the mirror of their chosing. Many wouldn't even consider it probably. Others would trust their gut feeling. Or use the (almost terribly slow, for us sweedes) ftp.archlinux.org. As I just set up my new public archlinux mirror it hit me that there is not any way that I can genuinly garuntee my users that my packages are safe and unmodified, more than users doing sample tests now and then. (If you need a pretty fast Swedish mirror, read at http://bbs.archlinux.org/viewtopic.php?t=24666 :)). Signed packages would solve these problems. The signatures can be verified by a public key which the developers intergrate so any package going up for publishing will need a signature. The signatures can preferably be stored in the resperatory database file (current.db.tgz etc) and verified by pacman upon install. If a user choose to trust other developers than the main they should be able to add their public keys to pacman's database aswell. pacman -Ka /home/data/key.pub, or smthing. Now here comes the best part; the code is already fully developed :) Intergration with gnupg will assure this kind of verification to be easily in to place. Hit me back with comments and/or suggestions. |
This task depends upon
Closed by Dan McGee (toofishes)
Saturday, 11 February 2012, 21:52 GMT
Reason for closing: Implemented
Saturday, 11 February 2012, 21:52 GMT
Reason for closing: Implemented
http://bugs.archlinux.org/task/4633
http://bugs.archlinux.org/task/4633#comment9788
Someone gets gpg keys for archlinux.org and community , possible the other arch sites also.(should be the person who is owner of the domain, probably judd)
Devs and TUs get personal gpg keys.
The keys are registered with a free certificate authority like CAcert
(Aside from the pgp signing this will also allow https for the registered sites and such)
see also CAcert on wikipedia
The CAcert root certificate and public arch/dev/tu keys are published on archlinux.org for download with instructions to put them in a specific place.
(could be put in a separate package also, not sure if that's a good idea)
makepkg gets a new array with 2 options :
sign=(arch personal)
binary packages that have sign=(personal) will be signed locally with the personal key by makepkg, before upload.
In the repos the sign=() values for packages need to be added to the repo-db.
After uploading the repo maintenance software for current/extra/testing/unstable/community checks for sign=(arch) and signs all marked packages with the archlinux private key.
Immediately after downloading pacman checks the db for sign values and controls if the packages are signed correctly.
Note 1
it may be a good idea to get separate gpg keys for archlinux.org and community
Note 2
this doesn't need to be done all at once, there could be several stages.
It would probably be a good idea if this was organized as a project lead by an arch-developer.
Note 3
Also posted on forum : http://bbs.archlinux.org/viewtopic.php?id=35609 , post #7
ftp://ftp.archlinux.org/core/os/i686/core.db.tar.gz
You need to download a
ftp://ftp.archlinux.org/core/os/i686/core.db.tar.gz.asc file
and then just
gpg --verify core.db.tar.gz.asc core.db.tar.gz
if the exit status is not 0, the core.db.tar.gz is not to be trusted and should be discarded.
The package database file contains the MD5 checksums of the packages so it covers changing packages too.
The only this is need for a little setup on the user part, ie.:
wget -O - httpS://archlinux.org/GPG-KEY | gpg --import
So the patches and code are not the main issue I think...
The question is if the ArchLinux maintainers are ready for a more strict security policy! Obviously the private gpg key must be strongly guarded, and there should be a process of puting packages in the repos.
you could always create a little script to handle downloads(that calls wget, etc. does it itself...)
make that the xfer* in pacman.conf
this script would check the fiel type being requested, and if t's a db.tar.gz,
and download it from archlinux.org
it comes with issues if the mirrors are will out of sync. but in my mind it works ;)
what do you mean "too drastic"? where do you expect to appear problems with that?
I just don't see how a distro in modern day can condole the trust of individual mirrors.
We have a mirror with about ~10k unique (archlinux) users. Injecting a backdoored package would probably go unnoticed. Or for the manner if someone hacks it. How can you as (seemingly being) users motivate this risk? This btw goes for any mirror of course.
mathewbauer: You will need to sign at a central place where the packages are released. Signatures per mirror will not move the place of trust. It should be mandatory and implemented per default. But of course users could just ignore the signatures with a custom pacman. Or a spacial parameter to pacman.
Just my few cents.
Btw; if you look for some distro signing packages you should look closer at RPM / DEB based ones. Mainly Ubuntu, Debian, RedHat, CentOS, OpenSuSE, SuSE, Mandrake and family. There's plenty of flexbility in forks of them. And the package manager actually *scales* for a growing package number. Where as pacman imho don't.
enabled by default. I don't consider this to be just some low-priority
wishlist item, only "nice to have" -- the failure to provide integrity
verification of downloaded packages / meta-data directly affects the
security of all Arch installations out there and certainly rules out Arch
for any kind of serious, real-life purposes.
If you're not providing any forward motion here, you're just being irritating. One more "me too" comment isn't going to help.
Open source software is what it is because of contributors - not because of people voicing their silly little opinions.
and I really appreciate all the hard volunteer work that has been
put into Arch and pacman in particular.
I'd really like to see package signing becoming a reality, and I
don't think that a flameware will help achieving this.
Could anyone shed some light on the state of things, Dan perhaps?
What was the problem with the 2008 effort of Pierre Carrier? Is
all that's needed some good patches and a bit of testing or are
there fundamental problems on the conceptual level?
To everyone else on this bug- your comments simply dissuade those that want to work on this from getting things done because 1) they have to wade through your propaganda and 2) they will be too afraid to mess up. So please don't think you are helping. Honestly, Aaron and I care very little about making this distro popular, so we aren't looking to ride the happy train to the Distrowatch #1 spot here. So if you think your threats of leaving the distro help, you're wrong.
http://code.toofishes.net/cgit/dan/pacman.git/log/?h=gpg
http://code.toofishes.net/cgit/dan/pacman.git/log/?h=gpg-more
http://code.toofishes.net/cgit/dan/pacman.git/log/?h=gpg-tools
http://code.toofishes.net/cgit/xavier/pacman.git/log/?h=gpg
Dan, do you happen to have any links or pointers to answer the "why this isn't merged" question?
How about we merge Dans gpg-tools and maybe gpg branches to pacman master. They are fairly finished sections of code and I think fairly set in how they are going to be (I have reviewed them at least twice in the past looking into this). After that, we would be able to sign packages/databases and pacman can read in those signatures. That would leave the verification and frontend to be done (started on gpg-more).
I think this would give visibility to what needs finished and maybe (unlikely...) encourage more contributors.
I do want to thank you for such an awesome distribution! I love pacman! I even liked it better than Yum! I have not had the opportunity to play with emerge (Gentoo) yet so I have no basis for comparison there. Honestly, there was so much that impressed me about Arch that I would not know where to begin. I am not posting this to criticize the lack of gain towards this endeavour in a negative manner. I just REALLY hope to see this, above anything else on the Arch plate, happen since this one missing feature completely eliminates Arch as an option for everyday use or as a main OS for the average user. Incidentally, a quick Google search will demonstrate that there would be a LOT more Arch users if this feature were implemented.
Oh, and regardless of what OS I am running at the time I will DEFINITELY be running Arch again as soon as this feature is implemented in a "moderately" secure manner. Thank you all for all of the hard work and for an awesome (perhaps the most awesome that I have ever used) Linux distribution! I really hope to use it again soon! Heck, I am tempted to install Arch again in the VM just for kicks! It really was that fun!
NOTE: I highly recommend that ANYONE who is considering trying Arch out do so! Even if you do not want to run it as your main still install it in a VM as you will definitely learn a lot about Linux in general that you did not know. And when you run in to trouble there is a ton of people on the Arch IRC channel ready and willing to assist! I mean it when I say that I love this distro!
https://korg.wiki.kernel.org/index.php/Gsoc2010:ideas
http://projects.robescriva.com/projects/show/chasm
It's something at least!
Consider this my $0.02. I think there's some sort of curse on archlinux and package signing. There seems to be a lack of dedication. That's the problem in my view. So, an ultimatum *has* to be thrown into the equation, which is this: Should Archlinux implement package signing / package security, or should the idea be thrown into /dev/null?
It isn't really so hard to add some insecure "snake-oil" GPG signature to repository and provide public key.
I think this would be an act of good will and will encourage people to start working (and testing) on this issue seriously. :-)
In the mean time, while updates are not secure, would be nice to at least be able to update through https instead of plain http or ftp.
1. read the original bug submission
2. answer question: is this fixed?
Answer is no. We need no "philosophical" fixing, lease re-open
I need to setup and maintain several systems and my concern is that under specific requirements I cannot use Arch Linux because "some" packages are unsigned, that's why I think it's not closed. I will carefully examine this bug report and eventually open another one if I can better define it.
Maybe I should investigate how to forcibly disable unsigned packages; thanks for your pro tip.
The is already a TODO list for Arch with the remaining unsigned packages on it so no need for another bug report.