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
add ability to send encrypted secrets to disco backend
For now, this uses a hardcoded RSA key for which I threw away the
private key, since we don't have the ability to pull JWKs yet
This also includes a few test tweaks to help make this easier, and an
example folder which produces an output.json showing how this can work
Signed-off-by: Ashley Davis <ashley.davis@cyberark.com>
This example demonstrates how to use the disco agent to gather Kubernetes secrets and encrypt their data fields.
4
+
5
+
## Overview
6
+
7
+
When the `ARK_SEND_SECRETS` environment variable is set to `"true"`, the disco agent will:
8
+
9
+
0. Fetch an encryption key from the configured endpoint (if running in production) or use a local key for testing
10
+
1. Discover Kubernetes secrets in your cluster (excluding common system secret types)
11
+
2. Encrypt each secret's data fields using RSA envelope encryption with JWE (JSON Web Encryption) format
12
+
3. If running in production, send the encrypted secrets to the configured endpoint; otherwise, write them to `output.json` for testing
13
+
14
+
The encryption uses:
15
+
16
+
-**Key Algorithm**: RSA-OAEP-256 (for encrypting the content encryption key)
17
+
-**Content Encryption**: AES-256-GCM (for encrypting the actual secret data)
18
+
-**Format**: JWE Compact Serialization
19
+
20
+
Metadata (names, namespaces, labels, annotations) remains in plaintext for discovery purposes, while the sensitive secret data is encrypted. Some keys in Secret data fields are also preserved in the `data` section, for backwards compatibility.
21
+
22
+
## Prerequisites
23
+
24
+
1. A running Kubernetes cluster with secrets to discover
25
+
3. Go installed
26
+
27
+
## Configuration File
28
+
29
+
The `config.yaml` file configures:
30
+
31
+
- The data gatherer to collect Kubernetes secrets
32
+
- Field selectors to exclude system secrets (service account tokens, docker configs, etc.)
33
+
- The cluster ID and organization ID for grouping data
0 commit comments