|
| 1 | +--- |
| 2 | +title: Configure SAP HANA, express edition Security |
| 3 | +description: Your SAP HANA, express edition installation has several preconfigured security settings. Before using SAP HANA, express edition, complete these security tasks. |
| 4 | +tags: [ tutorial>beginner, topic>HXE, products>sap-hana,-express-edition ] |
| 5 | +--- |
| 6 | +## Prerequisites |
| 7 | + - **Proficiency:** Beginner |
| 8 | + - **Tutorials:** [Start Using SAP HANA, express edition](http://go.sap.com/developer/tutorials/hxe-ua-getting-started-vm.html) |
| 9 | + |
| 10 | +## Next Steps |
| 11 | + - Select a tutorial from the [Tutorial Navigator](http://go.sap.com/developer/tutorial-navigator.html) or the [Tutorial Catalog](http://go.sap.com/developer/tutorials.html) |
| 12 | + |
| 13 | +## Details |
| 14 | +### You will learn |
| 15 | +How to perform security tasks to ensure that your security settings are not known outside your organization. You will learn how to apply the HXE license to ensure your installation keeps working after the default grace period expires. |
| 16 | + |
| 17 | +### Time to Complete |
| 18 | +**15 Min**. |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +### Apply the HANA, express-edition license key |
| 23 | +If you don’t apply the license, your SAP HANA, express edition will stop working after the default grace period of 60-90 days. If you have SAP HANA Studio or the HANA Studio eclipse plugin then begin at **Using Studio**. Otherwise proceed to **Using HDBSQL**. |
| 24 | + |
| 25 | +### Applying the License Key with HANA Studio |
| 26 | + |
| 27 | +#### Obtain your hardware key |
| 28 | +If you are using the SAP HANA Studio eclipse plugin, you can do the following. |
| 29 | +1. Start SAP HANA studio. |
| 30 | +2. On the Systems tab, select SYSTEMDB@HXE (SYSTEM). |
| 31 | +3. View properties for SYSTEMDB@HXE (SYSTEM). |
| 32 | +4. Select License properties. Open the System License tab. |
| 33 | +5. Make a note of the Hardware Key value. |
| 34 | + |
| 35 | +#### Order your license key |
| 36 | +1. Go to [sap.com/minisap](http://sap.com/minisap) and fill out all required information. |
| 37 | +2. For System ID, select HXE. |
| 38 | +3. For Hardware Key, enter the hardware key value you recorded earlier. |
| 39 | +4. Submit the form. The license key is emailed to you. |
| 40 | +5. Save the license key file to your hard disk under the name `HXE.txt`. |
| 41 | + |
| 42 | +#### Apply the license key |
| 43 | +1. In SAP HANA studio, view properties for SYSTEMDB@HXE (SYSTEM). |
| 44 | +2. Select License properties. Open the System License tab. |
| 45 | +3. Click Delete License Key to delete any existing licenses. |
| 46 | +4. Click Install License Key. |
| 47 | +5. Navigate to your license file and select it. |
| 48 | +After confirmation, the properties page refreshes with your new license information. |
| 49 | +6. Proceed to **Change the SSFS Master Keys** |
| 50 | + |
| 51 | +### Applying the License Key with HDBSQL |
| 52 | + |
| 53 | +#### Obtain your hardware key |
| 54 | +1. Login in to your HANA, express edition as `hxeadm`. |
| 55 | +2. Enter the following command: |
| 56 | + |
| 57 | + `hdbsql -u system -p <your password> -d SystemDB "SELECT HARDWARE_KEY FROM M_LICENSE"` |
| 58 | + |
| 59 | +3. Copy or otherwise record the value returned for `HARDWARE_KEY` |
| 60 | + |
| 61 | +#### Order your license key |
| 62 | +1. Go to [sap.com/minisap](http://sap.com/minisap) and fill out all required information. |
| 63 | +2. For System ID, select HXE. |
| 64 | +3. For Hardware Key, enter the hardware key value you recorded earlier. |
| 65 | +4. Submit the form. The license key is emailed to you. |
| 66 | +5. Save the license key file to your hard disk under the name `HXE.txt`. |
| 67 | + |
| 68 | +#### Apply the license key |
| 69 | + |
| 70 | +1. Make a directory on your HXE machine to store the license. |
| 71 | + |
| 72 | + `mkdir ~/license` |
| 73 | + |
| 74 | + This command will make the directory `/usr/sap/HXE/home/license` |
| 75 | +2. If you do not have an SCP client, please download and install one. There are several very good open source `scp` clients available for Windows, Mac and Linux. Copy the file from your hard disk to the `/usr/sap/HXE/home/license` directory. |
| 76 | +3. Issue the following command to install the license key. |
| 77 | + |
| 78 | + `hdbsql -u system -p HANAhxe2 -d SystemDB -I '/usr/sap/HXE/home/license/HXE_License.txt'` |
| 79 | + |
| 80 | +4. Confirm that the license key was installed by issuing the following command. |
| 81 | + |
| 82 | + `hdbsql -u system -p HANAhxe2 -d SystemDB "select hardware_key, expiration_date from m_licenses"` |
| 83 | + |
| 84 | + The expiration date should be one year from today. |
| 85 | +5. Proceed to **Change the SSFS Master Keys**. |
| 86 | + |
| 87 | + |
| 88 | +### Change the SSFS Master Keys |
| 89 | +1. Log on to the HANA system as **`hxeadm`** and shut the system down using the `sapcontrol` program: |
| 90 | +**/`usr/sap/hostctrl/exe/sapcontrol` -nr 00 –function Stop** |
| 91 | +2. Re-encrypt the master key of the instance SSFS: |
| 92 | +**`RSEC_SSFS_DATAPATH`=/`usr`/sap/`HXE`/`SYS`/`global`/`hdb`/security/`ssfs` |
| 93 | +export `RSEC_SSFS_DATAPATH` |
| 94 | +`RSEC_SSFS_KEYPATH=/usr/sap/HXE/SYS/global/hdb/security/ssfs rsecssfx changekey` $(`rsecssfx generatekey -getPlainValueToConsole`)** |
| 95 | +3. Add following to the end of /`usr`/sap/`HXE`/`SYS`/`global`/`hdb`/custom/`config`/`global.ini`: |
| 96 | +**[cryptography] |
| 97 | +`ssfs_key_file_path = /usr/sap/HXE/SYS/global/hdb/security/ssfs`** |
| 98 | +4. Re-encrypt the system PKI SSFS with a new key - HDB start: |
| 99 | +**`RSEC_SSFS_DATAPATH=/usr/sap/HXE/SYS/global/security/rsecssfs/data` |
| 100 | +`export RSEC_SSFS_DATAPATH RSEC_SSFS_KEYPATH=/usr/sap/HXE/SYS/global/security/rsecssfs/key rsecssfx changekey $(rsecssfx generatekey -getPlainValueToConsole)`** |
| 101 | +5. Restart the system: |
| 102 | +**/`usr/sap/hostctrl/exe/sapcontrol` -nr 00 -function Start** |
| 103 | + |
| 104 | +For more information, see the [Change the SSFS Master Keys](https://help.sap.com/saphelp_hanaplatform/helpdata/en/58/1593c48739431caaccc3d2ef55c23f/frameset.htm) topic in the *SAP HANA Administration Guide*. |
| 105 | + |
| 106 | +### Change the Root Key |
| 107 | +Change the root key of your installation. |
| 108 | +1. Log on to the HANA system as **`hxeadm`** and shut the system down using the `sapcontrol` program: |
| 109 | +**/`usr/sap/hostctrl/exe/sapcontrol` –nr 00 –function Stop** |
| 110 | +2. Generate a new root encryption key using the **`hdbnsutil`** program: |
| 111 | +**cd /`usr/sap/HXE/HDB00/exe` |
| 112 | +./`hdbnsutil` -`generateRootKeys` --type=`DPAPI`** |
| 113 | +3. Restart the system: |
| 114 | +**/`usr/sap/hostctrl/exe/sapcontrol` -nr 00 -function Start** |
| 115 | +4. Reset the consistency information in the SSFS using the `hdbcons` program: |
| 116 | +**cd /`usr/sap/HXE/HDB00/exe` |
| 117 | +./`hdbcons "crypto ssfs resetConsistency`" -e `hdbnameserver`** |
| 118 | +5. You have 20 seconds to rerun the command again to completely rewrite `ssfs` consistency information: |
| 119 | +**./`hdbcons` -e `hdbnameserver` "crypto `ssfs resetConsistency`"** |
| 120 | +6. Change all application keys so that they are encrypted with the new root key by using SAP HANA studio or SAP HANA HDBSQL: |
| 121 | +**ALTER SYSTEM APPLICATION ENCRYPTION CREATE NEW KEY** |
| 122 | + |
| 123 | +For more information, see the [Change the Root Key of the Internal Data Encryption Service](https://help.sap.com/saphelp_hanaplatform/helpdata/en/8f/bb69c47c224b3292ba078684f176e3/frameset.htm) topic in the *SAP HANA Server Installation and Update Guide*. |
| 124 | + |
| 125 | +### Deactivate the SYSTEM user |
| 126 | +1. Log in as SYSTEM user to create a user with the USER ADMIN system privilege: |
| 127 | +**/`usr`/sap/HXE/HDB00/`exe/hdbsql -d SystemDB` -u SYSTEM -p <SYSTEM_PWD> "CREATE USER `MyAdminUser` PASSWORD <`MyAdminUserPwd`> NO `FORCE_FIRST_PASSWORD_CHANGE`;" |
| 128 | +/`usr`/sap/HXE/HDB00/`exe/hdbsql` -d `SystemDB` -u SYSTEM -p <SYSTEM_PWD> "GRANT USER ADMIN to `MyAdminUser` WITH ADMIN OPTION ;" ** |
| 129 | +2. Log in as **`MyAdminUser`** to deactivate SYSTEM: |
| 130 | +**/`usr`/sap/HXE/HDB00/`exe`/`hdbsql` -d `SystemDB` -u `MyAdminUser` -p <`MyAdminUserPwd`> "ALTER USER SYSTEM DEACTIVATE USER NOW;"** |
| 131 | + |
| 132 | +## Next Steps |
| 133 | + - Select a tutorial from the [Tutorial Navigator](http://go.sap.com/developer/tutorial-navigator.html) or the [Tutorial Catalog](http://go.sap.com/developer/tutorials.html) |
0 commit comments