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
Copy file name to clipboardExpand all lines: src/content/docs/ai-gateway/observability/logging/logpush.mdx
+83-28Lines changed: 83 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,14 +13,24 @@ You can toggle Logpush on and off in the [Cloudflare dashboard](https://dash.clo
13
13
14
14
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.
15
15
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.
17
17
18
18
:::note[Note]
19
19
20
20
To export logs using Logpush, you must have logs turned on for the gateway.
21
21
22
22
:::
23
23
24
+
## How logs are encrypted
25
+
26
+
We employ a hybrid encryption model efficiency and security. Initially, an AES key is generated for each log. This AES key is what actually encrypts the bulk of your data, chosen for its speed and security in handling large datasets efficiently.
27
+
28
+
Now, for securely sharing this AES key, we use RSA encryption. Here's what happens: the AES key, although lightweight, needs to be transmitted securely to the recipient. We encrypt this key with the recipient's RSA public key. This step leverages RSA's strength in secure key distribution, ensuring that only someone with the corresponding RSA private key can decrypt and use the AES key.
29
+
30
+
Once encrypted, both the AES-encrypted data and the RSA-encrypted AES key are sent together. Upon arrival, the recipient's system uses the RSA private key to decrypt the AES key. With the AES key now accessible, it's straightforward to decrypt the main data payload.
31
+
32
+
This method combines the best of both worlds: the efficiency of AES for data encryption with the secure key exchange capabilities of RSA, ensuring data integrity, confidentiality, and performance are all optimally maintained throughout the data lifecycle.
33
+
24
34
## Setting up Logpush
25
35
26
36
To configure Logpush for AI Gateway, follow these steps:
@@ -57,7 +67,7 @@ node {file name}
57
67
58
68
## 2. Upload public key to gateway settings
59
69
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.
70
+
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.
61
71
62
72
## 3. Set up Logpush
63
73
@@ -69,49 +79,94 @@ After configuring Logpush, logs will be sent encrypted using the public key you
69
79
70
80
## 5. Decrypt logs
71
81
72
-
To decrypt the encrypted log bodies and metadata from AI Gateway, you can use the following Node.js script:
82
+
To decrypt the encrypted log bodies and metadata from AI Gateway, download the logs to a folder, in this case its named `my_log.log.gz`.
83
+
84
+
Then copy this javascript file into the same folder and place your private key in the top variable.
0 commit comments