Update signing configuration to use private key for recording validation

This commit is contained in:
Cédric Verstraeten
2025-06-02 14:06:16 +00:00
parent 5310dd4550
commit b3cfabb5df
3 changed files with 6 additions and 6 deletions

View File

@@ -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

View File

@@ -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
}
}

View File

@@ -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"`
}