generate certs for syslog drain binder
set -ex
+if [ "$1" = "" ]; then
+ echo "usage: $0 <bbs-ca.crt> <bbs-ca.key>"
+ exit 1
+fi
+
+bbs_ca_cert_path=$1
+bbs_ca_key_path=$2
+bbs_ca_name=$(basename ${bbs_ca_cert_path} ".crt")
+
# Install certstrap
go get -v github.com/square/certstrap
@@ -9,6 +18,9 @@ go get -v github.com/square/certstrap
depot_path="loggregator-certs"
mkdir -p ${depot_path}
+ln -s ${bbs_ca_cert_path} ${depot_path}/
+ln -s ${bbs_ca_key_path} ${depot_path}/
+
# CA to distribute to loggregator certs
certstrap --depot-path ${depot_path} init --passphrase '' --common-name loggregatorCA
mv -f ${depot_path}/loggregatorCA.crt ${depot_path}/loggregator-ca.crt
@@ -29,3 +41,7 @@ certstrap --depot-path ${depot_path} sign metron --CA loggregator-ca
# Stats Injector certificate
certstrap --depot-path ${depot_path} request-cert --passphrase '' --common-name statsdinjector
certstrap --depot-path ${depot_path} sign statsdinjector --CA loggregator-ca
+
+# Syslog drain binder certificate
+certstrap --depot-path ${depot_path} request-cert --passphrase '' --common-name syslogdrainbinder
+certstrap --depot-path ${depot_path} sign syslogdrainbinder --CA ${bbs_ca_name}
