From b3cfabb5dfff4f0d911cab490579d2fecaa4ecdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Verstraeten?= Date: Mon, 2 Jun 2025 14:06:16 +0000 Subject: [PATCH] Update signing configuration to use private key for recording validation --- README.md | 2 +- machinery/src/config/main.go | 6 +++--- machinery/src/models/Config.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 47e7bf1..e61aee3 100644 --- a/README.md +++ b/README.md @@ -258,7 +258,7 @@ Next to attaching the configuration file, it is also possible to override the co | `AGENT_ENCRYPTION_PRIVATE_KEY` | The private key (assymetric/RSA) to decrypt and sign requests send over MQTT. | "" | | `AGENT_ENCRYPTION_SYMMETRIC_KEY` | The symmetric key (AES) to encrypt and decrypt requests sent over MQTT. | "" | | `AGENT_SIGNING` | Enable 'true' or disable 'false' for signing recordings. | "true" | -| `AGENT_SIGNING_PUBLIC_KEY` | The public key (RSA) to sign the recordings fingerprint to validate origin. | "" - uses default one if empty | +| `AGENT_SIGNING_PRIVATE_KEY` | The private key (RSA) to sign the recordings fingerprint to validate origin. | "" - uses default one if empty | ## Encryption diff --git a/machinery/src/config/main.go b/machinery/src/config/main.go index fb51c23..974f9f5 100644 --- a/machinery/src/config/main.go +++ b/machinery/src/config/main.go @@ -524,9 +524,9 @@ func OverrideWithEnvironmentVariables(configuration *models.Configuration) { case "AGENT_SIGNING": configuration.Config.Signing.Enabled = value break - case "AGENT_SIGNING_PUBLIC_KEY": - signingPublicKey := strings.ReplaceAll(value, "\\n", "\n") - configuration.Config.Signing.PublicKey = signingPublicKey + case "AGENT_SIGNING_PRIVATE_KEY": + signingPrivateKey := strings.ReplaceAll(value, "\\n", "\n") + configuration.Config.Signing.PrivateKey = signingPrivateKey break } } diff --git a/machinery/src/models/Config.go b/machinery/src/models/Config.go index 3c4b200..ffc7f70 100644 --- a/machinery/src/models/Config.go +++ b/machinery/src/models/Config.go @@ -183,6 +183,6 @@ type Encryption struct { // Signing type Signing struct { - Enabled string `json:"enabled" bson:"enabled"` - PublicKey string `json:"public_key" bson:"public_key"` + Enabled string `json:"enabled" bson:"enabled"` + PrivateKey string `json:"private_key" bson:"private_key"` }