-
Notifications
You must be signed in to change notification settings - Fork 48
feat(nvsnap): shared-token authentication for the agent API #555
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
+1,295
−31
Merged
Changes from 5 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
744b617
fix(nvsnap): confine agent path construction to its own directories
balaji-g 7a59a4d
test(nvsnap): fold path-safety tests into pathsafe_test.go
balaji-g c49d23c
feat(nvsnap): shared-token authentication for the agent API (#486)
balaji-g 2dfd2d7
feat(nvsnap): send and require the agent token end to end (#486)
balaji-g 28ea9be
fix(nvsnap): address review on agent authentication (#486)
balaji-g 0f368ff
feat(nvsnap): make pod networking a supported mode for the agent (#561)
balajinvda 8185411
Merge origin/main into nvsnap-agent-auth
balaji-g 6c34a38
build(nvsnap): drop the k8s.io/utils/ptr import from the webhook
balaji-g 8827b43
Merge origin/main into nvsnap-agent-auth (#472 landed)
balaji-g d2b1ad4
fix(nvsnap): send the agent token from checkpoint.sh
balaji-g 1a087a9
fix(nvsnap): send the agent token from every API caller (#734)
balaji-g 3344047
fix(nvsnap): send the agent token from nvsnap-server (#736)
balaji-g cbc318c
fix(nvsnap): close token-leak and token-reach gaps in agent auth (#736)
balaji-g 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
45 changes: 45 additions & 0 deletions
45
src/compute-plane-services/nvsnap/deploy/helm/nvsnap/templates/agent-token-secret.yaml
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,45 @@ | ||
| {{- if .Values.agent.auth.enabled }} | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Shared bearer token for the agent HTTP API (GH #486). | ||
| # | ||
| # The agent API is the control surface of a privileged process and the | ||
| # DaemonSet binds it to every node's IP, so it needs authentication in the | ||
| # request path. This Secret holds the token both the agent (to verify) and its | ||
| # callers (to present) read. | ||
| # | ||
| # Generated once and preserved across upgrades: `helm upgrade` re-renders every | ||
| # template, so a freshly random token on each upgrade would rotate the | ||
| # credential out from under running callers and cause a self-inflicted outage | ||
| # mid-rollout. The lookup below reuses the existing value when the Secret is | ||
| # already present. Set agent.auth.token explicitly to manage it yourself (or to | ||
| # rotate deliberately). | ||
| {{- $ns := .Release.Namespace }} | ||
| {{- $name := "nvsnap-agent-token" }} | ||
| {{- $existing := lookup "v1" "Secret" $ns $name }} | ||
| {{- $token := "" }} | ||
| {{- if .Values.agent.auth.token }} | ||
| {{- $token = .Values.agent.auth.token | b64enc }} | ||
| {{- else if and $existing $existing.data $existing.data.token }} | ||
| {{- $token = $existing.data.token }} | ||
| {{- else }} | ||
| {{- $token = randAlphaNum 48 | b64enc }} | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| {{- end }} | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: {{ $name }} | ||
| namespace: {{ $ns }} | ||
| labels: | ||
| app.kubernetes.io/name: nvsnap | ||
| app.kubernetes.io/part-of: nvsnap | ||
| annotations: | ||
| # helm.sh/resource-policy keeps the Secret if the release is removed with | ||
| # --keep-history style workflows; without it a delete/reinstall cycle | ||
| # silently rotates the token. | ||
| helm.sh/resource-policy: keep | ||
| type: Opaque | ||
| data: | ||
| token: {{ $token }} | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| {{- end }} | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.