From f714b2014c11765eda7709d1cb29fc42de602524 Mon Sep 17 00:00:00 2001 From: Paul Caskey Date: Sat, 27 Apr 2019 00:40:34 +0000 Subject: [PATCH] add sealer key rotation --- Dockerfile | 8 ++- container_files/Sealer_Key_Rotation_Task.xml | Bin 0 -> 3350 bytes container_files/rotateSealerKey.ps1 | 59 +++++++++++++++++++ 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 container_files/Sealer_Key_Rotation_Task.xml create mode 100644 container_files/rotateSealerKey.ps1 diff --git a/Dockerfile b/Dockerfile index 0d34715..75f8632 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,7 @@ ENV JAVA_INSTALL_FILENAME='zulu8.38.0.13-ca-jdk8.0.212-win_x64.msi' #ENV JAVA_HOME=c:\\Java\\$JAVA_INSTALL_FOLDER RUN powershell [Environment]::SetEnvironmentVariable('JAVA_HOME', '%JAVA_HOME%', [System.EnvironmentVariableTarget]::Machine ) ENV SHIB_INSTALL_FILE=C:\\shibboleth-identity-provider-$IDP_VERSION-x64.msi +ENV ENABLE_SEALER_KEY_ROTATION=True ###install Zulu Java RUN powershell (new-object System.Net.WebClient).Downloadfile('https://cdn.azul.com/zulu/bin/%JAVA_INSTALL_FILENAME%', 'C:\%JAVA_INSTALL_FILENAME%') @@ -83,6 +84,9 @@ RUN C:/opt/shibboleth-idp/bin/build.bat -noinput -S -q -Didp.target.dir=c:/opt/s #link IdP's war file to Tomcat RUN mklink c:\Tomcat\webapps\idp.war c:\opt\shibboleth-idp\war\idp.war +#copy sealer key rotation script +COPY container_files/rotateSealerKey.ps1 c:\\opt\\shibboleth-idp\\bin\\rotateSealerKey.ps1 + #copy TIER beacon script RUN mkdir c:\util RUN mkdir c:\opt\certs @@ -91,9 +95,11 @@ COPY container_files/sendtierbeacon.ps1 c:\\util #RUN powershell ($tm=((Get-Random -Minimum 0 -Maximum 4) -as [string]) + ":" + ((Get-Random -Minimum 0 -Maximum 60) -as [string]) ; start-process -filepath schtasks -passthru -wait -argumentlist '/create','/tn','\"Send TIER Beacon\"','/tr','c:\util\sendtierbeacon.ps1','/sc','DAILY','/st',"$tm" #The line above is triggering an apprent bug in docker or windows core (essentially invalid XML), the 2 lines below are the workaround COPY container_files/TIER_Beacon_Task.xml c:\\TIER_Beacon_Task.xml +COPY container_files/Sealer_Key_Rotation_Task.xml c:\\Sealer_Key_Rotation_Task.xml RUN powershell schtasks /Create /XML c:\TIER_Beacon_Task.xml /TN 'TIER Beacon' ; $tm=((Get-Random -Minimum 0 -Maximum 4) -as [string]).padleft(2,'0') + ':' + ((Get-Random -Minimum 0 -Maximum 60) -as [string]).padleft(2,'0') ; schtasks /Change /TN 'TIER Beacon' /ST $tm +RUN powershell schtasks /Create /XML c:\Sealer_Key_Rotation_Task.xml /TN 'Rotate IdP Sealer Key' ; $tm=(1 -as [string]).padleft(2,'0') + ':' + (0 -as [string]).padleft(2,'0') ; schtasks /Change /TN 'Rotate IdP Sealer Key' /ST $tm RUN del c:\TIER_Beacon_Task.xml - +RUN del c:\Sealer_Key_Rotation_Task.xml ################################################# ### Settings for a burned-in config (default) ### diff --git a/container_files/Sealer_Key_Rotation_Task.xml b/container_files/Sealer_Key_Rotation_Task.xml new file mode 100644 index 0000000000000000000000000000000000000000..3c3f1013db7e3c1bbc9c781ed7cedb044c535ad0 GIT binary patch literal 3350 zcmbW4Z%-OQ5XR?qlYR%{dl9s)#!w9YX(iRxD8@A54GJO=kZ>sa<=g(AUCz6`1B!;g zojWtn%sewYyZ-%Cu|0dXf%UCmPu8)qMb@(i8`@V}v$7Sf#It~8Xg934kq)ivq?gvP zZ?=xs7j*WlY9H-`Rak9-a=#F9(;<4VLp0^-&L(_Dwrd-FB7EK9bKsDQJbSE+@gMQM zMYHIl8K66L5w%&LBHge}A}-k{-b%c0INJ%&$tWA8%^$Qo{nBRTkeS{Bh`LeJMs?9D{P&M?c z9G0QPxhB;(!b{7p9b;|$s6QUbNJv>(-uhzJ!EJ2B`95r`?ut08opjap2hRI`W^H?|I%Hx9?}hK6{WJN&}FK-=0uO3tX@mYeU^Eh0@`gi1JeDR z-la)RE3K+vS?gK+HnRFg*gzs7otl|H||?#eiC zl}46EKBuI{^W|w?DsE?L`iZ;l9L`Q%4@o|9y`&CNye-GIVn1V7^pW4V{;GpAbW@~b zKgn(C*m)~TnB^hpk*jGR8gkBV(&?k1~&c5NCeyozW-&cMPt!5MY z@%=2$`gDt!RF6!ksm_)A6}-L&A&f!$S5r}E(&End6C2 zy)vH0&T_m=GmWdA9>=#luL>N;9hFp2F&q+=?mYSIR$(~Z_4$aC!OU=bLpAL~^ z`3Pm9UA{A7MzSc&G(*fQ__!yM2L0)+vRLypLX0EsxE-dW?pOYP*Wfu|?ZiEMtXG+$ z4bIxq>@-=;CiLS^0_`Iq>a5>(vp2sU+o@|7cZ)jZ<~8Ps``Q64`1`>#>$*8FJ2fku zjXv|_L`qImVGUCKHsbFooalc5or&sE#h2BKV^5H3*mPl6j4C>vZwK7Gnjnt&yXg>n zoT}HXXy@ymyADfj