Skip to content

Commit 9a6cb51

Browse files
Merge pull request #2 from Madeline-Schaefer/sap-tutorials-master
commit and push after git bash
2 parents cf7804c + c31b406 commit 9a6cb51

16 files changed

Lines changed: 290 additions & 0 deletions
Lines changed: 290 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,290 @@
1+
---
2+
parser: v2
3+
auto_validation: true
4+
time: 60
5+
tags: [ tutorial>intermediate, products>sap-business-technology-platform, tutorial>license]
6+
primary_tag: products>sap-hana-service-for-sap-btp
7+
---
8+
9+
# Reconfigure Trust Relationships on SAP HANA XS Systems
10+
<!-- description --> Reconfigure a SAML trust relationship on your SAP HANA XS database system from the file system to the in-memory store.
11+
12+
## Prerequisites
13+
- You have installed an **SAP HANA XS system in the SAP BTP, Neo environment** that you'd like to convert to an **SAP HANA MDC system**. For more information, see [SAP Note 2960608](https://launchpad.support.sap.com/#/notes/2960608).
14+
- You have configured a trust relationship between your identity provider and your SAP HANA XS system using SAML on the file system.
15+
- You have access to your identity provider and the required roles to configure SAML trust relationships.
16+
- You have installed openSSL or another certification tool.
17+
18+
## You will learn
19+
- How to register the service provider and the identity provider certificates in the SAP HANA in-memory store
20+
- How to reconfigure the trust relationship between your identity provider and your SAP HANA database system
21+
22+
## Intro
23+
> This tutorial assumes that you want to convert your SAP HANA XS system to an MDC system and, therefore, want to reconfigure your SAML setup to prepare for the conversion. For more information, see [SAP Note 2960608](https://launchpad.support.sap.com/#/notes/2960608).
24+
25+
>It also assumes that you have already configured a trust relationship between your SAP HANA database system and your identity provider. If you do not use SAML-based authentication, you can ignore this tutorial.
26+
27+
When you configured the SAML trust relationship, the setup consisted of the following steps:
28+
29+
![Initial setup](intro-formersetup.png)
30+
31+
1. The service provider certificates were automatically created during the installation of the SAP HANA database and stored in the **file system** (in the *sapsrv.pse* file).
32+
33+
>**TIP:** The public certificate stored in the file system can be viewed in the **Trust Manager** tab of the **XS Admin Tool**.
34+
35+
2. You configured a trust relationship to the SAP HANA system to an identity provider by exporting the service metadata and registering it in the identity provider.
36+
37+
3. You configured a trust relationship to the identity provider in the SAP HANA system, by exporting the identity provider SAML metadata and importing it into the SAP HANA system.
38+
39+
4. You configured the application for SAML authentication.
40+
41+
Converting your SAP HANA XS system to an SAP HANA MDC system now requires you to reconfigure the SAML trust relationship to store the certificates in the **in-memory store**. To do so, you will have to repeat some of the already completed steps:
42+
43+
![New setup](intro-newsetup.png)
44+
45+
1. You will regenerate the service provider certificates (step 2).
46+
47+
2. You store the service provider and the identity provider certificates in the in-memory store of the SAP HANA system (steps 3-6).
48+
49+
3. You will reconfigure the trust relationship in the identity provider based on the updated service provider certificates (step 7).
50+
51+
But before we start, we have to make sure that your database user has been assigned the required roles.
52+
53+
---
54+
55+
### Check or assign required roles
56+
57+
58+
1. Open the **SAP HANA Web-based Development Workbench** on the SAP HANA XS system.
59+
60+
You can do so by appending `/sap/hana/ide` to the URL of the database system, or you can access it from the SAP BTP cockpit.
61+
62+
![Accessing the Web-based Development Workbench](step1-access-webide.png)
63+
64+
2. Go to **Security** and open your database user.
65+
66+
3. Check that the user has been assigned at least the following roles:
67+
68+
- `sap.hana.security.base.roles::HANACertificateAdmin`
69+
- `sap.hana.security.cockpit.roles::DisplayCertificateStore`
70+
- `sap.hana.security.cockpit.roles::EditCertificateStore`
71+
- `sap.hana.security.cockpit.roles::MaintainCertificateCollections`
72+
- `sap.hana.security.cockpit.roles::MaintainCertificates`
73+
- `sap.hana.xs.admin.roles::SAMLAdministrator`
74+
- `sap.hana.xs.admin.roles::TrustStoreAdministrator`
75+
76+
For more information on how to create database user and assign roles on SAP HANA XS database systems, see [Create a Database Administration User for SAP HANA XS Databases](https://help.sap.com/viewer/d4790b2de2f4429db6f3dff54e4d7b3a/Cloud/en-US/1658a0868ded48c49a04508f89a8cbfa.html).
77+
78+
79+
### Re-create service provider certificates
80+
81+
82+
When you initially established trust, the service provider certificates had been automatically created and stored in the file system. You now have to re-create these certificates to store them in the in-memory store. The SAP HANA database system uses the service provider certificates to sign SAML documents that are exchanged with the identity provider.
83+
84+
>In this example, we'll use a self-signed certificate that we create via openSSL, but for productive scenarios, we recommend using only a trusted certificate signed by an official authority.
85+
Additionally, we only use example parameters in the command below. **Do not use these parameters in productive scenarios**, and align them with your Security Office.
86+
87+
To create a self-signed certificate using openSSL, run the following command in a command line shell:
88+
89+
```Shell
90+
openssl req -x509 -sha256 -newkey rsa:2048 -keyout certificate.key -out certificate.crt -days 1024 -nodes -subj "//CN=example"
91+
```
92+
93+
You have now generated your service provider certificate consisting of the following two files:
94+
95+
- *certificate.key* - the private key
96+
97+
- *certificate.crt* - the public key
98+
99+
100+
### Create certificate collection
101+
102+
103+
Create the certificate collection in which you will store the service provider and the identity provider certificates.
104+
105+
> ### What is a certificate collection?
106+
> A certificate collection (also referred to as a personal security environment or PSE) is a secure location where the public information (public-key certificates) and private information (private keys) of the SAP HANA server are stored. A certificate collection may also contain the public information (public-key certificates) of trusted communication partners or root certificates from trusted Certification Authorities. For more information, see [Certificate Collections](https://help.sap.com/viewer/6b94445c94ae495c83a19646e7c3fd56/1.0.12/en-US/75d0cfec8e4f44c3a649d26e9cefa314.html).
107+
108+
1. Open the **SAP HANA cockpit** on your SAP HANA XS database system.
109+
110+
You can do so by appending `/sap/hana/admin/cockpit` to the URL of the database system, or you can access it from the SAP BTP cockpit.
111+
112+
![Accessing the SAP HANA cockpit](step3-access-hana-cockpit.png)
113+
114+
2. Open the **Configure Certificate Collections** application.
115+
116+
![Accessing the Certificate Collections application](step3-certificates-collections-app.png)
117+
118+
3. Create a new collection. To do so, choose **+** and enter a **name** for the collection.
119+
120+
![Create a certificate collection](step3-create-cert-collection.png)
121+
122+
4. Edit the collection and set its purpose to **SAML**.
123+
124+
![Set the collection purpose to SAML](step3-set-saml.png)
125+
126+
You have now created a PSE store that we'll use to store the "own" certificate and the identity provider certificate.
127+
128+
129+
130+
### Upload service provider certificates
131+
132+
133+
1. Prepare the upload of the service provider certificates by copying the values from the files you previously created into a new file:
134+
135+
- Copy the values between the *Begin/End Certificate* tags from the *certificate.crt* file.
136+
137+
- Copy the values between the *Begin/End Private RSA Key* tags from the *certificate.key* file.
138+
139+
```
140+
-----BEGIN CERTIFICATE-----
141+
MIIDBTCCAe2gAwIBAgIUMQ0cJjTV5k0UAWqTSPN92LcqBbwwDQYJKoZIhvcNAQEL
142+
BQAwEjEQMA4GA1UEAwwHZXhhbXBsZTAeFw0yMDEwMDUxNDM3MDlaFw0yMzA3MjYx
143+
NDM3MDlaMBIxEDAOBgNVBAMMB2V4YW1wbGUwggEiMA0GCSqGSIb3DQEBAQUAA4IB
144+
DwAwggEKAoIBAQDTJwrq4VZsvPbWg5xQTqU3SloIziYQY9KSOKQ+KbBs+Fl3nWx5
145+
nHeXDLxi3KH5fn5QVY/3s0V60PrVF3lhCa9QvRRytDWCYBAoGstuAMLlyu6NE6rR
146+
5i6GPNC5hvEhWaGDmCWG+ZJx9xinNDBox1jmbjRBuL/taDLqmdRGJGi9WxbtWgAG
147+
3TFXbiEX0apf/35oGtM8R57PTSn3F0TztdHCK37sH3azFYUTv1OMhv9UXpcXV26+
148+
QF0ISjlX+oIJ2kTUcnan7XmxB8f0/VfX4/WPWiHtrqaC8QORGfksn+nLnVttHaam
149+
zrXuYpf7Io7K00kbGkSqywK8+eiSdrjoIBvnAgMBAAGjUzBRMB0GA1UdDgQWBBSY
150+
t74eEI/jXeG89jagMaF8bDji5DAfBgNVHSMEGDAWgBSYt74eEI/jXeG89jagMaF8
151+
bDji5DAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQA32/k3Q3BH
152+
rf8jEai/Hl+P3LEZcIvZjq/1I3dZjTrMKUEeFLC0HCHdbHxmOj4woHaF8yyq8Kas
153+
hxfEvPV6as2oYzZP/zjp3Os0rAWSgd3Gkc/a2FTWY86VDA/Co11prz3KGxM9zNiP
154+
KXu+b1KTTboqisbKPbkWgfRcq2CCKDWq8z9WbVK2GmLRvKwuTpQd4qEVkmk+BNKx
155+
mXcLxR71tjaYH9qT343peLuQH621plBewlErVpf4F298QcBae9tRmWpKgIZHfLGv
156+
4+jh3/DgB9orHIMlh+nVN6P3JiMWk8gUTEpYBStPZlBqJZdtgd4kvi6j+1x7oxxN
157+
QKshzGHvi3y4
158+
-----END CERTIFICATE-----
159+
-----BEGIN RSA PRIVATE KEY-----
160+
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDTJwrq4VZsvPbW
161+
g5xQTqU3SloIziYQY9KSOKQ+KbBs+Fl3nWx5nHeXDLxi3KH5fn5QVY/3s0V60PrV
162+
F3lhCa9QvRRytDWCYBAoGstuAMLlyu6NE6rR5i6GPNC5hvEhWaGDmCWG+ZJx9xin
163+
NDBox1jmbjRBuL/taDLqmdRGJGi9WxbtWgAG3TFXbiEX0apf/35oGtM8R57PTSn3
164+
F0TztdHCK37sH3azFYUTv1OMhv9UXpcXV26+QF0ISjlX+oIJ2kTUcnan7XmxB8f0
165+
/VfX4/WPWiHtrqaC8QORGfksn+nLnVttHaamzrXuYpf7Io7K00kbGkSqywK8+eiS
166+
drjoIBvnAgMBAAECggEBAJThRXhhU++tuRl9iLyzBxkaCquEtx/9Ul6ZI21VNblP
167+
zr1hOTfyE/xkFXxbdrWU8/kuqykKtSWorgOL3qCGFKAIAZ/y4nu/wgSVB/TTApjF
168+
4jeEs3/2Hb22qbD2rZRHP3Oq1mL6G8DRageS68MlM9CdyajBXEpHmwcBWcPvLg68
169+
Hzf3WnjvXLFiShsmiY/MZddUZLwl14pZcNnq9SLqNE9MKWYq46sH4vDl+WizrRRV
170+
xPdlTNrhMa5iZNJe+n4rTHUKmXtij8bImMOYcEq+3RG9gPY0l317Yyo/C7XSvBq9
171+
UujVxnT/erJDsHFtW6BvgqwA6MNzPiK5BhRfr662mGECgYEA/Ukjg4z+VojNtpcA
172+
3vlNyHU0xioxgFtxTyP9mGi/YLaRZvOW0Oo8L8+1yVRdmIiPL6LfSFDJ8n+NxSfL
173+
Eg2OsBSFGlrXIavEyFIPH8wT1xmR3BwXAS4oVLtAU2e3IXzoCVIdaKkQLIJZgVSo
174+
UOlZN1Bqmofr4oAEGJiZV5tgzfcCgYEA1WpQ8WzCFlpblt2Nawe6GEZrSISUT9Xi
175+
bgFJ6S9UEpnzaAoPlmDNxtUWVIbskUheLMvI1ukJ31ksp8AwV1qJwlH8Em+OpSFr
176+
cYQ+PARwNIc9yjMiBXCDNQoaTNR623Tupqxj32sWqfziJ5dTmup5HbMy3uziQLg4
177+
RZsK6dT/ZZECgYBBktjd6vfB4YMYnXl9QJ/xoN5721qbd5EbQx8ZgSzi1gFI3RGT
178+
nsDcQ/M1X2En51rio1EZQMk3vewvOcEqOFZTocxf6Vq+/eBhWFVQDx6n1pfbm24d
179+
QRzx6tSZg0V3JwZPu3Gfsf1c+JZBlHBLGk6dsnUW8s+QAUKON5ujgbeLOwKBgQCN
180+
MdSxlbHnFgroilYIzMjrTJOoG8b/9tLi0slylFR8Jgyq9ZUQeaVK+inW7JlRGV7t
181+
JjoPLYjRku7/YSDaelUQEivCiroGOFEcflCqZolRx3Qy9Zd5n9G+4ps5344U6Y0H
182+
CqDc7L3G4z9A0FaI9L4Cz09Fu9WI2hiovIYA5GHAcQKBgFeemWeiwFPWfN0unQiI
183+
lFP3z7gjdvOugpzsj7s3bvbTudx4RYPiWe77XGO1WUnh0CiasvF0kn92/0e29VS5
184+
RFGWslZ38oZPWdZSqHB7KrbWLJ5O2RAtllEoIgEkaSQ2MRub50MYxt2+W5TAkdBH
185+
S9gO7JxUfif8owON4XCu2KXw
186+
-----END RSA PRIVATE KEY-----
187+
```
188+
189+
2. In the newly created certificate collection, choose **Set Own Certificate**.
190+
191+
3. Select **Paste Content** and paste the prepared content into the text field.
192+
193+
![Paste Content](step4-copy-paste-spc.png)
194+
195+
4. Choose **OK**.
196+
197+
![Successful Upload](step4-upload-result.png)
198+
199+
You have now uploaded the own certificate into your certificate collection.
200+
201+
202+
### Download SAML identity provider certificate
203+
204+
205+
In this example, we'll use SAP Identity Authentication service as an identity provider, but you complete this step with your own identity provider.
206+
207+
To download the metadata from the IDP provider, we'll do the following:
208+
209+
1. In the SAP Identity Authentication Administration console, go to **Tenant Settings** **>** **SAML 2.0 Configuration**. At the bottom of the page, you find the signing certificate.
210+
211+
2. Copy the certificate from the **Insert as Text** field.
212+
213+
![Copy the IDP certificate](step5-copy-idp-cert.png)
214+
215+
3. Paste it into a local text file.
216+
217+
4. Add the BEGIN and END tags to the SAML certificate.
218+
219+
```
220+
-----BEGIN CERTIFICATE-----
221+
MIIDIjCCAgqgAwIBAQIGAUjG8PFJMA0GCSqGSIb3DQEBBQUAMFAxCzAJBgNVB...
222+
-----END CERTIFICATE-----
223+
```
224+
225+
226+
### Upload SAML identity provider certificate
227+
228+
229+
1. In the SAP HANA cockpit, open the **Certificate Store** application.
230+
231+
![Open the certificate store application](step6-certificatestore.png)
232+
233+
2. Choose **Import**.
234+
235+
3. Select **Paste Content** and paste the prepared content into the text field.
236+
237+
![Paste Content](step6-copyin.png)
238+
239+
4. Choose **OK**.
240+
241+
![Paste Content](step6-outcome.png)
242+
243+
You have now uploaded the own certificate into your certificate collection, but as you can see, it hasn't been assigned to a certificate collection yet.
244+
245+
5. Go back to the **Certificate Collections** application.
246+
247+
6. In the collection you've created previously, choose **Add Certificate**.
248+
249+
7. Select the identity provider certificate and choose **OK**.
250+
251+
![Assign the IDP certificate to the collection](step6-assigntoPSE.png)
252+
253+
You have now added the identity provider certificate to the certificate collection as **Trust** validation.
254+
255+
256+
### Make your identity provider trust your SAP HANA system
257+
258+
To make your identity provider trust your SAP HANA database system again as the service provider, we'll export the certificate from the SAP HANA system and register it as the service provider in the identity provider.
259+
260+
>In this example, we'll use SAP Identity Authentication service as an identity provider, but you complete this step with your own identity provider.
261+
262+
1. Open the **XS Admin Tool** on your SAP HANA database system.
263+
264+
You can do so by appending `/sap/hana/xs/admin/#samlsp` to the URL of the database system.
265+
266+
2. From the **Metadata** tab of the **SAML Service Provider** tab, copy the complete XML content into a local file.
267+
268+
![Save the metadata as XML](step7-sp-metadata.png)
269+
270+
3. Save it with the ending `.xml`.
271+
272+
You have no exported the service provider metadata from the SAP HANA system.
273+
274+
4. Register the service provider metadata in your identity provider.
275+
276+
In this example, in the SAP Identity Authentication administration console, we'll do the following:
277+
278+
- Choose **Applications** and open your application.
279+
280+
- Choose **SAML 2.0 Configuration**.
281+
282+
- In the **Define from Metadata** section, choose **Browse...**.
283+
284+
- Select the file you previously downloaded from the SAP HANA system.
285+
286+
- Choose **Save**.
287+
288+
Your certificates are now stored in the in-memory store and you have reconfigured the SAML trust relationship between the SAP HANA XS database system and the identity provider.
289+
290+
---
19.8 KB
Loading
21.3 KB
Loading
177 KB
Loading
177 KB
Loading
122 KB
Loading
85.2 KB
Loading
159 KB
Loading
207 KB
Loading
172 KB
Loading

0 commit comments

Comments
 (0)