diff --git a/Dockerfile b/Dockerfile index 2da2d61..3b95cc6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,8 @@ RUN cp -r /opt/jboss/keycloak/themes/base/* /opt/jboss/keycloak/themes/cwa/ RUN cp -r ${WORK_DIR}/src/themes/cwa/login /opt/jboss/keycloak/themes/cwa/ RUN cp -r ${WORK_DIR}/src/themes/cwa/account /opt/jboss/keycloak/themes/cwa/ RUN cp ${WORK_DIR}/src/standalone/configuration/standalone-ha.xml /opt/jboss/keycloak/standalone/configuration/ +RUN cp ${WORK_DIR}/src/standalone/configuration/keystores/test-only-https-keystore.jks /opt/jboss/keycloak/standalone/configuration/ +RUN cp ${WORK_DIR}/src/opt/jboss/tools/cli/x509-keystore.cli /opt/jboss/tools/cli/ EXPOSE 8080 EXPOSE 8443 diff --git a/README.md b/README.md index 7fb0068..9b5b652 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ In the world of the Corona Warn App the Verification Identity and Access Managem So be sure to have [docker](https://docker.com) installed on your machine. ````bash docker build --pull --rm -f "Dockerfile" -t cwa-verification-iam "." -docker run -p "8080:8080" -p "8443:8443" -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin -e SSL_KEY_STORE=/opt/jboss/keycloak/standalone/configuration/ONLY_FOR_TEST_keystore.jks -e SSL_KEY_STORE_PASSWORD=secret cwa-verification-iam +docker run -p "8080:8080" -p "8443:8443" -p "7443:7443" -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin cwa-verification-iam ```` After that you will have run a Keykloak IAM Solution on you machine. The landing page of the Keykloak system will provide you with further information on how to setup the system and add new users. For a detailed view on all the features please refer to the manual pages, also linked on the landing page. diff --git a/src/opt/jboss/tools/cli/x509-keystore.cli b/src/opt/jboss/tools/cli/x509-keystore.cli new file mode 100644 index 0000000..cac075d --- /dev/null +++ b/src/opt/jboss/tools/cli/x509-keystore.cli @@ -0,0 +1,11 @@ +embed-server --server-config=$configuration_file --std-out=discard +/subsystem=elytron/key-store=cwa-keystore:add(path=$keycloak_tls_keystore_file,type=JKS,credential-reference={clear-text=$keycloak_tls_keystore_password}) +/subsystem=elytron/key-manager=cwa-key-manager:add(key-store=cwa-keystore,credential-reference={clear-text=$keycloak_tls_keystore_password}) +/subsystem=elytron/server-ssl-context=cwa-ssl-context:add(key-manager=cwa-key-manager,protocols=["TLSv1.2","TLSv1.3"],cipher-suite-names="${env.TLSv1_3_CIPHERS:TLS_AES_128_CCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256}",cipher-suite-filter="${env.TLSv1_2_CIPHERS:TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_DHE_DSS_WITH_AES_128_GCM_SHA256,TLS_DHE_DSS_WITH_AES_256_GCM_SHA384,TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,TLS_DHE_RSA_WITH_AES_256_GCM_SHA384}") +batch +/subsystem=undertow/server=default-server/https-listener=https:undefine-attribute(name=security-realm) +/subsystem=undertow/server=default-server/https-listener=https:write-attribute(name=ssl-context,value=cwa-ssl-context) +/subsystem=undertow/server=default-server/https-listener=https-admin:undefine-attribute(name=security-realm) +/subsystem=undertow/server=default-server/https-listener=https-admin:write-attribute(name=ssl-context,value=cwa-ssl-context) +run-batch +stop-embedded-server diff --git a/src/standalone/configuration/keystores/test-only-https-keystore.jks b/src/standalone/configuration/keystores/test-only-https-keystore.jks new file mode 100644 index 0000000..6a2b794 Binary files /dev/null and b/src/standalone/configuration/keystores/test-only-https-keystore.jks differ diff --git a/src/standalone/configuration/standalone-ha.xml b/src/standalone/configuration/standalone-ha.xml index 338d659..4239db7 100644 --- a/src/standalone/configuration/standalone-ha.xml +++ b/src/standalone/configuration/standalone-ha.xml @@ -43,12 +43,6 @@ - - - - - @@ -249,6 +243,25 @@ + + + + + + + + + + + + + + + + + @@ -670,12 +683,14 @@ proxy-address-forwarding="${env.PROXY_ADDRESS_FORWARDING:false}" enable-http2="true"/> + enable-http2="true" + ssl-context="cwa-ssl-context-test"/> + enable-http2="true" + ssl-context="cwa-ssl-context-test"/>