Mailing List Archive

Random_seed File Locking on NFS File System Across Networks/Domains Hangs
For internal encrypting/decrypting operations we want to use a NFS location for the gpg keystore available to two (possibly more) user IDs across many servers. It was designed this way so we did not have to share the keystore to each server and updates to the keystore could be done in one location, not on several (100+) servers. When the servers and the NAS appliance are on the same network and domain, there is no issue calling the fcntl system call to lock the random_seed file. However, we are moving the servers to a new network and a new domain but not all at once. This is where the issue showed up. On servers already moved to the new network/domain any fctnl on the randon_seed file hangs. Servers still in the same network/domain as the NAS appliance work as before (no hang). We believe this is a firewall issue and are investigating a solution.

However, this leads to the following questions: what functionality does the random_seed file provide? We know it can be ignored with the --no-random-seed-file option, but there is the possibility of doing many encrypting/decrypting operations simultaneously from both user IDs executing on different servers. Would ignoring the file locking on the random_seed file with the --no-random-seed-file option cause issues with independent processes accessing the same keystore at the same time on different servers? If so, what are those issues, and can they be avoided/worked around?
Re: Random_seed File Locking on NFS File System Across Networks/Domains Hangs [ In reply to ]
On 2021-04-25 at 13:11 +0000, Charlie Salemi via Gnupg-users wrote:
> Would ignoring the file locking on the random_seed file with the --
> no-random-seed-file option cause issues with independent processes
> accessing the same keystore at the same time on different servers?
> If so, what are those issues, and can they be avoided/worked around?

No. Not using the random seed files means just, not using that file. It
isn't used for synchronization.
Although, you could face the same issue when they try to lock other
files. How are you handling the changes to that keystore? Are those 100
servers only reading the keys, or are they also *modifying* it (e.g.
importing new keys) ?



_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: Random_seed File Locking on NFS File System Across Networks/Domains Hangs [ In reply to ]
The 100+ servers only read the key. Each user ID has a sub-directory under a generic location so there are no warnings printed by gpg when using the key to decrypt files. Any operation that encrypts files imports the global key locally or uses User IDs that have the same key locally and uses it for the encrypting.

Again, the concern using the global keystore on the NAS is that it doesn?t cause issues if multiple servers are decrypting different files at the same time using the same key without using the random_seed file. Using the ?no-random-seed-file would eliminate the file locking issue, I believe.

________________________________
From: Gnupg-users <gnupg-users-bounces@gnupg.org> on behalf of ?ngel <angel@pgp.16bits.net>
Sent: Sunday, April 25, 2021 7:51 PM
To: gnupg-users@gnupg.org
Subject: Re: Random_seed File Locking on NFS File System Across Networks/Domains Hangs

On 2021-04-25 at 13:11 +0000, Charlie Salemi via Gnupg-users wrote:
> Would ignoring the file locking on the random_seed file with the --
> no-random-seed-file option cause issues with independent processes
> accessing the same keystore at the same time on different servers?
> If so, what are those issues, and can they be avoided/worked around?

No. Not using the random seed files means just, not using that file. It
isn't used for synchronization.
Although, you could face the same issue when they try to lock other
files. How are you handling the changes to that keystore? Are those 100
servers only reading the keys, or are they also *modifying* it (e.g.
importing new keys) ?



_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.gnupg.org%2Fmailman%2Flistinfo%2Fgnupg-users&amp;data=04%7C01%7C%7C9d89eb24058444eb94e008d908450ce8%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637549914956463495%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=SwbfvbDf97w%2F%2FOPExS57YixLJgD%2B3fdfKT94OgtXIvM%3D&amp;reserved=0
Re: Random_seed File Locking on NFS File System Across Networks/Domains Hangs [ In reply to ]
On 4/25/21 08:11, Charlie Salemi via Gnupg-users wrote:
> However, this leads to the following questions:? what functionality does
> the random_seed file provide?
Per the documentation I have here:

'~/.gnupg/random_seed'
A file used to preserve the state of the internal random pool.

Now, for me, that begs the question: what does the internal random pool
offer that simply using /dev/random (or better yet a quality HWRNG) does
not?

--
Shawn K. Quinn <skquinn@rushpost.com>
http://www.rantroulette.com
http://www.skqrecordquest.com

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: Random_seed File Locking on NFS File System Across Networks/Domains Hangs [ In reply to ]
On Sun, 25 Apr 2021 23:12, Shawn K. Quinn said:

> Now, for me, that begs the question: what does the internal random pool
> offer that simply using /dev/random (or better yet a quality HWRNG) does
> not?

It speeds up the initial seeding of gpg and gpg-agent's the internal
RNGs if the system's entropy sources is slow. These days it is of less
use and in some cases a

echo only-urandom >/etc/gcrypt/random.conf

might be all what is required to speed up things. Note that this
affects all processes using Libgcrypt so it might be advisable to clear
this right at system startup and set it only after the early boot
phases. YMMV


Shalom-Salam,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.