-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(tls): set up TLS in oauth-proxy config (#426)
Co-authored-by: Andrew Azores <[email protected]>
- Loading branch information
1 parent
8dece62
commit be27d7d
Showing
18 changed files
with
269 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,5 @@ certs/*.p12 | |
certs/*.pass | ||
*.jfr | ||
.quarkus/ | ||
compose/auth_certs/*.key | ||
compose/auth_certs/*.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/sh | ||
|
||
set -x | ||
|
||
CERTS_DIR="$(realpath "$(dirname "$0")")" | ||
|
||
SSL_KEYSTORE=agent-keystore.p12 | ||
|
||
SSL_KEYSTORE_PASS_FILE=keystore.pass | ||
|
||
cleanup() { | ||
cd "$CERTS_DIR" | ||
rm "$SSL_KEYSTORE" "$SSL_KEYSTORE_PASS_FILE" agent-server.cer | ||
cd - | ||
} | ||
|
||
case "$1" in | ||
clean) | ||
cleanup | ||
exit 0 | ||
;; | ||
generate) | ||
;; | ||
*) | ||
echo "Usage: $0 [clean|generate]" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
set -e | ||
|
||
genpass() { | ||
< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32 | ||
} | ||
|
||
SSL_KEYSTORE_PASS="$(genpass)" | ||
|
||
cd "$CERTS_DIR" | ||
trap "cd -" EXIT | ||
|
||
echo "$SSL_KEYSTORE_PASS" > "$SSL_KEYSTORE_PASS_FILE" | ||
|
||
keytool \ | ||
-genkeypair -v \ | ||
-alias quarkus-test-agent \ | ||
-dname "CN=quarkus-test-agent, O=Cryostat, C=CA" \ | ||
-storetype PKCS12 \ | ||
-validity 365 \ | ||
-keyalg RSA \ | ||
-storepass "$SSL_KEYSTORE_PASS" \ | ||
-keystore "$SSL_KEYSTORE" | ||
|
||
keytool \ | ||
-exportcert -v \ | ||
-alias quarkus-test-agent \ | ||
-keystore "$SSL_KEYSTORE" \ | ||
-storepass "$SSL_KEYSTORE_PASS" \ | ||
-file agent_server.cer | ||
|
||
cp agent_server.cer "$CERTS_DIR/../../truststore/quarkus-test-agent.cer" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/sh | ||
|
||
set -xe | ||
|
||
CERTS_DIR="$(dirname "$(readlink -f "$0")")" | ||
|
||
openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 -nodes -out "${CERTS_DIR}/certificate.pem" -keyout "${CERTS_DIR}/private.key" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
server: | ||
SecureBindAddress: 0.0.0.0:8443 | ||
TLS: | ||
Key: | ||
fromFile: /certs/private.key | ||
Cert: | ||
fromFile: /certs/certificate.pem | ||
upstreamConfig: | ||
proxyRawPath: true | ||
upstreams: | ||
- id: cryostat | ||
path: / | ||
uri: http://cryostat:8181 | ||
- id: grafana | ||
path: /grafana/ | ||
uri: http://grafana:3000 | ||
- id: storage | ||
path: ^/storage/(.*)$ | ||
rewriteTarget: /$1 | ||
uri: http://s3:${STORAGE_PORT} | ||
passHostHeader: false | ||
proxyWebSockets: false | ||
providers: | ||
- id: dummy | ||
name: Unused - Sign In Below | ||
clientId: CLIENT_ID | ||
clientSecret: CLIENT_SECRET | ||
provider: google | ||
injectRequestHeaders: | ||
- name: "X-Forwarded-Proto" | ||
values: | ||
- fromEnv: CRYOSTAT_PROXY_PROTOCOL | ||
- name: "X-Forwarded-Port" | ||
values: | ||
- fromEnv: CRYOSTAT_PROXY_PORT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: "3" | ||
services: | ||
cryostat: | ||
environment: | ||
CRYOSTAT_HTTP_PROXY_PORT: "${CRYOSTAT_PROXY_PORT}" | ||
CRYOSTAT_HTTP_PROXY_TLS_ENABLED: "true" | ||
auth: | ||
volumes: | ||
- auth_proxy_certs:/certs | ||
|
||
volumes: | ||
auth_proxy_certs: | ||
external: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ services: | |
- "${STORAGE_PORT}:${STORAGE_PORT}" | ||
cryostat: | ||
environment: | ||
STORAGE_EXT_URL: '' | ||
STORAGE_EXT_URL: "" |
Oops, something went wrong.