Skip to content

Commit ae73cd3

Browse files
author
Tod Beardsley
committed
Add a bash script to import dev keys
This merely makes it easy and fun to import all developer keys used over the past year to your local GPG keychain. This will make the task of reviewing merge commits for signedness much easier, especially if you use a nicelog alias such as this one: https://github.com/todb-r7/junkdrawer/blob/master/dotfiles/git-repos/gitconfig#L40 This does not handle automating checking for signatures as part of Travis-CI -- for that, see PR rapid7#5337, a work in progress.
1 parent 202c5e0 commit ae73cd3

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

tools/dev/import-dev-keys.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
3+
# Requires bash version 3 or so for regular expression pattern match
4+
5+
COMMITTER_KEYS_URL='https://raw.githubusercontent.com/wiki/rapid7/metasploit-framework/Committer-Keys.md'
6+
KEYBASE_KEY_URLS=$(
7+
\curl -sSL $COMMITTER_KEYS_URL |
8+
\awk '$4 ~/https:\/\/keybase.io\//' |
9+
\sed 's#.*\(https://keybase.io/[^)]*\).*#\1/key.asc#'
10+
)
11+
12+
for key in $KEYBASE_KEY_URLS; do
13+
echo Importing $key...
14+
\curl -sSL $key | gpg --quiet --no-auto-check-trustdb --import -
15+
done
16+
17+
# Exceptions -- keys that do show up in the logs, but aren't (yet) in Keybase:
18+
# This should cover every key since May of 2014.
19+
20+
# Currently, one lone missing key:
21+
#
22+
# gpg: Signature made Mon 16 Feb 2015 02:09:53 PM CST using RSA key ID D5D50A02
23+
# gpg: Can't check signature: public key not found
24+
# 14da69c - Land #4757, adds RC for auto payload gen (3 months ago) <kernelsmith@github> []
25+
#
26+
# https://github.com/rapid7/metasploit-framework/commit/14da69c is
27+
# harmless, though. It's only an RC script, not run by default, and it
28+
# automates setting up a payload handler.
29+
30+
31+
echo Processing exceptions...
32+
33+
MIT_KEYIDS="
34+
Brandont 0xA3EE1B07
35+
Ccatalan 0xC3953653
36+
Farias 0x01DF79A1
37+
Firefart 0x66BC32C7
38+
HDM 0xFA604913
39+
Jvennix 0x3E85A2B0
40+
Kernelsmith 0x3D609E33
41+
Lsanchez 0xFB80E8DD
42+
OJ 0x1FAA5749
43+
Sgonzalez 0xCA93BCE5
44+
Shuckins 0x8C03C944
45+
TheLightCosine 0x3A913DB2
46+
Wvu 0xC1629024
47+
"
48+
49+
MIT_KEY_URL_BASE="https://pgp.mit.edu/pks/lookup?op=get&search="
50+
51+
for key in $MIT_KEYIDS; do
52+
if [[ $key =~ ^0x ]]
53+
then
54+
\curl -sSL $MIT_KEY_URL_BASE$key | gpg --quiet --no-auto-check-trustdb --import -
55+
else
56+
echo Importing key for $key...
57+
fi
58+
done
59+

0 commit comments

Comments
 (0)