Score:0

dirmngr try to lookup pubkeys in the internet

br flag

I was doing a python script with gpg encryption and was debugging why some files not encrypted. During this debugging session I find this:

gpg: error retrieving '[email protected]' via WKD: Network is unreachable
gpg: [email protected]: skipped: Network is unreachable
[GNUPG:]INV_RECP 0 [email protected]
[GNUPG:]FAILURE encrypt 0123456
gpg: [stdin]: encryption failed: No data

So far as I understant its a problem with the pubkey (is invalid) and gpg invokes the dirmngr, which use WKD/WKS to find the missing key from a keyserver.

Well in my company its a security issue when some deamons trying to lookup something like keys to public keyserver. So my question is how can I deactives or limit the dirmngr deamon or perhaps the WKD/WKS?

So fas as saw in the documentation you have to create a ~/.gnupg/dirmngr.conf file and put some parameters in it, like this:

verbose
disable-ldap
disable-http
ignore-ldap-dp
ignore-http-dp
ignore-ocsp-service-url
no-use-tor
max-replies 0
trust-model direct
no-auto-key-locate
no-auto-key-retrieve

But my dirmngr ignores my config and is happily using WKD for some lookups, when he has a pubkey what is invalid. So what can I do to change the behaivor of the dirmngr/WKD? (no I dont want to change the script, because this dirmngr/WKD behaivor could happen on any server, so its an issue with this deamon)

To the system, its Ubuntu 20.04 focal.

Score:0
br flag

Well the problem lies in the gpg.conf. Use this when you have the same problem.

~/.gnupg/gpg.conf

auto-key-locate local

In the offical gnupg Documentation you will find the commands to disarm the WKD/WKS services.

Please close this thread.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.