Skip to content

Commit ae1edb8

Browse files
committed
Rework mTLS instructions
1 parent 96821f1 commit ae1edb8

File tree

1 file changed

+37
-36
lines changed

1 file changed

+37
-36
lines changed

docs/ingest-from-cloud-foundry-runtime-f5a7c99.md

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -93,60 +93,61 @@ For more information about different contexts, tools, options, and best practice
9393
cf service-key <service-instance> <service-key>
9494
```
9595
96-
5. (a) Create a user provided service using the following the template filled with the values of the previous step and a user-provided-service-name of your choice:
96+
5. Create the User Provided Service (using either simple basic auth or mTLS):
9797
98-
```
99-
cf cups <user-provided-service-name> -l https-batch://<ingest-username>:<ingest-password>@<ingest-endpoint>/cfsyslog?drain-type=all
100-
```
98+
a) Simple basic auth configuration:
10199
102-
(b) **Use mTLS if required:**
103-
104-
Use this if you need mTLS. You still embed the basic auth username/password into the drain URL, while the certificate material is supplied separately as parameters.
105-
106-
5.1 Prerequisites
107-
- You have obtained the binding JSON (cf service-key <service-instance> <service-key>).
108-
109-
5.2 Extract the following fields from the binding JSON:
110-
- ingest-username
111-
- ingest-password
112-
- ingest-mtls-endpoint
113-
- ingest-mtls-cert
114-
- ingest-mtls-key
115-
- server-ca
116-
117-
5.3 Prepare the JSON payload for cf cups. (Newlines must be escaped if passed inline)
118-
```json
119-
creds_payload.json:
120-
{
121-
"ca": "<server-ca>",
122-
"cert": "<ingest-mtls-cert>",
123-
"key": "<ingest-mtls-key>"
124-
}
125-
```
100+
Create a user provided service using the following the template filled with the values of the previous step and a user-provided-service-name of your choice:
126101
127-
5.4 Create the mTLS-enabled user provided service:
128102
```bash
129-
cf cups <user-provided-service-name> \
130-
-l "https-batch://<ingest-username>:<ingest-password>@<ingest-mtls-endpoint>/cfsyslog?drain-data=all" \
131-
-p creds_payload.json
103+
cf cups <user-provided-service-name> -l https-batch://<ingest-username>:<ingest-password>@<ingest-endpoint>/cfsyslog?drain-type=all
132104
```
133105
106+
b) mtls-enabled configuration:
107+
108+
1. Extract the following fields from the binding JSON:
109+
- ingest-username
110+
- ingest-password
111+
- ingest-mtls-endpoint
112+
- ingest-mtls-cert
113+
- ingest-mtls-key
114+
- server-ca
115+
116+
2. Prepare the JSON payload for cf cups. (Newlines must be escaped if passed inline)
117+
```json
118+
creds_payload.json:
119+
{
120+
"ca": "<server-ca>",
121+
"cert": "<ingest-mtls-cert>",
122+
"key": "<ingest-mtls-key>"
123+
}
124+
```
125+
You can also create the payload file using the following command:
126+
```bash
127+
cf service-key <service-instance> <service-key> \
128+
| jq '.credentials | {ca: ."server-ca", cert: ."ingest-mtls-cert", key: ."ingest-mtls-key"}' \
129+
> creds_payload.json
130+
```
131+
132+
3. Create the mTLS-enabled user provided service:
133+
```bash
134+
cf cups <user-provided-service-name> \
135+
-l "https-batch://<ingest-username>:<ingest-password>@<ingest-mtls-endpoint>/cfsyslog?drain-type=all" \
136+
-p creds_payload.json
137+
```
138+
134139
6. Proceed with [Bind the Application to the Service Instance](ingest-from-cloud-foundry-runtime-f5a7c99.md#loiof5a7c993743c4ee79722479371b90b37__bind_the_application) and bind to the user provided service.
135140
136141
**Bind the Application to User Provided Service Using SAP BTP Cockpit**
137142
138143
1. [Log On to the Cloud Foundry Environment Using the SAP BTP Cockpit](https://help.sap.com/docs/btp/sap-business-technology-platform/cloud-foundry-environment).
139144
2. Create a service key according to [Creating Service Keys in Cloud Foundry](https://help.sap.com/viewer/09cc82baadc542a688176dce601398de/Cloud/en-US/6fcac08409db4b0f9ad55a6acd4d31c5.html).
140145
3. Create a User-Provided Service following [Creating User-Provided Service Instances in Cloud Foundry Environment](https://help.sap.com/docs/service-manager/sap-service-manager/creating-user-provided-service-instances-in-cloud-foundry-environment) using `Instance Name` of your choice and the information from the the service key to configure `System Logs Drain URL`:
141-
142146
```
143147
https-batch://<ingest-username>:<ingest-password>@<ingest-endpoint>/cfsyslog?drain-type=all
144148
```
145-
146149
4. Proceed with [Bind the Application to the Service Instance](ingest-from-cloud-foundry-runtime-f5a7c99.md#loiof5a7c993743c4ee79722479371b90b37__bind_the_application) and bind to the user provided service.
147150
148-
149-
150151
<a name="loiof5a7c993743c4ee79722479371b90b37__section_gvg_4k4_xyb"/>
151152
152153
## Result

0 commit comments

Comments
 (0)