Skip to content

Commit 1e9b53e

Browse files
authored
Merge pull request #2 from sanjaymantoor/main
Updated admin and dynamic cluster as per security review comments
2 parents de72103 + 1668244 commit 1e9b53e

39 files changed

+422
-378
lines changed

weblogic-azure-vm/arm-oraclelinux-wls-admin/admin-ssl-post-deploy/src/main/scripts/configureCustomAdminSSL.sh

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function wait_for_admin()
154154
{
155155
#wait for admin to start
156156
count=1
157-
export CHECK_URL="http://$wlsAdminURL/weblogic/ready"
157+
CHECK_URL="http://$wlsAdminURL/weblogic/ready"
158158
status=`curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}`
159159
echo "Waiting for admin server to start"
160160
while [[ "$status" != "200" ]]
@@ -193,7 +193,7 @@ function parseLDAPCertificate()
193193
done
194194

195195
openssl base64 -d -in ${SCRIPT_PWD}/security/AzureADLDAPCerBase64String.txt -out ${SCRIPT_PWD}/security/AzureADTrust.cer
196-
export addsCertificate=${SCRIPT_PWD}/security/AzureADTrust.cer
196+
addsCertificate=${SCRIPT_PWD}/security/AzureADTrust.cer
197197
}
198198

199199
function importAADCertificateIntoWLSCustomTrustKeyStore()
@@ -254,7 +254,7 @@ function parseAndSaveCustomSSLKeyStoreData()
254254

255255
echo "$customIdentityKeyStoreBase64String" > ${KEYSTORE_PATH}/identityKeyStoreCerBase64String.txt
256256
cat ${KEYSTORE_PATH}/identityKeyStoreCerBase64String.txt | base64 -d > ${KEYSTORE_PATH}/identity.keystore
257-
export customSSLIdentityKeyStoreFile=${KEYSTORE_PATH}/identity.keystore
257+
customSSLIdentityKeyStoreFile=${KEYSTORE_PATH}/identity.keystore
258258

259259
rm -rf ${KEYSTORE_PATH}/identityKeyStoreCerBase64String.txt
260260

@@ -263,7 +263,7 @@ function parseAndSaveCustomSSLKeyStoreData()
263263

264264
echo "$customTrustKeyStoreBase64String" > ${KEYSTORE_PATH}/trustKeyStoreCerBase64String.txt
265265
cat ${KEYSTORE_PATH}/trustKeyStoreCerBase64String.txt | base64 -d > ${KEYSTORE_PATH}/trust.keystore
266-
export customSSLTrustKeyStoreFile=${KEYSTORE_PATH}/trust.keystore
266+
customSSLTrustKeyStoreFile=${KEYSTORE_PATH}/trust.keystore
267267

268268
rm -rf ${KEYSTORE_PATH}/trustKeyStoreCerBase64String.txt
269269

@@ -279,7 +279,7 @@ function restartAdminServerService()
279279

280280
#main script starts here
281281

282-
export SCRIPT_PWD=`pwd`
282+
SCRIPT_PWD=`pwd`
283283

284284
# store arguments in a special array
285285
args=("$@")
@@ -288,51 +288,51 @@ ELEMENTS=${#args[@]}
288288

289289
# echo each element in array
290290
# for loop
291-
for (( i=0;i<$ELEMENTS;i++)); do
292-
echo "ARG[${args[${i}]}]"
293-
done
291+
#for (( i=0;i<$ELEMENTS;i++)); do
292+
# echo "ARG[${args[${i}]}]"
293+
#done
294294

295295
if [ $# -lt 9 ]
296296
then
297297
usage
298298
exit 1
299299
fi
300300

301-
export adminVMName=$1
302-
export wlsDomainName=$2
303-
export wlsUserName=$3
304-
export wlsPassword=$4
305-
export oracleHome=$5
306-
export wlsDomainPath=$6
301+
adminVMName=$1
302+
wlsDomainName=$2
303+
wlsUserName=$3
304+
wlsPassword=$4
305+
oracleHome=$5
306+
wlsDomainPath=$6
307307

308-
export enableAAD="${7}"
308+
enableAAD="${7}"
309309
enableAAD="${enableAAD,,}"
310310

311-
export wlsADSSLCer="${8}"
311+
wlsADSSLCer="${8}"
312312

313-
export isCustomSSLEnabled="${9}"
313+
isCustomSSLEnabled="${9}"
314314
isCustomSSLEnabled="${isCustomSSLEnabled,,}"
315315

316316
if [ "${isCustomSSLEnabled,,}" == "true" ];
317317
then
318-
export customIdentityKeyStoreBase64String="${10}"
319-
export customIdentityKeyStorePassPhrase="${11}"
320-
export customIdentityKeyStoreType="${12}"
321-
export customTrustKeyStoreBase64String="${13}"
322-
export customTrustKeyStorePassPhrase="${14}"
323-
export customTrustKeyStoreType="${15}"
324-
export privateKeyAlias="${16}"
325-
export privateKeyPassPhrase="${17}"
318+
customIdentityKeyStoreBase64String="${10}"
319+
customIdentityKeyStorePassPhrase="${11}"
320+
customIdentityKeyStoreType="${12}"
321+
customTrustKeyStoreBase64String="${13}"
322+
customTrustKeyStorePassPhrase="${14}"
323+
customTrustKeyStoreType="${15}"
324+
privateKeyAlias="${16}"
325+
privateKeyPassPhrase="${17}"
326326
fi
327327

328-
export wlsAdminPort=7001
329-
export wlsAdminChannelPort=7005
330-
export wlsAdminURL="$adminVMName:$wlsAdminChannelPort"
331-
export wlsServerName="admin"
332-
export username="oracle"
333-
export groupname="oracle"
328+
wlsAdminPort=7001
329+
wlsAdminChannelPort=7005
330+
wlsAdminURL="$adminVMName:$wlsAdminChannelPort"
331+
wlsServerName="admin"
332+
username="oracle"
333+
groupname="oracle"
334334

335-
export KEYSTORE_PATH="$wlsDomainPath/$wlsDomainName/keystores"
335+
KEYSTORE_PATH="$wlsDomainPath/$wlsDomainName/keystores"
336336

337337
validateInput
338338
cleanup

weblogic-azure-vm/arm-oraclelinux-wls-admin/cli-scripts/custom-dns-alias-cli.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function queryAdminIPId() {
107107
exit 1
108108
fi
109109

110-
export adminIPId=$(az graph query -q "Resources
110+
adminIPId=$(az graph query -q "Resources
111111
| where type =~ 'microsoft.network/networkinterfaces'
112112
| where id=~ '${nicId}'
113113
| extend ipConfigsCount=array_length(properties.ipConfigurations)
@@ -122,7 +122,7 @@ function queryAdminIPId() {
122122
}
123123

124124
function generateParameterFile() {
125-
export parametersPath=parameters.json
125+
parametersPath=parameters.json
126126
cat <<EOF >${scriptDir}/${parametersPath}
127127
{
128128
"\$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
@@ -230,8 +230,8 @@ Custom DNS alias:
230230

231231
# main script start from here
232232
# default value
233-
export hasDNSZone=false
234-
export identity=/subscriptions/subscriptionId/resourceGroups/TestResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/TestUserIdentity1
233+
hasDNSZone=false
234+
identity=/subscriptions/subscriptionId/resourceGroups/TestResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/TestUserIdentity1
235235

236236
# Transform long options to short ones
237237
for arg in "$@"; do

weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/mainTemplate.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,11 @@
303303
"defaultValue": "ServerPrivateKeyPassPhraseSecret"
304304
},
305305
"uploadedCustomIdentityKeyStoreData": {
306-
"type": "string",
306+
"type": "securestring",
307307
"metadata": {
308308
"description": "Custom Identity KeyStore Data"
309309
},
310-
"defaultValue": "customIdentityKeyStoreData"
310+
"defaultValue": ""
311311
},
312312
"uploadedCustomIdentityKeyStorePassphrase": {
313313
"type": "securestring",
@@ -324,11 +324,11 @@
324324
"defaultValue": "JKS"
325325
},
326326
"uploadedCustomTrustKeyStoreData": {
327-
"type": "string",
327+
"type": "securestring",
328328
"metadata": {
329329
"description": "Custom Trust KeyStore Data"
330330
},
331-
"defaultValue": "customTrustKeyStoreData"
331+
"defaultValue": ""
332332
},
333333
"uploadedCustomTrustKeyStorePassPhrase": {
334334
"type": "securestring",

weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/_keyVaultNestedTemplate.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
"contentVersion": "1.0.0.0",
44
"parameters": {
55
"uploadedCustomIdentityKeyStoreData": {
6-
"type": "string",
6+
"type": "securestring",
77
"metadata": {
88
"description": "Custom Identity KeyStore Data"
99
}
1010
},
1111
"uploadedCustomIdentityKeyStorePassphrase": {
12-
"type": "string",
12+
"type": "securestring",
1313
"metadata": {
1414
"description": "Custom Identity KeyStore Passphrase"
1515
}
1616
},
1717
"uploadedCustomTrustKeyStoreData": {
18-
"type": "string",
18+
"type": "securestring",
1919
"metadata": {
2020
"description": "Custom Trust KeyStore Data"
2121
}
2222
},
2323
"uploadedCustomTrustKeyStorePassPhrase": {
24-
"type": "string",
24+
"type": "securestring",
2525
"metadata": {
2626
"description": "Custom Trust KeyStore PassPhrase"
2727
}
@@ -33,7 +33,7 @@
3333
}
3434
},
3535
"uploadedPrivateKeyPassPhrase": {
36-
"type": "string",
36+
"type": "securestring",
3737
"metadata": {
3838
"description": "Password of the private key"
3939
}

weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/aadNestedTemplate.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
}
6868
},
6969
"wlsLDAPPrincipal": {
70-
"type": "string",
70+
"type": "securestring",
7171
"defaultValue": "",
7272
"metadata": {
7373
"description": "The Distinguished Name (DN) of the LDAP user that WebLogic Server should use to connect to the LDAP server."
@@ -88,14 +88,14 @@
8888
}
8989
},
9090
"wlsLDAPSSLCertificate": {
91-
"type": "string",
91+
"type": "securestring",
9292
"defaultValue": "",
9393
"metadata": {
9494
"description": "Client certificate that will be imported to trust store of SSL."
9595
}
9696
},
9797
"wlsLDAPUserBaseDN": {
98-
"type": "string",
98+
"type": "securestring",
9999
"defaultValue": "",
100100
"metadata": {
101101
"description": "The base distinguished name (DN) of the tree in the LDAP directory that contains users."
@@ -121,8 +121,8 @@
121121
}
122122
},
123123
"keyVaultCustomTrustKeyStorePassPhrase": {
124-
"type": "string",
125-
"defaultValue": "null",
124+
"type": "securestring",
125+
"defaultValue": "",
126126
"metadata": {
127127
"description": "Weblogic Custom Trust Store Passphrase"
128128
}

weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/nestedtemplates/adminTemplateForCustomSSL.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@
9090
"defaultValue": "[newGuid()]"
9191
},
9292
"keyVaultCustomIdentityKeyStoreData": {
93-
"type": "string",
93+
"type": "securestring",
9494
"metadata": {
9595
"description": "Weblogic Custom Identity Keystore Data"
9696
}
9797
},
9898
"keyVaultCustomIdentityKeyStorePassPhrase": {
99-
"type": "string",
99+
"type": "securestring",
100100
"metadata": {
101101
"description": "Weblogic Custom Identity Keystore Passphrase"
102102
}
@@ -109,13 +109,13 @@
109109
"defaultValue": "JKS"
110110
},
111111
"keyVaultCustomTrustKeyStoreData": {
112-
"type": "string",
112+
"type": "securestring",
113113
"metadata": {
114114
"description": "Weblogic Custom Trust Store Data"
115115
}
116116
},
117117
"keyVaultCustomTrustKeyStorePassPhrase": {
118-
"type": "string",
118+
"type": "securestring",
119119
"metadata": {
120120
"description": "Weblogic Custom Trust Store Passphrase"
121121
}
@@ -134,7 +134,7 @@
134134
}
135135
},
136136
"keyVaultPrivateKeyPassPhrase": {
137-
"type": "string",
137+
"type": "securestring",
138138
"metadata": {
139139
"description": "Weblogic Server Private Key Pass Phrase"
140140
}

weblogic-azure-vm/arm-oraclelinux-wls-admin/test/data/parameters-test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"value": "#adminvmname#"
2525
},
2626
"vmSizeSelect": {
27-
"value": "Standard_A3"
27+
"value": "Standard_D2as_v4"
2828
},
2929
"location": {
3030
"value": "#location#"

weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/gen-parameters-aad.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ cat <<EOF > ${parametersPath}
3838
"enableDB": {
3939
"value": false
4040
},
41+
"vmSizeSelect": {
42+
"value": "Standard_D2as_v4"
43+
},
4144
"wlsLDAPGroupBaseDN": {
4245
"value": "GEN-UNIQUE"
4346
},

weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/gen-parameters-db-aad.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ cat <<EOF > ${parametersPath}
5353
"jdbcDataSourceName": {
5454
"value": "jdbc/postgresql"
5555
},
56+
"vmSizeSelect": {
57+
"value": "Standard_D2as_v4"
58+
},
5659
"wlsLDAPGroupBaseDN": {
5760
"value": "GEN-UNIQUE"
5861
},

weblogic-azure-vm/arm-oraclelinux-wls-admin/test/scripts/gen-parameters-db.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ cat <<EOF > ${parametersPath}
4444
"jdbcDataSourceName": {
4545
"value": "jdbc/postgresql"
4646
},
47+
"vmSizeSelect": {
48+
"value": "Standard_D2as_v4"
49+
},
4750
"wlsPassword": {
4851
"value": "GEN-UNIQUE"
4952
},

0 commit comments

Comments
 (0)