
Hi all,
After midterm evaluations I have been working on signing the message
using one the keys associated with the list, now since python-gnupg
does not allow selecting keys with key credentials( like address or
list-name name) so we need key_id. As barry suggested we can create a
mapping of address to key_ids and store in a seperate table.
I was of the opinion that we need key_ids only for signing the content
and hence need to select only list's keys and not user, so can we add a
new column key_id
to the existing list table? So that the key_id is
easily accessible as a list parameter and can be easily updated. One
point in this would be should we allow more than one key associated with
a user( or address? ).
Any comments on this? (barry?)
Also I understand that keeping key safe is one of the important tasks
but for the time-being I am simply adding the public and secret keyrings
in "VAR_DIR/gpg/", all the list's private keys are in secring.gpg
and
all the list's public keys are in pubring.gpg
and all the user's
public keys are in userring.gpg
. It will be changed to keep the secret
keys at a more safer location.
Abhilash Raj

Abhilash,
I see no reason to have more that one keyring for public keys and another for the private ones. In both cases, those key rings are a flat table indexed by the Key_id. It doesn't matter if the "owner" of the key is a list or a subscriber (or any other user) As for user keys, I think that they should be treated as a ManyToMany relation between the public keys and either the lists or users or, perhaps the subscriptions, in a manner similar to the way that Email addresses are associated with a user.
Wacky
On Aug 13, 2013, at 9:46 AM, Abhilash Raj <raj.abhilash1@gmail.com> wrote:

Abhilash Raj writes:
Have you tried this? In the GPG documentation, "key ID" often actually means any of the above.[1] If python-gnupg simply passes its argument to the gpg process, it should Just Work. Anyway, it seems to work for me (some output edited for clarity):
venv27 abhilash 15:39$ python2.7 Python 2.7.5 (default, Aug 1 2013, 23:58:20) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. No entry for terminal type "emacs"; using dumb terminal settings.
hQIOAxjgOuNvO22tEAgAgPUFFCFDKe8zSWt42IG7LkLWWbbTCiAsO7aM2pEgtFrI KxRklwvEOX7bj5cYbmGr1PeM2IH58T4gMMHsYuOUyNzxS1mbsXZ9C4rpE0QJSkPY +5Z10dpHEyAZ030g6uBeubFHC+78as1s10UP16zlVgs2AeZwfM88OBocs7FmUdZr X5uAUxpB5RGET/zc2uHvBzIigXTzUrS8Lr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-----END PGP SIGNATURE----- '
Decryption of the encrypted file works. I didn't verify the signature, but it looks like it's working.
I agree with Richard that there's no particular reason to do anything but put the public keys on one ring.
I don't see any point in putting the private keys somewhere else. As I wrote elsewhere, the weak point in the private keys is the need to supply a password, not the location of the file containing the key. I wonder if there may not be a way to do this using agent forwarding so that the private keys are kept on a different host.
The only issue I can see is that *if* at some point it becomes feasible to use agent forwarding, I suspect only one agent can be used per GPG subprocess.
Footnotes: [1] Has anybody else noticed that both gpg's UI and its documentation seem designed to make it as hard to use as possible?

I agree with everything written elsewhere by Steve and Richard.
On Aug 14, 2013, at 05:35 PM, Stephen J. Turnbull wrote:
[1] Has anybody else noticed that both gpg's UI and its documentation seem designed to make it as hard to use as possible?
Sadly, I think this is one of the biggest reasons why we've never seen widespread adoption of signatures and encryption in email. I'll ignore nefarious reasons like authors of MUAs-for-the-masses in deliberate collusion to make it difficult for the non-Snowdens of the world.
In any case, I've always heard that gpg deliberately does not expose a programmable API that e.g. could be wrapped by Python. They only provide a command line API because they think that's the best way to avoid incorrect use in language bindings. They're probably not wrong about that. In any case, tools like python-gnupg are essentially glorified subprocess wrappers around the gpg cli, because there's no other way to do it.
-Barry

Barry Warsaw writes:
Sure, but the wrappers I've seen don't really help. I get the feeling that they are basically designed around smebody's personal needs with all kinds of bags and kludges added on request.
Maybe you can sprinkle RDM with itch powder the next time you see him? I bet he could do for a gpg wrapper what he's done for the email package! }:-}

On 13-08-14 2:35 AM, Stephen J. Turnbull wrote:
" The analysis found a number of user interface design flaws that may contribute to security failures, and the user test demonstrated that when our test participants were given 90 minutes in which to sign and encrypt a message using PGP 5.0, the majority of them were unable to do so successfully. "
If you haven't read it, I highly recommend it. It's an easy read, freely available online, and very educational. Obviously this is especially of interest to those talking about PGP and mailman, but it's a good read for anyone who works with code:
https://www.usenix.org/legacy/events/sec99/whitten.html
Terri

On 08/14/2013 04:35 AM, Stephen J. Turnbull wrote:
hmm, always_trust=True is probably problematic -- if someone manages to inject another key with the associated User ID earlier into gpg's keyring, then their key will be used before the correct key.
I agree that gpg should be able to figure out the key to use given the e-mail address, but i'm not sure if it necessarily will if there are two keys which both claim a given User ID and only one has a valid binding (i.e. a proper OpenPGP certification from a trusted introducer).
so the above test worked, given the keyring that you had, but it might result in *not* working (e.g. by encrypting to the wrong key) given a different keyring.
fortunately, in the current implementation we're only worrying about signing, not encryption; so the relevant issue is the choice of secret key, and we don't expect other users to be able to inject data into the secret keyring, so this shouldn't be a concern. right?
--dkg

Daniel Kahn Gillmor writes:
On 08/14/2013 04:35 AM, Stephen J. Turnbull wrote:
hmm, always_trust=True is probably problematic
Of course it is, but I was working with a test keyring.
This is an argument for validity checks on the keyring. The alternative is keeping the email-to-fingerprint mapping in the User database, which is *not* designed for crypto validation. I see no reason to suppose it's easier to attack the keyring that the User database.
I don't think it's a major concern, period. True, encryption uses the public key, which may be downloaded from a keyserver or entered from the web, making injection attacks plausible. So what? What's the alternative given that the raison d'etre of Mailman is to give users control over their profiles?
Note that I don't deny that there are real security issues here, and that in some contexts they are important. But if they are, I have to wonder if Mailman isn't much too complicated to be trusted anyway.
Steve

Abhilash,
I see no reason to have more that one keyring for public keys and another for the private ones. In both cases, those key rings are a flat table indexed by the Key_id. It doesn't matter if the "owner" of the key is a list or a subscriber (or any other user) As for user keys, I think that they should be treated as a ManyToMany relation between the public keys and either the lists or users or, perhaps the subscriptions, in a manner similar to the way that Email addresses are associated with a user.
Wacky
On Aug 13, 2013, at 9:46 AM, Abhilash Raj <raj.abhilash1@gmail.com> wrote:

Abhilash Raj writes:
Have you tried this? In the GPG documentation, "key ID" often actually means any of the above.[1] If python-gnupg simply passes its argument to the gpg process, it should Just Work. Anyway, it seems to work for me (some output edited for clarity):
venv27 abhilash 15:39$ python2.7 Python 2.7.5 (default, Aug 1 2013, 23:58:20) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. No entry for terminal type "emacs"; using dumb terminal settings.
hQIOAxjgOuNvO22tEAg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92Gv NDxQCKcyTj+6leqy3ePRAgXP5DouTGXntupzPQzcbQW6L8X6h6STOiLAAGKXpGJm t4Fruvbb3kAcqDGCp5Y9kLrxd1unlCp9leoeJeG5NZ5IcI2B4qUwqKdydu9ZMJxS kJYJR1ZNVMtQh/kMNA87GMNv4nd8d5QPD+bm5b4L5BDlibzMGb5Q80mJAKD5xqo= =qHjE -----END PGP SIGNATURE----- '
Decryption of the encrypted file works. I didn't verify the signature, but it looks like it's working.
I agree with Richard that there's no particular reason to do anything but put the public keys on one ring.
I don't see any point in putting the private keys somewhere else. As I wrote elsewhere, the weak point in the private keys is the need to supply a password, not the location of the file containing the key. I wonder if there may not be a way to do this using agent forwarding so that the private keys are kept on a different host.
The only issue I can see is that *if* at some point it becomes feasible to use agent forwarding, I suspect only one agent can be used per GPG subprocess.
Footnotes: [1] Has anybody else noticed that both gpg's UI and its documentation seem designed to make it as hard to use as possible?

I agree with everything written elsewhere by Steve and Richard.
On Aug 14, 2013, at 05:35 PM, Stephen J. Turnbull wrote:
[1] Has anybody else noticed that both gpg's UI and its documentation seem designed to make it as hard to use as possible?
Sadly, I think this is one of the biggest reasons why we've never seen widespread adoption of signatures and encryption in email. I'll ignore nefarious reasons like authors of MUAs-for-the-masses in deliberate collusion to make it difficult for the non-Snowdens of the world.
In any case, I've always heard that gpg deliberately does not expose a programmable API that e.g. could be wrapped by Python. They only provide a command line API because they think that's the best way to avoid incorrect use in language bindings. They're probably not wrong about that. In any case, tools like python-gnupg are essentially glorified subprocess wrappers around the gpg cli, because there's no other way to do it.
-Barry

Barry Warsaw writes:
Sure, but the wrappers I've seen don't really help. I get the feeling that they are basically designed around smebody's personal needs with all kinds of bags and kludges added on request.
Maybe you can sprinkle RDM with itch powder the next time you see him? I bet he could do for a gpg wrapper what he's done for the email package! }:-}

On 13-08-14 2:35 AM, Stephen J. Turnbull wrote:
" The analysis found a number of user interface design flaws that may contribute to security failures, and the user test demonstrated that when our test participants were given 90 minutes in which to sign and encrypt a message using PGP 5.0, the majority of them were unable to do so successfully. "
If you haven't read it, I highly recommend it. It's an easy read, freely available online, and very educational. Obviously this is especially of interest to those talking about PGP and mailman, but it's a good read for anyone who works with code:
https://www.usenix.org/legacy/events/sec99/whitten.html
Terri

On 08/14/2013 04:35 AM, Stephen J. Turnbull wrote:
hmm, always_trust=True is probably problematic -- if someone manages to inject another key with the associated User ID earlier into gpg's keyring, then their key will be used before the correct key.
I agree that gpg should be able to figure out the key to use given the e-mail address, but i'm not sure if it necessarily will if there are two keys which both claim a given User ID and only one has a valid binding (i.e. a proper OpenPGP certification from a trusted introducer).
so the above test worked, given the keyring that you had, but it might result in *not* working (e.g. by encrypting to the wrong key) given a different keyring.
fortunately, in the current implementation we're only worrying about signing, not encryption; so the relevant issue is the choice of secret key, and we don't expect other users to be able to inject data into the secret keyring, so this shouldn't be a concern. right?
--dkg

Daniel Kahn Gillmor writes:
On 08/14/2013 04:35 AM, Stephen J. Turnbull wrote:
hmm, always_trust=True is probably problematic
Of course it is, but I was working with a test keyring.
This is an argument for validity checks on the keyring. The alternative is keeping the email-to-fingerprint mapping in the User database, which is *not* designed for crypto validation. I see no reason to suppose it's easier to attack the keyring that the User database.
I don't think it's a major concern, period. True, encryption uses the public key, which may be downloaded from a keyserver or entered from the web, making injection attacks plausible. So what? What's the alternative given that the raison d'etre of Mailman is to give users control over their profiles?
Note that I don't deny that there are real security issues here, and that in some contexts they are important. But if they are, I have to wonder if Mailman isn't much too complicated to be trusted anyway.
Steve
participants (6)
-
Abhilash Raj
-
Barry Warsaw
-
Daniel Kahn Gillmor
-
Richard Wackerbarth
-
Stephen J. Turnbull
-
Terri Oda