From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 841CC1FF140 for ; Fri, 10 Apr 2026 18:54:59 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0B2E522F49; Fri, 10 Apr 2026 18:55:44 +0200 (CEST) From: Christian Ebner To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox v2 02/27] pbs-api-types: sync job: add optional cryptographic keys to config Date: Fri, 10 Apr 2026 18:54:29 +0200 Message-ID: <20260410165454.1578501-3-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260410165454.1578501-1-c.ebner@proxmox.com> References: <20260410165454.1578501-1-c.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1775840035513 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.068 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: YZIRSCQYBI6U76R7FOTZTKCMGCWVE4WV X-Message-ID-Hash: YZIRSCQYBI6U76R7FOTZTKCMGCWVE4WV X-MailFrom: c.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Allows to configure the active encryption key, used to encrypt backups when performing sync jobs in push direction. Further, allows to associated keys to a sync job, used as decryption keys for pull sync jobs for snapshots with matching key fingerprint. For push sync jobs the associated keys are used to keep track of previously in-use encryption keys, assuring that they are only removable if the user actually removed the association. This is used as safety net against involuntary key deletion. The field name `associated-key` was chosen since the sync job config stores the list items on separate lines with property name, so the resulting config will be structured as shown: ``` sync: encrypt-sync active-encryption-key key2 associated-key key1 associated-key key0 ... ``` Signed-off-by: Christian Ebner --- pbs-api-types/src/jobs.rs | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/pbs-api-types/src/jobs.rs b/pbs-api-types/src/jobs.rs index 7e6dfb94..59f2820f 100644 --- a/pbs-api-types/src/jobs.rs +++ b/pbs-api-types/src/jobs.rs @@ -13,8 +13,9 @@ use proxmox_schema::*; use crate::{ Authid, BackupNamespace, BackupType, NotificationMode, RateLimitConfig, Userid, BACKUP_GROUP_SCHEMA, BACKUP_NAMESPACE_SCHEMA, BACKUP_NS_RE, DATASTORE_SCHEMA, - DRIVE_NAME_SCHEMA, MEDIA_POOL_NAME_SCHEMA, NS_MAX_DEPTH_REDUCED_SCHEMA, PROXMOX_SAFE_ID_FORMAT, - PROXMOX_SAFE_ID_REGEX_STR, REMOTE_ID_SCHEMA, SINGLE_LINE_COMMENT_SCHEMA, + DRIVE_NAME_SCHEMA, CRYPT_KEY_ID_SCHEMA, MEDIA_POOL_NAME_SCHEMA, + NS_MAX_DEPTH_REDUCED_SCHEMA, PROXMOX_SAFE_ID_FORMAT, PROXMOX_SAFE_ID_REGEX_STR, + REMOTE_ID_SCHEMA, SINGLE_LINE_COMMENT_SCHEMA, }; const_regex! { @@ -664,6 +665,18 @@ pub const UNMOUNT_ON_SYNC_DONE_SCHEMA: Schema = type: SyncDirection, optional: true, }, + "active-encryption-key": { + schema: CRYPT_KEY_ID_SCHEMA, + optional: true, + }, + "associated-key": { + type: Array, + description: "List of cryptographic keys associated with sync job.", + items: { + schema: CRYPT_KEY_ID_SCHEMA, + }, + optional: true, + }, } )] #[derive(Serialize, Deserialize, Clone, Updater, PartialEq)] @@ -709,6 +722,10 @@ pub struct SyncJobConfig { pub unmount_on_done: Option, #[serde(skip_serializing_if = "Option::is_none")] pub sync_direction: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub active_encryption_key: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub associated_key: Option>, } impl SyncJobConfig { -- 2.47.3