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>
Copy file name to clipboardExpand all lines: deploy/charts/disco-agent/README.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -295,6 +295,13 @@ This cluster name will be associated with the data that the agent uploads to the
295
295
A short description of the cluster where the agent is deployed (optional).
296
296
297
297
This description will be associated with the data that the agent uploads to the Discovery and Context service. The description may include contact information such as the email address of the cluster administrator, so that any problems and risks identified by the Discovery and Context service can be communicated to the people responsible for the affected secrets.
298
+
#### **config.sendSecrets** ~ `bool`
299
+
> Default value:
300
+
> ```yaml
301
+
> false
302
+
> ```
303
+
304
+
Enable sending of Secret data to CyberArk, in addition to the metadata. When enabled, Secret data is encrypted using envelope encryption using a key managed by CyberArk. Default: false (but default will change to true for a future release)
Copy file name to clipboardExpand all lines: deploy/charts/disco-agent/values.schema.json
+8Lines changed: 8 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -118,6 +118,9 @@
118
118
},
119
119
"period": {
120
120
"$ref": "#/$defs/helm-values.config.period"
121
+
},
122
+
"sendSecrets": {
123
+
"$ref": "#/$defs/helm-values.config.sendSecrets"
121
124
}
122
125
},
123
126
"type": "object"
@@ -148,6 +151,11 @@
148
151
"description": "Push data every 12 hours unless changed.",
149
152
"type": "string"
150
153
},
154
+
"helm-values.config.sendSecrets": {
155
+
"default": false,
156
+
"description": "Enable sending of Secret data to CyberArk, in addition to the metadata. When enabled, Secret data is encrypted using envelope encryption using a key managed by CyberArk. Default: false (but default will change to true for a future release)",
157
+
"type": "boolean"
158
+
},
151
159
"helm-values.extraArgs": {
152
160
"default": [],
153
161
"description": "extraArgs:\n- --logging-format=json\n- --log-level=6 # To enable HTTP request logging",
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