Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
add ssh-keys, ssh-public-keys, gpg-keys and gpg-public keys interfaces #4100
Conversation
jdstrand
added some commits
Oct 27, 2017
codecov-io
commented
Oct 27, 2017
•
Codecov Report
@@ Coverage Diff @@
## master #4100 +/- ##
==========================================
+ Coverage 78.01% 78.04% +0.03%
==========================================
Files 446 450 +4
Lines 30856 30896 +40
==========================================
+ Hits 24071 24113 +42
+ Misses 4775 4773 -2
Partials 2010 2010
Continue to review full report at Codecov.
|
| + | ||
| +owner @{HOME}/.ssh/ r, | ||
| +owner @{HOME}/.ssh/environment r, | ||
| +owner @{HOME}/.ssh/*.pub r, |
niemeyer
Nov 10, 2017
Contributor
Should this also allow reading known_hosts?
No, public keys are public. The hosts you connect to is very private information. If we mix the two the interface becomes misleading and dangerous.
pedronis
requested a review
from
niemeyer
Nov 9, 2017
niemeyer
requested changes
Nov 10, 2017
Thanks for these. Interface names are good, functionality seems good. Only questions are about the writable access into what otherwise looks like a read interface.
| + | ||
| +/usr/share/gnupg/options.skel r, | ||
| +owner @{HOME}/.gnupg/{,**} r, | ||
| +owner @{HOME}/.gnupg/random_seed w, |
niemeyer
Nov 10, 2017
Contributor
This feels slightly surprising as it disagrees with the "read" bit. Why is it necessary?
jdstrand
Dec 6, 2017
Contributor
From the man page: "~/.gnupg/random_seed - A file used to preserve the state of the internal random pool.'
Without write access, gpg encrypt/decrypt hangs
| +owner @{HOME}/.gnupg/ r, | ||
| +owner @{HOME}/.gnupg/gpg.conf r, | ||
| +owner @{HOME}/.gnupg/pubring.gpg{,.lock} r, | ||
| +owner @{HOME}/.gnupg/pubring.gpg.lock k, |
niemeyer
Nov 10, 2017
Contributor
Similarly, this can lock the user out of gpg usage, right? Not quite write, but a bit more than just read.
jdstrand
Dec 6, 2017
Contributor
These are all locks with read, which means we only allow opens with O_RDONLY and shared/read locks (eg LOCK_SH). The 'r' (O_RDONLY) with an exclusive/write lock (eg LOCK_EX) requires 'w' with the 'k'. As such, these rules do allow locking writes but not reads. I recall adding these since the man page referenced them, but neither gpg1 or gpg2 needs them for encrypt/verify/list/etc so I'll remove them.
| + | ||
| +owner @{HOME}/.ssh/ r, | ||
| +owner @{HOME}/.ssh/environment r, | ||
| +owner @{HOME}/.ssh/*.pub r, |
niemeyer
Nov 10, 2017
Contributor
Should this also allow reading known_hosts?
No, public keys are public. The hosts you connect to is very private information. If we mix the two the interface becomes misleading and dangerous.
jdstrand
added some commits
Dec 5, 2017
jdstrand
added this to the 2.30 milestone
Dec 6, 2017
jdstrand
added some commits
Dec 7, 2017
mvo5
merged commit e50b4af
into
snapcore:master
Dec 8, 2017
1 check passed
|
Thanks for merging this! I'll submit a PR for 2.30 shortly. |
jdstrand commentedOct 27, 2017
•
Edited 2 times
-
jdstrand
Dec 6, 2017
-
jdstrand
Dec 6, 2017
This is a preliminary implementation for discussion. This was prompted by https://forum.snapcraft.io/t/classic-confinement-for-mosh/2346. With these:
Importantly, these are read-only access. If we ever wanted to create write access, we would likely create ssh-keys-control and gpg-keys-control.