This post will go through the process of creating a few simple scripts to automate OKV installation using the REST API capability of OKV.
NOTE: This information was provided by the product manager Peter Wahl who has a great blog on the features of OKV and some great "Ask Tom" sessions on OKV (and other security pieces),you can watch and learn more.
Step #1 Configure RESTful Services and download client tool
- Click on the "Enable" box to enable RESTful services
- Download the okvrestcliepackage.zip which are the client utilities.
- Save this setting to enable RESTful services.
Step #2 Create a user for the restapi steps
Step #3 unzip and configure the client tool
.
|-lib
| |-okvrestcli.jar
|-bin
| |-okv.bat
| |-okv
|-conf
| |-okvrestcli.ini
| |-okvrestcli_logging.properties
Step #4 - Set the environment for the CLI
NOTE: If this is a NEW database
- Add the new $ORACLE_SIDE for the host in the "/etc/oratab" file.
- Create the directory "mkdir $ORACLE_BASE/admin/{DB Unique Name}"
- Create the directory "mkdir -p $ORACLE_BASE/diag/rdbms/${DB Unique Name}/${ORACLE_SID}
- Use ". oraenv" to set the environment to this $ORACLE_SID
Step #5 - Set initialization parameters in okvrestcli.ini file
LOG_PROPERTY - Location of the logging properties. Default location is ./conf directory.
SERVER - IP address (or DNS) of one or more OKV hosts
OKV_CLIENT_CONFIG - location of the config file. Default location is ./conf directory
USER - OKV user that has authority to administer endpoints an wallets. In this case it will be the restapi user that I created.
PASSWORD - Password for the user, or location of wallet containing the password. I am NOT going to use this as I am going to use a wallet file.
CLIENT_WALLET - I am going to use a wallet to store the password, and this is the location of the wallet file. I will be creating the autologin wallet later.
Below is what my "[Default]" configuration file looks like after my changes which is located at $OKV_RESTCLI_HOME/conf/okvrestcli.ini . I am going to use the environmental variables I set in the setenv.sh script.
NOTE: I am choosing to store my password in wallet rather than clear text in the .ini file.
You need to change the server to either the server name or the IP address.
Step #6 Create the wallet to save the password encrypted
Step #7 Create and execute the run-me.sh script
- Ensure the variable OKV_RESTCLI_HOME is set before it can be executed.
- Determine the DB_UNIQUE_NAME from the $ORACLE_BASE/diag/rdbms/*/$ORACLE_SID directory. Solving for the * should give us the DB_UNIQUE_NAME
- While executing, it tells you what it believes the DB_UNIQUE_NAME is, and gives you a chance to change it if incorrect.
- It will validate if the endpoint group exists by accessing OKV. If the endpoint group already exists, it does not try to create it again. If it doesn't exist it will create the endpoint group.
- It will validate if the wallet exists by accessing OKV. If the wallet already exists, it does not try to create it again. If it doesn't exist it will create the wallet .
- t will add the endpoint, add this endpoint to the endpoint group, and assign the wallet to this endpoint.
- It will install the client software in $ORACLE_BASE/admin/$DB_UNIQUE_NAME/okv_home/okv
Step #8 Execute okv-install-${ORACLE_SID}.sh to validate that enrollment works
[oracle@pmdexa1dbadm01vm01 okv]$ ./okv-ep.sh
{
"result" : "Success"
}
{
"result" : "Success"
}
{
"result" : "Success"
}
spawn okv admin endpoint provision --endpoint DEMO31_on_pmdexa1dbadm01vm01 --location /u01/app/oracle/admin/demo31/wallet/okv --auto-login FALSE
Enter Oracle Key Vault endpoint password:
{
"result" : "Success"
}
Step #9 Zip it all up and place it in a location to be downloaded
.
|-wallet
| |-ewallet.p12.lck
| |-ewallet.p12
| |-cwallet.sso.lck
| |-cwallet.sso
|-conf
| |-okvrestcli_logging.properties
| |-okvrestcli.ini
|-setenv.sh
|-runme.sh
|-lib
| |-okvrestcli.jar
|-bin
| |-okv
| |-okv.bat
- Update the okvrestcli.ini file with OKV host IP
- Update the okvrestcli.ini file with the the user
- recreate the wallet file that contains the password for the OKV user
No comments:
Post a Comment