-
Notifications
You must be signed in to change notification settings - Fork 461
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
Support for storing apt keys in separate files #1034
Comments
Hello! 👋 This issue has been open for a while and has had no recent activity. We've labelled it with If you are waiting on a response from us we will try and address your comments on a future Community Day. Alternatively, if it is no longer relevant to you please close the issue with a comment. |
Yeah, the bot is right: Ubuntu 22.04 has already transitioned to the new style, so this should really get some attention. A bit more information can be found here: https://wiki.debian.org/DebianRepository/UseThirdParty |
It looks like this module already supports the I guess it's just a case of placing keys under It might be possible to remove the existing apt_key provider in favour of a simple |
|
BTW: https://discourse.ubuntu.com/t/spec-apt-deb822-sources-by-default/29333 Supporting deb822 format (like apt::deb822) would make the whole thing quite easy. Could be done with a template and two file resources (one for the repository definition file, one for the key). See sources.list(5) for the details. |
Tested on my Ubuntu 22.04.1 LTS box. Looks like this format is already supported and works in combination with the old format, but is not currently the default for Ubuntu. Until both distros switch to deb822 format, there may be some compatibility issues with other programs that interact with apt sources. But it does look like efforts are being to make this format default in the next stable release of both Debian and Ubuntu. Some more supporting docs for anyone interested in implementing this:
|
It is supported in Debian (and thus Ubuntu) since Stretch. From
|
Yes, a hard switch from one release to the other may break things. One could opt for continuing to support apt-key while bringing in the new way of providing a file as suggested. Meaning: defining something like "provider" defaulting to "file" and optionally answering to "aptkey". That is, if we continue to use something like apt::key. If you do separate key distribution by files, you can already do this and just ignore apt::key (e.g. apt::source's apt update will ofc work fine if the key file has been placed prior to its execution). And as to the "deb [ signed-by=/some/file ]" inside sources.list: I'd consider this optional, since in reality it also is: there are default locations for the keys. If keys are placed there, they are being used. apt::key (or whatever) should take this into account, too. |
No, |
Seems optional to me so far. See sources.list(5):
I've tried this out: If you place a keyring in /etc/apt/keyrings, you need to specify it through signed-by, if you place it (yes, a keyring file) in /etc/apt/trusted.gpg.d, you don't need to do that. The files in /etc/apt/trusted.gpg.d also don't result in a deprecation warning (unlike keys stored in /etc/apt/trusted.gpg e.g. through apt::key, this triggers on upgrades and so on). The apt-key manpage states:
I'd say this further validates my point - the only "but" here is it's the manpage of apt-key(8) which is to be deprecated. I wonder: if everything is supposed to switch away from even trusted.gpg.d (which would be the consequence of what you write), why are the distribution keyrings (Debian or Ubuntu maintainers) still in that very folder and the default sources.list does not use Signed-By? My ulterior motive here is adhering to all standards. One could argue if this is currently inconsistent by design, however, then Signed-By would be the (only) go-to option because whatever happens to trusted.gpg.d in the future this will work. |
Which OS/version? Ubuntu 22.04 already made the switch (and complains loudly about keys in Did you read the Debian wiki page linked above? It clearly says:
|
Debian 11 and Ubuntu 22.04. Did no verification on a testing branch yet.
Actually, no, to be honest (skipped past it somehow...). The Debian Wiki on securing apt and the Debian Manual in the respective section do not, but then again, some of the information there is rather dated, and the link above makes a quite strong point about the newly added keys in The apt changelog also complains about I tend to believe (I know, beliefs in engineering...) now that this switch is only to move away from storing everything in That is what caused my confusion here. Considering the wiki article cited by you and dhs-rec about Third Party Repository signing as best practice at the very least, I'd say I stand corrected and sorry for adding my confusion to this discussion. |
Don't forget basic authentication params for keys stored/mirrored in protected repos like JFrog. |
As per These releases are out for years now and with Debian 12 the first version with long term support that drops it, is out now for month too.
I have tested all these methods manually and they all work at least since Ubuntu 20.04. They should work on all versions since Debian 9 and Ubuntu 16.04, if I am not mistaken. Releases before that only support the third method (so But as far as I can tell, Puppet still does not support any one of them. Please correct my if I am wrong on that. Are there any plans when this will be supported? |
@XSpielinbox those instructions that say to put keys under |
@kenyon, no, they are not wrong. Keys can initially be installed in |
I think this can be closed, was done in #1128. |
Is there any plan when there will be a new release? |
I'm seeing if I can get rid of this TODO: puppetlabs-apt/manifests/source.pp Line 192 in bee5ee1
|
Got rid of that TODO in #1147, and that was released in #1150. This can be closed. |
Use Case
The
apt-key
command has been deprecated in Debian testing aka bookworm in favor of storing key files directly into either /etc/apt/trusted.gpg.d/ or /etc/apt/keyrings/ and (in case of the latter) refer to them directly in individual sources.list entries (like[ signed-by=/path/to/file.gpg ]
.This also already works in Debian stable aka bullseye (and maybe oldstable/buster) and corresponding Ubuntu versions. So it would be nice to have this in place already before bookworm is released, esp. so as
apt-get update
will emit warnings for all keys still stored in the /etc/apt/trusted.gpg file.Describe the Solution You Would Like
apt::key
should have options to store keys downloaded as.gpg
or.asc
files in one of the directories above.Describe Alternatives You've Considered
Only alternative I see currently is to use a
file
resource instead ofapt::key
.Additional Context
https://manpages.debian.org/testing/apt/apt-key.8.en.html
The text was updated successfully, but these errors were encountered: