-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Rfc/privileged rshell helper #55731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
gh-worker-dd-mergequeue-cf854d
merged 38 commits into
main
from
rfc/privileged-rshell-helper
Sep 4, 2026
Merged
Rfc/privileged rshell helper #55731
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
8781812
Add privileged rshell execution path
astuyve 28fa069
Bootstrap Agent build tooling on Linux targets
astuyve 5e8d9af
Add native target triples to helper build script
astuyve 38b5bfd
fix script to use gh release download
astuyve f3edfc7
forward verified signing keys to rshell helper
astuyve 9576321
Update rshell for helper authorization diagnostics
astuyve b8de5aa
Update rshell path policy intersection
astuyve bb78c08
feat(par): package sandboxed rshell helper
astuyve 523135a
feat(privateactionrunner): validate rshell keys with TUF Director
astuyve 8cfd18e
feat: make privileged rshell policy optional
astuyve 6ac4eb6
Merge remote-tracking branch 'origin/main' into rfc/privileged-rshell…
astuyve 81c51de
feat(installer): install privileged rshell helper
astuyve b69d01e
Bump rshell privileged helper revision
astuyve a00f4d1
fix(installer): shorten generated systemd fixture paths
astuyve 95a6ba0
fix(installer): scope rshell fixture path shortening
astuyve f63d19f
chore: update rshell helper revision
astuyve 4b62c83
Fix: Enforce root ownership for the systemd service definition so the…
astuyve 7691a1e
bzl
astuyve cc0391e
chore: update rshell helper revision
astuyve 9af1c1e
fix(par): allow privileged read-only rshell actions
astuyve 8444d22
refactor(remote-config): split TUF proof provider interface
astuyve 33c29e1
fix(par): harden privileged rshell lifecycle
astuyve adf2e32
fix(fleet): preserve agent ownership during rshell setup
astuyve 46d8c3b
Merge remote-tracking branch 'origin/main' into rfc/privileged-rshell…
astuyve c553a1b
remove plan and custom build script
astuyve 53b511c
remove plan and custom build script
astuyve 1806704
Bump static quality gates
astuyve 227ad0c
Use rshell v0.0.26 and combine quality gate bumps
astuyve 56565d7
Merge remote-tracking branch 'origin/main' into rfc/privileged-rshell…
astuyve a4a4f07
Build rshell with Bazel
astuyve 5c66aab
Move rshell dependency anchor under product
astuyve 196069a
Bump static quality gates
astuyve 1f31c02
release note
astuyve d86178c
fix(installer): decouple rshell units from action runner
astuyve ecbf20f
fix: Revert stupid claude suggestion, disable privileged helper servi…
astuyve 54e8a66
Merge remote-tracking branch 'origin/main' into rfc/privileged-rshell…
astuyve c5ee00e
Merge branch 'main' into rfc/privileged-rshell-helper
astuyve 1199dcf
Merge branch 'main' into rfc/privileged-rshell-helper
astuyve File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| // Unless explicitly stated otherwise all files in this repository are licensed | ||
| // under the Apache License Version 2.0. | ||
| // This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
| // Copyright 2026-present Datadog, Inc. | ||
|
|
||
| package client | ||
|
|
||
| import ( | ||
| "slices" | ||
|
|
||
| pbgo "github.com/DataDog/datadog-agent/pkg/proto/pbgo/core" | ||
| "github.com/DataDog/datadog-agent/pkg/remoteconfig/state" | ||
| ) | ||
|
|
||
| // GetConfigTUFProof returns a defensive copy of the current Director proof for | ||
| // targetPath. It returns false until the target and signed Targets metadata have | ||
| // both been received from the Core Agent. | ||
| func (c *Client) GetConfigTUFProof(targetPath string) (state.ConfigTUFProof, bool) { | ||
| c.proofMu.RLock() | ||
| defer c.proofMu.RUnlock() | ||
|
|
||
| targetFile, ok := c.proofTargetFiles[targetPath] | ||
| if !ok || len(c.proofTargets) == 0 { | ||
| return state.ConfigTUFProof{}, false | ||
| } | ||
| return state.ConfigTUFProof{ | ||
| Roots: cloneByteSlices(c.proofRoots), | ||
| Targets: slices.Clone(c.proofTargets), | ||
| TargetPath: targetPath, | ||
| TargetFile: slices.Clone(targetFile), | ||
| }, true | ||
| } | ||
|
|
||
| // storeConfigTUFProof retains the complete proof chain from the bootstrap root | ||
| // reported by this downstream client. It is called only after the corresponding | ||
| // repository update has been accepted. | ||
| func (c *Client) storeConfigTUFProof(update *pbgo.ClientGetConfigsResponse) { | ||
| if len(update.Targets) == 0 { | ||
| return | ||
| } | ||
|
|
||
| c.proofMu.Lock() | ||
| defer c.proofMu.Unlock() | ||
|
|
||
| for _, root := range update.Roots { | ||
| c.proofRoots = append(c.proofRoots, slices.Clone(root)) | ||
| } | ||
| c.proofTargets = slices.Clone(update.Targets) | ||
|
|
||
| currentTargets := make(map[string]struct{}, len(update.ClientConfigs)) | ||
| for _, targetPath := range update.ClientConfigs { | ||
| currentTargets[targetPath] = struct{}{} | ||
| } | ||
| for targetPath := range c.proofTargetFiles { | ||
| if _, ok := currentTargets[targetPath]; !ok { | ||
| delete(c.proofTargetFiles, targetPath) | ||
| } | ||
| } | ||
| for _, targetFile := range update.TargetFiles { | ||
| c.proofTargetFiles[targetFile.Path] = slices.Clone(targetFile.Raw) | ||
| } | ||
| } | ||
|
|
||
| func cloneByteSlices(values [][]byte) [][]byte { | ||
| cloned := make([][]byte, len(values)) | ||
| for i, value := range values { | ||
| cloned[i] = slices.Clone(value) | ||
| } | ||
| return cloned | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Affected test packages fail to compile and block CI.
Assertion details
Update all RC client implementations, or use a smaller interface for proof access.Existing mock RC clients do not implement GetConfigTUFProof. Packages that use these mocks do not compile.Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest · Open Bits AI session
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed: the production RC component and adapter implement GetConfigTUFProof, and all five test doubles implementing rcclient.Component now provide the method as well. Focused tests for rcclient, queryactions, datasecurity, datastreams, SNMP check config, eBPF, and private action runner all pass.