Skip to content

Commit 5aca469

Browse files
authored
Merge pull request #39 from nicklas-dohrn/mtls-cups-update
Add mtls section to ingest from cf
2 parents d56bb74 + ae0333e commit 5aca469

File tree

1 file changed

+39
-6
lines changed

1 file changed

+39
-6
lines changed

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

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,28 +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. 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-
```
98+
a) Simple basic auth configuration:
99+
100+
To create a user-provided service, use the following template, filled with the values from the previous step and a <user-provided-service-name> of your choice:
101+
102+
```bash
99103
cf cups <user-provided-service-name> -l https-batch://<ingest-username>:<ingest-password>@<ingest-endpoint>/cfsyslog?drain-type=all
100104
```
101105
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+
credentials.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+
> credentials.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 credentials.json
137+
```
138+
102139
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.
103140
104141
**Bind the Application to User Provided Service Using SAP BTP Cockpit**
105142
106143
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).
107144
2. Create a service key according to [Creating Service Keys in Cloud Foundry](https://help.sap.com/viewer/09cc82baadc542a688176dce601398de/Cloud/en-US/6fcac08409db4b0f9ad55a6acd4d31c5.html).
108145
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`:
109-
110146
```
111147
https-batch://<ingest-username>:<ingest-password>@<ingest-endpoint>/cfsyslog?drain-type=all
112148
```
113-
114149
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.
115150
116-
117-
118151
<a name="loiof5a7c993743c4ee79722479371b90b37__section_gvg_4k4_xyb"/>
119152
120153
## Result

0 commit comments

Comments
 (0)