Skip to content

Commit

Permalink
Generate alphanumeric keystore passwords
Browse files Browse the repository at this point in the history
- We need to avoid starting these passwords with dashes
  so that they are not interpretted as flags in bash

[#151066916] Error when deploying 1.11.11 of OM

Signed-off-by: Danny Sullivan <[email protected]>
  • Loading branch information
Edie Beer committed Sep 19, 2017
1 parent d351e30 commit d4ffa93
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jobs/credhub/templates/init_key_stores.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CERT_FILE=/var/vcap/jobs/credhub/config/cert.crt
PRIVATE_KEY_FILE=/var/vcap/jobs/credhub/config/priv.key
CERT_ALIAS=credhub_tls_cert
KEY_STORE_PATH=/var/vcap/jobs/credhub/config/cacerts.jks
KEY_STORE_PASSWORD=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32)
KEY_STORE_PASSWORD=$(< /dev/urandom tr -dc A-Za-z0-9 | head -c32)

# DB
DATABASE_TLS_CA_FILE=/var/vcap/jobs/credhub/config/database_ca.pem
Expand All @@ -20,14 +20,14 @@ DATABASE_VERIFY_CA_ALIAS=database_verify_ca

# MTLS
MTLS_CA_CERT_FILE=/var/vcap/jobs/credhub/config/mtls_ca_cert.crt
MTLS_TRUST_STORE_PASSWORD=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32)
MTLS_TRUST_STORE_PASSWORD=$(< /dev/urandom tr -dc A-Za-z0-9 | head -c32)
MTLS_TRUST_STORE_PATH=/var/vcap/jobs/credhub/config/mtls_trust_store.jks
MTLS_CA_ALIAS=mtls_ca

# UAA
AUTH_SERVER_CA_CERT_FILE=/var/vcap/jobs/credhub/config/auth_server_ca_cert.crt
AUTH_SERVER_TRUST_STORE_PATH=/var/vcap/jobs/credhub/config/auth_server_trust_store.jks
AUTH_SERVER_TRUST_STORE_PASSWORD=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32)
AUTH_SERVER_TRUST_STORE_PASSWORD=$(< /dev/urandom tr -dc A-Za-z0-9 | head -c32)
AUTH_SERVER_CA_ALIAS_BASE=auth_server_ca

sed -i "s/KEY_STORE_PASSWORD_PLACEHOLDER/${KEY_STORE_PASSWORD}/g" /var/vcap/jobs/credhub/config/application.yml
Expand Down

0 comments on commit d4ffa93

Please sign in to comment.