You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AI Gateway allows you to securely export logs to an external storage location, where you can decrypt and process them.
12
12
You can toggle Logpush on and off in the [Cloudflare dashboard](https://dash.cloudflare.com) settings.
@@ -37,7 +37,9 @@ To configure Logpush for AI Gateway, follow these steps:
37
37
38
38
## 1. Generate an RSA key pair locally
39
39
40
-
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.
40
+
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 and OpenSSL.
Run the script by executing the below code on your terminal. Replace `file name` with the name of your JavaScript file.
@@ -179,7 +202,33 @@ Run the script by executing the below code on your terminal. Replace `file name`
179
202
node {file name}
180
203
```
181
204
182
-
## Script Explanation
183
-
184
205
The script reads the encrypted log file `(my_log.log.gz)`, decrypts the metadata, request body, and response body, and prints the decrypted data.
185
206
Ensure you replace the `privateKey` variable with your actual private RSA key that you generated in step 1.
207
+
208
+
</TabItem> <TabItemlabel="OpenSSL">
209
+
210
+
1. Decrypt the encrypted log file using the private key.
211
+
212
+
Assuming that the logs were encrypted with the public key (for example `public_key.pem`), you can use the private key (`private_key.pem`) to decrypt the log file.
213
+
214
+
For example, if the encrypted logs are in a file named `encrypted_logs.bin`, you can decrypt it like this:
0 commit comments