Skip to content

Commit 5898f12

Browse files
Initial documentation for OpenSSL
1 parent df81a1b commit 5898f12

File tree

1 file changed

+42
-5
lines changed
  • src/content/docs/ai-gateway/observability/logging

1 file changed

+42
-5
lines changed

src/content/docs/ai-gateway/observability/logging/logpush.mdx

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ sidebar:
66
text: Beta
77
---
88

9-
import { Render } from "~/components";
9+
import { Render, Tabs, TabItem } from "~/components";
1010

1111
AI Gateway allows you to securely export logs to an external storage location, where you can decrypt and process them.
1212
You can toggle Logpush on and off in the [Cloudflare dashboard](https://dash.cloudflare.com) settings.
1313

1414
This guide explains how to set up Logpush for AI Gateway, generate an RSA key pair for encryption, and decrypt the logs once they are received.
1515

16-
You can store up to 10 million logs per gateway. If your limit is reached, new logs will stop being saved and will not be exported through Logpush. To continue saving and exporting logs, you must delete older logs to free up space for new logs. Logpush has a limit of 4 jobs.
16+
You can store up to 10 million logs per gateway. If your limit is reached, new logs will stop being saved and will not be exported through Logpush. To continue saving and exporting logs, you must delete older logs to free up space for new logs. Logpush has a limit of 4 jobs.
1717

1818
:::note[Note]
1919

@@ -27,9 +27,14 @@ To configure Logpush for AI Gateway, follow these steps:
2727

2828
## 1. Generate an RSA key pair locally
2929

30-
You need to generate a key pair to encrypt and decrypt the logs. This script will output your RSA privateKey and publicKey. Keep the private key secure, as it will be used to decrypt the logs. Below is a sample script to generate the keys using Node.js.
30+
You need to generate a key pair to encrypt and decrypt the logs. This script
31+
will output your RSA privateKey and publicKey. Keep the private key secure, as
32+
it will be used to decrypt the logs. Below is a sample script to generate the
33+
keys using Node.js.
3134

32-
```js title="JavaScript"
35+
<Tabs syncKey="JSPlusSSL"> <TabItem label="Javascript">
36+
37+
```js
3338
const crypto = require("crypto");
3439

3540
const { privateKey, publicKey } = crypto.generateKeyPairSync("rsa", {
@@ -54,10 +59,42 @@ Run the script by executing the below code on your terminal. Replace `file name`
5459
node {file name}
5560
```
5661

62+
</TabItem> <TabItem label="OpenSSL">
63+
64+
1. Generate Private Key:
65+
Use the following command to generate a RSA private key:
66+
67+
```bash
68+
openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:4096
69+
```
70+
71+
2. Generate Public Key:
72+
After generating the private key, you can extract the corresponding public key using:
73+
74+
```bash
75+
openssl rsa -pubout -in private_key.pem -out public_key.pem
76+
```
77+
78+
3. View Private and Public Keys:
79+
You can verify the contents of the generated keys by using the following commands:
80+
81+
- To view the private key:
82+
83+
```bash
84+
cat private_key.pem
85+
```
86+
87+
- To view the public key:
88+
89+
```bash
90+
cat public_key.pem
91+
```
92+
93+
</TabItem> </Tabs>
5794

5895
## 2. Upload public key to gateway settings
5996

60-
Once you have generated the key pair, upload the public key to your AI Gateway settings. This key will be used to encrypt your logs. In order to enable Logpush, you will need logs enabled for that gateway.
97+
Once you have generated the key pair, upload the public key to your AI Gateway settings. This key will be used to encrypt your logs. In order to enable Logpush, you will need logs enabled for that gateway.
6198

6299
## 3. Set up Logpush
63100

0 commit comments

Comments
 (0)