Repository navigation
feat(dgw): keep provisioner task secrets in the provisioning store - #2058
Open
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 4 commits into
Open
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 4 commits into
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 4 commits into
Conversation
irvingouj@Devolutions (irvingoujAtDevolution)
added this pull request to stack #2059
October 8, 2026 19:35
irvingouj@Devolutions (irvingoujAtDevolution)
marked this pull request as ready for review
October 8, 2026 19:40
Copilot started reviewing on behalf of
irvingouj@Devolutions (irvingoujAtDevolution)
October 8, 2026 19:41
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Caller-controlled timestamps can bypass task-secret expiry enforcement.
1 open finding
What changed in this PR
Adds encrypted, in-memory storage for provisioner task secrets.
Changes:
- Adds task-secret insertion, retrieval, removal, expiry, and cleanup.
- Exposes credential encryption helpers for arbitrary secrets.
- Adds lifecycle and isolation tests.
| File | Description |
|---|---|
devolutions-gateway/src/provisioning.rs |
Implements the task-secret store and tests. |
devolutions-gateway/src/credential/mod.rs |
Adds secret encryption and decryption helpers. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
feat/provisioning-task-secrets
branch
from
October 8, 2026 20:05
f0c996e to
e5fd7ff
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
feat/provisioning-task-secrets
branch
from
October 8, 2026 22:57
1fcf695 to
da6b63b
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
feat/provisioning-task-secrets
branch
2 times, most recently
from
October 13, 2026 17:01
79b7cbc to
001325b
Compare
The provisioning store gains a third kind of provisioned material, next to the injected credentials and the connection options: the secrets of provisioner tasks, such as the API key of an AI analysis. A provisioner task needs them while it runs, but they must never be written to disk. Task secrets are keyed by Task ID and follow their own policy, as the credential intent asks for each kind of provisioning: a new secret replaces the old one, and a secret goes away when its Task ends or at its expiry, through the existing cleanup task. Like the injected credentials, they are encrypted on the way in with the in-memory master key, and decrypted into a zeroizing value only when read. The store treats a secret as an opaque string, so each task decides what it holds. The session halves are unchanged.
task_secret took the current time from its caller, so a caller passing an earlier time could still read an expired secret. It now reads the clock itself.
Keep the existing `ProvisioningStore` paragraphs as they were and only add the task-secrets paragraph, and describe the task secret methods by what they guarantee rather than by what the AI analysis caller stores. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- The store keeps an entry until it is removed or expires; removing it when the Task ends is the caller's job. - `insert_task_secret` takes the secret in clear and encrypts it. - The tests are named after what they check: the Debug output never shows the secret, and the cleanup pass, not the cleanup task, removes it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
feat/provisioning-task-secrets
branch
from
October 13, 2026 17:21
001325b to
25c06b4
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
removed this pull request from stack #2059
October 13, 2026 17:32
irvingouj@Devolutions (irvingoujAtDevolution)
added this pull request to stack #2073
October 13, 2026 17:32
irvingouj@Devolutions (irvingoujAtDevolution)
requested a review
from Benoît Cortier (CBenoit)
October 13, 2026 18:19
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The provisioning store, which already holds the injected credentials and connection options DVLS hands Gateway for a session, can now also hold the secrets of provisioner tasks: something a task needs while it runs but that must never be written to disk. The first one is the API key of an AI analysis (#2044).
This is the third kind of provisioned material, with its own policy, as
credential/INTENT.mdasks ("the policy for different kinds of provisioning should be defined on a per-kind basis"):remove_task_secret) or at its expiry, by the existing cleanup taskSecretStringonly when readThe session halves (credentials and connection options) are unchanged.
credentialgainsencrypt_secret/decrypt_secret, thin entry points over the existing master key.Where to look
provisioning.rs:insert_task_secret,task_secret,remove_task_secret, and the cleanup (remove_expired,next_expiry)credential/mod.rs: the two entry pointsTested: provisioning tests 19/19, incl. a secret read back but never held in clear, removal and expiry through the cleanup, and session credentials untouched by task secrets.
🤖 Generated with Claude Code