CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/tools/dev/sign-dev-keys.sh
Views: 1904
1
#!/bin/bash
2
3
# Imports and signs dev keys fetched from Keybase, as asserted by the
4
# Metasploit-Framework development wiki. Requires bash version 3 or so for
5
# regular expression pattern match
6
7
COMMITTER_KEYS_URL='https://raw.githubusercontent.com/wiki/rapid7/metasploit-framework/Committer-Keys.md'
8
KEYBASE_KEY_URLS=$(
9
\curl -sSL $COMMITTER_KEYS_URL |
10
\awk '$4 ~/https:\/\/keybase.io\//' |
11
\sed 's#.*\(https://keybase.io/[^)]*\).*#\1/key.asc#'
12
)
13
14
for key in $KEYBASE_KEY_URLS; do
15
echo [*] Importing $key
16
THIS_KEY=$(
17
\curl -sSL $key |
18
\gpg --no-auto-check-trustdb --import - 2>&1 |
19
\head -1 | \cut -f 3 -d " " | \sed 's/://'
20
)
21
echo [*] Signing $THIS_KEY
22
\gpg --sign-key $THIS_KEY
23
echo [*] Sending $THIS_KEY
24
\gpg --keyserver sks-keyservers.net --send-key $THIS_KEY
25
done
26
27
28